You can use vSphere storage policies to control the datastores on which OpenStack instances are created.
Create the desired storage policy in vSphere.
- Log in to the OpenStack Management Server as
- 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
- Open the /opt/vmware/vio/custom/custom.yml file in a text editor.
- Uncomment the nova_pbm_enabled parameter and set its value to true.
- 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.
- 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
- Deploy the updated configuration.
sudo viocli deployment configure
Deploying the configuration briefly interrupts OpenStack services.
- Log in to the VMware Integrated OpenStack dashboard as a cloud administrator.
- Select the admin project from the drop-down menu in the title bar.
- Select .
- Create a new flavor or choose an existing flavor.
- Click Update Metadata to the right of the flavor.
- In the Available Metadata pane, expand VMware Policies and click the Add (plus sign) icon next to Storage Policy.
- Enter the desired storage policy name as the value of the vmware:storage_policy parameter and click Save.
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.