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.
Procedure
- Log in to the Integrated OpenStack Manager as the
root
user.
- Edit the Nova compute configuration.
viocli update nova-compute
- 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.
- In the
vmware
section, add the pbm_enabled parameter and set its value to true.
- 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"
- Run the Nova configuration.
- 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.
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"
- 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.
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.