6.2. Creating a host aggregate

As a cloud administrator, you can create as many host aggregates as you require.

Procedure

  1. To create a host aggregate, enter the following command:

    (overcloud)# openstack aggregate create <aggregate_name>

    Replace <aggregate_name> with the name you want to assign to the host aggregate.

  2. Add metadata to the host aggregate:

    (overcloud)# openstack aggregate set \
     --property <key=value> \
     --property <key=value> \
     <aggregate_name>
    • Replace <key=value> with the metadata key-value pair. If you are using the AggregateInstanceExtraSpecsFilter filter, the key can be any arbitrary string, for example, ssd=true. If you are using the AggregateImagePropertiesIsolation filter, the key must match a valid image metadata property. For more information about valid image metadata properties, see Image metadata.
    • Replace <aggregate_name> with the name of the host aggregate.
  3. Add the Compute nodes to the host aggregate:

    (overcloud)# openstack aggregate add host \
     <aggregate_name> \
     <host_name>
    • Replace <aggregate_name> with the name of the host aggregate to add the Compute node to.
    • Replace <host_name> with the name of the Compute node to add to the host aggregate.
  4. Create a flavor or image for the host aggregate:

    • Create a flavor:

      (overcloud)$ openstack flavor create \
        --ram <size_mb> \
        --disk <size_gb> \
        --vcpus <no_reserved_vcpus> \
        host-agg-flavor

      For information on how to create a flavor, see Creating flavors for launching instances.

    • Create an image:

      (overcloud)$ openstack image create host-agg-image
  5. Set one or more key-value pairs on the flavor or image that match the key-value pairs on the host aggregate.

    • To set the key-value pairs on a flavor, use the scope aggregate_instance_extra_specs:

      (overcloud)# openstack flavor set \
       --property aggregate_instance_extra_specs:ssd=true \
       host-agg-flavor
    • To set the key-value pairs on an image, use valid image metadata properties as the key:

      (overcloud)# openstack image set \
       --property os_type=linux \
       host-agg-image