To ensure that OpenStack instances booted from a volume use the correct volume type, you can create and apply policy-based management settings, which are called PBM policies.

About this task

After you enable the storage policy in the custom.yml file, you apply the policy by modifying the metadata of an OpenStack flavor. All instances created by using that flavor inherit the storage policy configuration.

Procedure

  1. Implement the custom.yml file.
    sudo mkdir -p /opt/vmware/vio/custom
    sudo cp /var/lib/vio/ansible/custom/custom.yml.sample /opt/vmware/vio/custom/custom.yml
  2. Edit the /opt/vmware/vio/custom/custom.yml file by uncommenting the PBM options.
    ##############################
    # PBM options
    ##############################
    
    # (string) The PBM default policy to use when no policy is associated with a flavor (Mandatory) if nova_pbm_enabled is set to True.
    nova_pbm_default_policy: nova
    
    # (boolean) The PBM status. Set this to True to enable storage policies for nova flavors.
    nova_pbm_enabled: False
  3. Set the nova_pbm_enabled parameter to True.
    nova_pbm_enabled: True
  4. Save the custom.yml file.
  5. Apply the policy to an OpenStack flavor as metadata.
    1. Log in to the VMware Integrated OpenStack dashboard as a cloud administrator.
    2. Select the admin project from the drop-down menu in the title bar.
    3. Select Admin > System > Flavors.
    4. (Optional) : Create a flavor specific to the intended use of this metadata property.

      Create a custom flavor to contain the specific configuration. This action leaves the original flavor configuration intact and available for other instance creation.

    5. Select the flavor to modify.
    6. In the Actions column of the image listing, click the down arrow and select Update Metadata.
    7. Enter vmware:storage_policy in the Custom field.
    8. Click the plus sign (+) next to the Custom field.

      In the column under Existing Metadata, the newly added metadata property appears.

    9. Enter nova as the metadata property value.
  6. Click Save.

Results

The default Nova storage policy is applied to all future OpenStack instances that are created from this flavor.