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

Prerequisites

Create the desired storage policy in vSphere.

Procedure

  1. Log in to the OpenStack Management Server as viouser.
  2. If your deployment is not using a custom.yml file, copy the template custom.yml file to the /opt/vmware/vio/custom directory.
    sudo mkdir -p /opt/vmware/vio/custom
    sudo cp /var/lib/vio/ansible/custom/custom.yml.sample /opt/vmware/vio/custom/custom.yml
  3. Open the /opt/vmware/vio/custom/custom.yml file in a text editor.
  4. Uncomment the nova_pbm_enabled parameter and set its value to true.
  5. Uncomment the nova_pbm_default_policy parameter and 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.
  6. Uncomment the nova_scheduler_default_filters parameter and add AggregateInstanceExtraSpecsFilter to the end.
    nova_scheduler_default_filters: RetryFilter, AvailabilityZoneFilter, RamFilter, ComputeFilter, ComputeCapabilitiesFilter, ImagePropertiesFilter, ServerGroupAntiAffinityFilter, ServerGroupAffinityFilter, PciPassthroughFilter, AggregateInstanceExtraSpecsFilter
  7. Uncomment the nova_use_linked_clone parameter and set its value to false.
  8. Deploy the updated configuration.
    sudo viocli deployment configure

    Deploying the configuration briefly interrupts OpenStack services.

  9. Log in to the VMware Integrated OpenStack dashboard as a cloud administrator.
  10. Select the admin project from the drop-down menu in the title bar.
  11. Select Admin > Compute > Flavors.
  12. Create a new flavor or choose an existing flavor.
  13. Click Update Metadata to the right of the flavor.
  14. In the Available Metadata pane, expand VMware Policies and click the Add (plus sign) icon next to Storage Policy.
  15. 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.