You can use Storage Policy Based Management (SPBM) in vSphere to create storage policies that 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.
  • Ensure that you pay attention while modifying key options like DEFAULT.compute_driver or vmware.host as this may introduce pod down if invalid value is set.

Prerequisites

Create the desired storage policy in vSphere. For details, see Storage Policy Based Management (SPBM) 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 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.
    2. In the vmware section, add the pbm_enabled parameter and set its value to true.
    3. 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_compute:
        DEFAULT: 
          host: compute-4ea25c28-c7
          ram_allocation_ratio: 1.6 
        vmware:
          cluster_name: domain-c7
          datastore_regex: vsanDatastore_EdgeCompute  
          host_ip: .VCenter:vcenter2:spec.hostname
          host_password: .VCenter:vcenter2:spec.password
          host_username: .VCenter:vcenter2:spec.username
          insecure: .VCenter:vcenter2:spec.insecure
          pbm_default_policy: "Your Default Storage Policy"
          pbm_enabled: "true" 
          use_linked_clone: "false" 
  3. Run the Nova configuration.
    1. In the filter_scheduler section, update enabled_filters by adding AggregateInstanceExtraSpecsFilter to the end. The following example shows the enabled_filters parameter with the values listed.
      viocli update nova
    The following example shows an updated configuration.
    conf:
      nova:
        filter_scheduler:
          enabled_filters: "RetryFilter, AvailabilityZoneFilter, ComputeFilter, ComputeCapabilitiesFilter, ImagePropertiesFilter, ServerGroupAntiAffinityFilter, ServerGroupAffinityFilter, PciPassthroughFilter, AggregateInstanceExtraSpecsFilter"
        neutron:
          metadata_proxy_shared_secret: ".Secret:managedencryptedpasswords:data.metadata_proxy_shared_secret"  
        vmware:
          network_passthrough: "true"
          tenant_vdc: "true"
  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.