Skip to main content
Version: 3.1

Create a host aggregate

A host aggregate groups compute hosts with shared characteristics, such as GPU model or storage type. Use host aggregates for targeted scheduling, resource segmentation, and metadata-based policies.

This page describes how to create a host aggregate without an availability zone (AZ), and how to match a flavor to the aggregate so that instances launch only on its hosts.

Create a host aggregate​

  1. Go to Administrator > Compute > Host Aggregates, then click + Create Host Aggregate.

    Host Aggregates page with the Create Host Aggregate button

  2. Enter a name for the host aggregate, set Create new AZ to No, and select Not select for Availability Zone. Click OK.

    Create Host Aggregate dialog with Create new AZ set to No and Availability Zone set to Not select

  3. Verify that the new host aggregate appears on the dashboard.

    Host Aggregates dashboard showing the new aggregate

  4. In the row of the host aggregate, select More > Manage Host.

    More menu with the Manage Host option

  5. Select the hosts to add to the aggregate, then click OK.

    Manage Host dialog with hosts selected

  6. Verify the host assignment in the Hosts column.

    Host Aggregates dashboard showing the assigned hosts

Match a flavor to a host aggregate​

Instances launched with a flavor run only on hosts in the aggregate when the aggregate metadata and the flavor metadata use the same key and value.

  1. Go to Administrator > Compute > Host Aggregates.
  2. In the row of the host aggregate, select More > Manage Metadata.
  3. Add a custom metadata key and value, for example gpu = a2000. Click OK.
  4. Go to Administrator > Compute > Flavors. If the flavor doesn't exist, see Create a flavor.
  5. In the row of the flavor, select More > Manage Metadata.
  6. Add the same key and value with the aggregate_instance_extra_specs: prefix, for example aggregate_instance_extra_specs:gpu = a2000. Click OK.
  7. Launch an instance with the flavor, then verify that its host belongs to the aggregate.
note

The flavor key must keep the aggregate_instance_extra_specs: prefix. The key after the prefix and the value must match the aggregate metadata exactly.

To schedule GPU instances onto the aggregate, add the AI accelerator profile to the same flavor, for example accel:device_profile = rtx_a2000_1. For other flavor metadata options, see Edit flavor metadata.

Match a flavor to a host aggregate with the CLI​

Run the commands in this section as an administrator on a control node. Replace each <variable> with your own value. For example, use gpu for <key>, a2000 for <value>, and rtx_a2000_1 for <device-profile>. The <key> and <value> must be the same in the aggregate and the flavor.

  1. Run the following command to create the host aggregate without an availability zone.

    openstack aggregate create <aggregate-name>
  2. Run the following command to add a compute host to the aggregate.

    openstack aggregate add host <aggregate-name> <compute-hostname>
  3. Run the following command to verify the host assignment.

    openstack aggregate list --long
  4. Run the following command to set the aggregate metadata.

    openstack aggregate set --property <key>=<value> <aggregate-name>
  5. Run the following command to create a flavor that matches the aggregate metadata. For the UI steps, see Create a flavor.

    openstack flavor create --vcpus 2 --ram 2048 --disk 100 \
    --property aggregate_instance_extra_specs:<key>=<value> \
    <flavor-name>
  6. To create a GPU flavor instead, run the following command. It adds the AI accelerator profile to the flavor.

    openstack flavor create --vcpus 2 --ram 2048 --disk 100 \
    --property aggregate_instance_extra_specs:<key>=<value> \
    --property accel:device_profile='<device-profile>' \
    <gpu-flavor-name>