You can use vSphere storage policies to control the datastores on which OpenStack instances are created.

Note: After you set a storage policy on an FCD volume, you cannot remove the storage policy from the volume. However, you can change the storage policy used by an unattached volume.

Prerequisites

Create the desired storage policy in vSphere. For details, see Storage Policy Based Management in the vSphere Storage document.

Procedure

  1. Log in to the Integrated OpenStack Manager as the root user.
    ssh root@mgmt-server-ip
  2. Edit the Nova compute configuration.
    viocli update nova-compute
    1. In the DEFAULT section, add the enabled_filters parameter with the values listed in the following example.
      enabled_filters: "RetryFilter, AvailabilityZoneFilter, RamFilter, ComputeFilter, ComputeCapabilitiesFilter, ImagePropertiesFilter, ServerGroupAntiAffinityFilter, ServerGroupAffinityFilter, PciPassthroughFilter, AggregateInstanceExtraSpecsFilter"
    2. In the vmware section, add the pbm_default_policy parameter. Set its value to the name of the storage policy to use by default when an instance is created with a flavor that is not associated with a storage policy. The value must reference a storage policy that you configure on the vCenter Server.
    3. In the vmware section, add the pbm_enabled parameter and set its value to true.
    4. In the vmware section, add the use_linked_clone parameter and set its value to false.
    The following example shows an updated configuration.
    conf:
    nova:
      DEFAULT:  
        enabled_filters: "RetryFilter, AvailabilityZoneFilter, RamFilter, ComputeFilter, ComputeCapabilitiesFilter, ImagePropertiesFilter, ServerGroupAntiAffinityFilter, ServerGroupAffinityFilter, PciPassthroughFilter, AggregateInstanceExtraSpecsFilter"
      neutron:
        metadata_proxy_shared_secret: ".Secret:managedencryptedpasswords:data.metadata_proxy_shared_secret"  
      vmware:
        passthrough: "false"
        pbm_default_policy: "Your Default Storage Policy"
        pbm_enabled: "true"
        tenant_vdc: "false"
        use_linked_clone: "false"
  3. Edit the Nova configuration.
    viocli update nova
    1. In the DEFAULT section, add the enabled_filters parameter with the values listed in the following example.
      enabled_filters: "RetryFilter, AvailabilityZoneFilter, RamFilter, ComputeFilter, ComputeCapabilitiesFilter, ImagePropertiesFilter, ServerGroupAntiAffinityFilter, ServerGroupAffinityFilter, PciPassthroughFilter, AggregateInstanceExtraSpecsFilter"
    2. In the vmware section, add the pbm_default_policy parameter. Set its value to the name of the storage policy to use by default when an instance is created with a flavor that is not associated with a storage policy. The value must reference a storage policy that you configure on the vCenter Server.
    3. In the vmware section, add the pbm_enabled parameter and set its value to true.
    4. In the vmware section, add the use_linked_clone parameter and set its value to false.
    The following example shows an updated configuration.
    conf:
    nova:
      DEFAULT:  
        enabled_filters: "RetryFilter, AvailabilityZoneFilter, RamFilter, ComputeFilter, ComputeCapabilitiesFilter, ImagePropertiesFilter, ServerGroupAntiAffinityFilter, ServerGroupAffinityFilter, PciPassthroughFilter, AggregateInstanceExtraSpecsFilter"
      neutron:
        metadata_proxy_shared_secret: ".Secret:managedencryptedpasswords:data.metadata_proxy_shared_secret"  
      vmware:
        passthrough: "false"
        pbm_default_policy: "Your Default Storage Policy"
        pbm_enabled: "true"
        tenant_vdc: "false"
        use_linked_clone: "false"
  4. Log in to the VMware Integrated OpenStack dashboard as a cloud administrator.
  5. Select the admin project from the drop-down menu in the title bar.
  6. Select Admin > Compute > Flavors.
  7. Create a new flavor or choose an existing flavor.
  8. Click Update Metadata to the right of the flavor.
  9. In the Available Metadata pane, expand VMware Policies and click the Add (plus sign) icon next to Storage Policy.
  10. Enter the desired storage policy name as the value of the vmware:storage_policy parameter and click Save.

Results

The specified vSphere storage policy is applied to all new OpenStack instances that are created from the flavor. The default storage policy is applied to all new instances that are created from a flavor not associated with a storage policy.