Edit

Share via


Configure a VMware vSAN storage policy

VMware vSAN storage policies define storage requirements for your virtual machines (VMs). These policies guarantee that your VMs have the required level of service because they determine how storage is allocated to each VM. Every VM that you deploy to a vSAN datastore is assigned at least one VM storage policy.

You can assign a VM storage policy during a VM's initial deployment or during other VM operations, such as cloning or migrating. Post-deployment users with the cloudadmin or equivalent roles can't change the default storage policy for a VM. However, VM storage policy per disk changes is permitted.

Authorized users can use the Run command to change the default or existing VM storage policy to an available policy for a VM after deployment. There are no changes made on the disk-level VM storage policy. You can always change the disk-level VM storage policy according to your requirements.

Run commands are executed one at a time in the order submitted.

In this article, learn how to:

  • List all storage policies.
  • Set the storage policy for a VM.
  • Specify the default storage policy for a cluster.
  • Create a storage policy.
  • Remove a storage policy.

Prerequisites for vSAN OSA-based clusters

Make sure that the minimum level of hosts is met, according to the following table:

RAID configuration Failures to tolerate (FTT) Minimum hosts required
RAID-1 (mirroring)
Default setting
1 3
RAID-5 (erasure coding) 1 4
RAID-1 (mirroring) 2 5
RAID-6 (erasure coding) 2 6
RAID-1 (mirroring) 3 7

Prerequisites for vSAN ESA-based clusters

Make sure that the minimum level of hosts is met, according to the following table:

RAID configuration Failures to tolerate (FTT) Minimum hosts required
RAID-1 (mirroring)
Default setting
1 3
RAID-5 (ESA optimized) 1 3
RAID-1 (mirroring) 2 5
RAID-6 (ESA optimized) 2 5
RAID-1 (mirroring) 3 7

List storage policies

Run the Get-StoragePolicy cmdlet to list the vSAN-based storage policies that are available to set on a VM.

  1. Sign in to the Azure portal or, if applicable, sign in to the Azure US Government portal.

  2. Select Run command > Packages > Get-StoragePolicies.

    Screenshot that shows how to access the available storage policy run commands.

  3. Provide the required values or change the default values according to the following table. Then select Run.

    Field Value
    Retain up to Retention period of the cmdlet output. The default value is 60.
    Specify name for execution Alphanumeric name. For example, Get-StoragePolicies-Exec1.
    Timeout The period after which a cmdlet exits if it's taking too long to finish.

    Screenshot that shows how to list available storage policies.

  4. Check Notifications to see the progress.

Set a storage policy on a VM

Run the Set-VMStoragePolicy cmdlet to modify vSAN-based storage policies on a default cluster, individual VM, or group of VMs sharing a similar VM name. For example, if you have three VMs named MyVM1, MyVM2, and MyVM3, supplying MyVM to the VMName parameter would change the StoragePolicy on all three VMs.

Note

You can't use the vSphere Client to change the default storage policy or any existing storage policies for a VM.

  1. Select Run command > Packages > Set-VMStoragePolicy.

  2. Provide the required values or change the default values according to the following table. Then select Run.

    Field Value
    VMName Name of the target VM.
    StoragePolicyName Name of the storage policy that you want to set. For example, RAID1 FTT-1.
    Retain up to Retention period of the cmdlet output. The default value is 60.
    Specify name for execution Alphanumeric name. For example, changeVMStoragePolicy.
    Timeout The period after which a cmdlet exits if it's taking too long to finish.
  3. Check Notifications to see the progress.

Set a storage policy on all VMs in a ___location

Run the Set-LocationStoragePolicy cmdlet to modify vSAN-based storage policies on all VMs in a ___location in which a ___location is the name of a cluster, resource pool, or folder. For example, if you have three VMs in Cluster-3, supplying Cluster-3 would change the storage policy on all three VMs.

Note

You can't use the vSphere client to change the default storage policy or any existing storage policies for a VM.

  1. Select Run command > Packages > Set-LocationStoragePolicy.

  2. Provide the required values or change the default values according to the following table. Then select Run.

    Field Value
    Location Name of the target VM.
    StoragePolicyName Name of the storage policy to set. For example, RAID1 FTT-1.
    Retain up to Retention period of the cmdlet output. The default value is 60.
    Specify name for execution Alphanumeric name. For example, changeVMStoragePolicy.
    Timeout The period after which a cmdlet exits if it's taking too long to finish.
  3. Check Notifications to see the progress.

Specify a storage policy for a cluster

Run the Set-ClusterDefaultStoragePolicy cmdlet to specify a default storage policy for a cluster.

  1. Select Run command > Packages > Set-ClusterDefaultStoragePolicy.

  2. Provide the required values or change the default values according to the following table. Then select Run.

    Field Value
    ClusterName Name of the cluster.
    StoragePolicyName Name of the storage policy to set. For example, RAID1 FTT-1.
    Retain up to Retention period of the cmdlet output. The default value is 60.
    Specify name for execution Alphanumeric name. For example, Set-ClusterDefaultStoragePolicy-Exec1.
    Timeout The period after which a cmdlet exits if it's taking too long to finish.
  3. Check Notifications to see the progress.

Note

Changing the default cluster policy affects only new VMs. Existing VMs retain the policy they're currently configured or deployed with.

Create a custom Azure VMware Solution storage policy

Run the New-AVSStoragePolicy cmdlet to create or overwrite an existing policy. This function creates a new, or overwrites an existing, vSphere storage policy. Non-vSAN-based, vSAN-only-based, VMEncryption-only-based, tag-only-based, or any combination of these policy types is supported.

Keep the following information in mind:

  • You can't modify existing Azure VMware Solution default storage policies.
  • Certain options enabled in storage policies produce a warning that a policy is out of compliance.
  • When you modify existing storage policies, existing associated vSAN objects like VMs, VMDK files, and ISO files appear to be "out of compliance." This means that existing objects are running against premodified policy settings. To update to match the modified policy settings, reapply the storage policy to objects.
  1. Select Run command > Packages > New-AVSStoragePolicy.

  2. Provide the required values or change the default values according to the following table. Then select Run.

    Field Value
    Overwrite Overwrite existing storage policy.
    - The default value is $false.
    - Passing overwrite true provided overwrites an existing policy exactly as defined.
    - Those values not passed are removed or set to default values.
    NotTags Match to datastores that do not have these tags.
    - Tags are case sensitive.
    - Comma separate multiple tags.
    - Example: Tag1,Tag 2,Tag_3.
    Tags Match to datastores that do have these tags.
    - Tags are case sensitive.
    - Comma separate multiple tags.
    - Example: Tag1,Tag 2,Tag_3.
    vSANForceProvisioning Force provisioning for the policy.
    - The default value is $false.
    - Valid values are $true or $false.
    - Warning: vSAN force-provisioned objects aren't covered under the Microsoft service-level agreement (SLA). Data loss and vSAN instability can occur.
    - Recommended value is $false.
    vSANChecksumDisabled Enable or disable checksum for the policy.
    - The default value is $false.
    - Valid values are $true or $false.
    - Warning: Disabling checksum can lead to data loss and/or corruption.
    - Recommended value is $false.
    vSANCacheReservation Percentage of cache reservation for the policy.
    - The default value is 0.
    - Valid values are 0 to 100.
    vSANIOLimit Sets limit on allowed input/output (I/O).
    - The default value is unset.
    - Valid values are 0 to 2147483647.
    - Input/output operations per second (IOPS) limit for the policy.
    vSANDiskStripesPerObject The number of hard disk drives (HDDs) across which each replica of a storage object is striped.
    - The default value is 1. Valid values are 1 to 12.
    - A value higher than 1 might result in better performance (for example, when flash read cache misses need to get serviced from HDD), but also results in a higher use of system resources.
    vSANObjectSpaceReservation Object reservation.
    - The default value is 0.
    - Valid values are 0 to 100.
    - 0 = Thin provision.
    - 100 = Thick provision.
    VMEncryption Sets VM encryption.
    - The default value is None.
    - Valid values are None, Pre-IO, and Post-IO.
    - Pre-IO allows virtual I/O (VAIO) filtering solutions to capture data before VM encryption.
    - Post-IO allows VAIO-filtering solutions to capture data after VM encryption.
    vSANFailuresToTolerate Number of vSAN hosts' failures to tolerate.
    - The default value is R1FTT1.
    - Valid values are None, R1FTT1, R1FTT2, R1FTT3, R5FTT1, R6FTT2, and R1FTT3.
    - None = No data redundancy.
    - R1FTT1 = 1 failure - RAID-1 (mirroring).
    - R1FTT2 = 2 failures - RAID-1 (mirroring).
    - R1FTT3 = 3 failures - RAID-1 (mirroring).
    - R5FTT1 = 1 failure - RAID-5 (erasure coding).
    - R6FTT2 = 2 failures - RAID-6 (erasure coding).
    - The None (no data redundancy) option isn't covered under the Microsoft SLA.
    vSANSiteDisasterTolerance Valid only for stretch clusters.
    - The default value is None.
    - Valid values are None, Dual, Preferred, Secondary, and NoneStretch.
    - None = No site redundancy. This option is recommended for nonstretch clusters and not recommended for stretch clusters.
    - Dual = Dual site redundancy. This option is recommended for stretch clusters.
    - Preferred = No site redundancy. Keep data on preferred (stretched cluster).
    - Secondary = No site redundancy. Keep data on secondary site (stretched cluster).
    - NoneStretch = No site redundancy. Not recommended. For more information, see For vSAN stretched clusters, don't use a storage policy with locality=none.
    Description Description of the storage policy that you're creating, in free-form text.
    Name Name of the storage policy to set. For example, RAID1 FTT-1.
    Retain up to Retention period of the cmdlet output. The default value is 60.
    Specify name for execution Alphanumeric name. For example, New-AVSStoragePolicy-Exec1.
    Timeout The period after which a cmdlet exits if it's taking too long to finish.
  3. Check Notifications to see the progress.

Remove an Azure VMware Solution storage policy

Run the Remove-AVSStoragePolicy cmdlet to specify the default storage policy for a cluster.

  1. Select Run command > Packages > Remove-AVSStoragePolicy.

  2. Provide the required values or change the default values according to the following table. Then select Run.

    Field Value
    Name Name of the storage policy. Wildcards aren't supported and are stripped.
    Retain up to Retention period of the cmdlet output. The default value is 60.
    Specify name for execution Alphanumeric name. For example, Remove-AVSStoragePolicy-Exec1.
    Timeout The period after which a cmdlet exits if it's taking too long to finish.
  3. Check Notifications to see the progress.