Using Host Aggregates in OpenStack


What is this guide about?
One feature of OpenStack that can come in handy is Host Aggregates. Host aggregates allow administrators to group compute nodes together for various reasons, such as similar hardware used, and assign specific flavors to run on each group.

Getting Started

First, let’s see what commands we have available by typing openstack aggregate –help.

Now that we know what commands we might need to use, let’s create a new host aggregate named group1 by typing openstack aggregate create group1.

With our host aggregate created, we can look to see what hosts are available to us using openstack host list.

And here you can see we only have one host, named compute, in the nova zone; we’ll add that to our group; though if there were others listed, we could add whichever ones we wanted. So, let’s add the compute host to the group1 host aggregate with openstack aggregate add host group1 compute.

Now, we mentioned that one use for host aggregates was to assign certain flavors to a host aggregate so that they can only be used there. To do this, we’ll create a new flavor named m1.groupflavor and add it to the host aggregate during creation. If you want to add an already-created flavor you would need to use the set command.

So, to create our flavor, we’ll type openstack flavor create –id 100 –ram 512 –disk 1 –property group1=true m1.groupflavor.

If you notice, in the command as well as the output, the host aggregate is set to true in the properties metadata.

And that’s how easy it is to create a host aggregate, add a host to it, and create a flavor assigned to it!

Sources / Resources

To read the original spec for this feature check out:

Looking for team training?