Sample Scripts for Managing vSphere Policy-Based Storage with VMware vSphere PowerCLI

To help you get started with VMware vSphere PowerCLI, this documentation provides a set of sample scripts that illustrate basic and advanced tasks in vSphere policy-based storage management.

Subtopics
Create a Tag-Based Storage Policy
Create a Capability-Based Storage Policy
Associate a Storage Policy with a Virtual Machine and Its Hard Disk
Disassociate a Storage Policy Associated with a Virtual Machine and Its Hard Disk
Enable SPBM on a Cluster and Verify that It Is Enabled
Remove a Storage Policy
Edit a Storage Policy
Export and Import a Storage Policy
Create a Virtual Machine in a Datastore Compatible with Storage Policy
Create a Virtual SAN Datastore
Modify a Virtual SAN Datastore
Create an NFS 4.1 Datastore
Add a VASA Provider and Create a Policy