After you define a VM storage policy in vSphere, you can apply it to a virtual machine. You apply the storage policy when provisioning the virtual machine or configuring its virtual disks. Depending on its type and configuration, the policy might serve different purposes. The policy can select the most appropriate datastore for the virtual machine and enforce the required level of service. Or it can enable specific data services for the virtual machine and its disks.

If you do not specify the storage policy, the system uses a default storage policy that is associated with the datastore. If your storage requirements for the applications on the virtual machine change, you can modify the storage policy that was originally applied to the virtual machine.

Assign Storage Policies to Virtual Machines

You can assign a VM storage policy in an initial deployment of a virtual machine or when you perform other virtual machine operations, such as cloning or migrating.

This topic describes how to assign the VM storage policy when you create a virtual machine. For information about other deployment methods that include cloning, deployment from a template, and so on, see the vSphere Virtual Machine Administration documentation.

You can apply the same storage policy to the virtual machine configuration file and all its virtual disks. If storage requirements for your virtual disks and the configuration file are different, you can associate different storage policies with the VM configuration file and the selected virtual disks.

Procedure

  1. Start the virtual machine provisioning process and follow the appropriate steps.
  2. Assign the same storage policy to all virtual machine files and disks.
    1. On the Select storage page, select a storage policy from the VM Storage Policy drop-down menu.
      Based on its configuration, the storage policy separates all datastores into compatible and incompatible. If the policy references data services offered by a specific storage entity, for example, Virtual Volumes, the compatible list includes datastores that represent only that type of storage.
    2. Select an appropriate datastore from the list of compatible datastores.
      The datastore becomes the destination storage resource for the virtual machine configuration file and all virtual disks.
    3. If you use the replication service with Virtual Volumes, specify the replication group.
      Replication groups indicate which VMs and virtual disks must be replicated together to a target site.
      Option Description
      Preconfigured replication group Replication groups that are configured in advance on the storage side. vCenter Server and ESXi discover the replication groups, but do not manage their life cycle.
      Automatic replication group Virtual Volumes creates a replication group and assigns all VM objects to this group.
  3. Change the VM storage policy for the virtual disk.
    Use this option if requirements for storage placement are different for virtual disks. You can also use this option to enable I/O filter services, such as caching and replication, for your virtual disks.
    1. On the Customize hardware page, expand the New hard disk pane.
    2. From the VM storage policy drop-down menu, select the storage policy to assign to the virtual disk.
    3. (Optional) Change the storage location of the virtual disk.
      Use this option to store the virtual disk on a datastore other than the datastore where the VM configuration file resides.
  4. Complete the virtual machine provisioning process.

Results

After you create the virtual machine, the Summary tab displays the assigned storage policies and their compliance status.

What to do next

If storage placement requirements for the configuration file or the virtual disks change, you can later modify the virtual policy assignment.

Change Storage Policy Assignment for Virtual Machine Files and Disks

If your storage requirements for the applications on the virtual machine change, you can edit the storage policy that was originally applied to the virtual machine.

You can edit the storage policy for a powered-off or powered-on virtual machine.

When changing the VM storage policy assignment, you can apply the same storage policy to the virtual machine configuration file and all its virtual disks. You can also associate different storage policies with the VM configuration file and the virtual disks. You might apply different policies when, for example, storage requirements for your virtual disks and the configuration file are different.

Procedure

  1. In the vSphere Client, browse to the virtual machine.
    1. Click Menu > Policies and Profiles.
    2. Under Policies and Profiles, click VM Storage Policies.
    3. Click the storage policy you want to change, and click VM Compliance.
      You can see the list of virtual machines that use this storage policy.
    4. Click the virtual machine whose policy you want to modify.
  2. Click the Configure tab and click Policies.
  3. Click Edit VM Storage Policies.
  4. Specify the VM storage policy for your virtual machine.
    Option Actions
    Apply the same storage policy to all virtual machine objects Select the policy from the VM storage policy drop-down menu.
    Apply different storage policies to the VM home object and virtual disks
    1. Turn on the Configure per disk option.
    2. Select the object, for example, VM home.
    3. In the VM Storage Policy column, select the policy from the drop-down menu.
  5. If you use Virtual Volumes policy with replication, configure the replication group.
    Replication groups indicate which VMs and virtual disks must be replicated together to a target site.

    All storage objects of a VM should belong to the same replication group. You cannot assign different replication groups to different storage objects of a VM.

  6. Click OK to save the VM storage policy changes.

Results

The storage policy is assigned to the virtual machine and its disks.

Check Compliance for a VM Storage Policy

You can check whether a virtual machine uses a datastore that is compatible with the storage requirements specified in the VM storage policy.

Prerequisites

Verify that the virtual machine has a storage policy that is associated with it.

Procedure

  1. In the vSphere Client, navigate to the virtual machine.
  2. Click the Configure tab and click Policies.
  3. Click Check VM Storage Policy Compliance.
    The system verifies the compliance.
  4. View the compliance status.
    Compliance Status Description
    Compliant The datastore that the virtual machine or virtual disk uses has the storage capabilities compatible with the policy requirements.
    Noncompliant The datastore that the virtual machine or virtual disk uses does not have the storage capabilities compatible with the policy requirements. You can migrate the virtual machine files and virtual disks to compliant datastores.
    Out of Date The status indicates that the policy has been edited, but the new requirements have not been communicated to the datastore where the virtual machine objects reside. To communicate the changes, reapply the policy to the objects that are out of date.
    Not Applicable This storage policy references datastore capabilities that are not supported by the datastore where virtual machine resides.

What to do next

When you cannot bring the noncompliant datastore into compliance, migrate the files or virtual disks to a compatible datastore. See Find Compatible Storage Resource for Noncompliant Virtual Machine.

If the status is Out of Date, reapply the policy to the objects. See Reapply Virtual Machine Storage Policy.

Find Compatible Storage Resource for Noncompliant Virtual Machine

Determine which datastore is compatible with the storage policy that is associated with your virtual machine.

Occasionally, a storage policy that is assigned to a virtual machine can be in the noncompliant status. This status indicates that the virtual machine or its disks use datastores that are incompatible with the policy. You can migrate the virtual machine files and virtual disks to compatible datastores.

Use this task to determine which datastores satisfy the requirements of the policy.

Procedure

  1. Verify that the storage policy for the virtual machine is in the noncompliant state.
    1. In the vSphere Client, navigate to the virtual machine.
    2. Click the Summary tab.
      The VM Storage Policy Compliance panel on the VM Storage Policies pane shows the Noncompliant status.
  2. Navigate to the noncompliant storage policy.
    1. Click Menu > Policies and Profiles.
    2. Under Policies and Profiles, click VM Storage Policies.
  3. Display the list of compatible datastores for the noncompliant storage policy.
    1. Click the storage policy.
    2. Click Storage Compatibility.
    The list of datastores that match the requirements of the policy appears.

What to do next

You can migrate the virtual machine or its disks to one of the datastores in the list.

Reapply Virtual Machine Storage Policy

After you edit a storage policy that is already associated with a virtual machine object, you must reapply the policy. By reapplying the policy, you communicate new storage requirements to the datastore where the virtual machine object resides.

Prerequisites

The compliance status for a virtual machine is Out of Date. The status indicates that the policy has been edited, but the new requirements have not been communicated to the datastore.

Procedure

  1. In the vSphere Client, navigate to the virtual machine.
  2. Click the Configure tab and click Policies.
  3. Verify that the compliance status is Out of Date.
  4. Click Reapply VM Storage Policy.
  5. Check the compliance status.
    Compliance Status Description
    Compliant The datastore that the virtual machine or virtual disk uses has the storage capabilities that the policy requires.
    Noncompliant The datastore supports specified storage requirements, but cannot currently satisfy the storage policy. For example, the status might become Noncompliant when physical resources of the datastore are unavailable. You can bring the datastore into compliance by making changes in the physical configuration of your host cluster. For example, by adding hosts or disks to the cluster. If additional resources satisfy the storage policy, the status changes to Compliant.

    When you cannot bring the noncompliant datastore into compliance, migrate the files or virtual disks to a compatible datastore. See Find Compatible Storage Resource for Noncompliant Virtual Machine.

    Not Applicable The storage policy references datastore capabilities that are not supported by the datastore.