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β
-
Go to
Administrator > Compute > Host Aggregates, then click + Create Host Aggregate.
-
Enter a name for the host aggregate, set Create new AZ to No, and select Not select for Availability Zone. Click OK.

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

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

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

-
Verify the host assignment in the Hosts column.

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.
- Go to
Administrator > Compute > Host Aggregates. - In the row of the host aggregate, select More > Manage Metadata.
- Add a custom metadata key and value, for example
gpu=a2000. Click OK. - Go to
Administrator > Compute > Flavors. If the flavor doesn't exist, see Create a flavor. - In the row of the flavor, select More > Manage Metadata.
- Add the same key and value with the
aggregate_instance_extra_specs:prefix, for exampleaggregate_instance_extra_specs:gpu=a2000. Click OK. - Launch an instance with the flavor, then verify that its host belongs to the aggregate.
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.
-
Run the following command to create the host aggregate without an availability zone.
openstack aggregate create <aggregate-name> -
Run the following command to add a compute host to the aggregate.
openstack aggregate add host <aggregate-name> <compute-hostname> -
Run the following command to verify the host assignment.
openstack aggregate list --long -
Run the following command to set the aggregate metadata.
openstack aggregate set --property <key>=<value> <aggregate-name> -
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> -
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>