OpenStack segregation with availability zones and host aggregates
When a new OpenStack cloud born, usually all servers run over the same hardware and specifications, often, all servers are in the same building, room, rack, even a chassis when the cloud is in the first growth paces.
After a while, workloads increase and the current hardware is not enough to process that workloads. At this point, your hardware is old and new hardware is bought. This hardware has different storage disks, CPU, RAM and so on. You passed from 10\'s of servers to 100\'s. DataCenter racks, rooms and buildings are too small and the growing cloud needs redundancy between cities or countries.
OpenStack offers a few solutions for that purpose, called Regions, Cells, Availability Zones and Host Aggregates. | Now, we are going to focus on Availability Zones and Host Aggregates, which are the way to segregate computational workloads.
Host Aggregates:
Host Aggregates represent a logical set of
properties/characteristics a group of hosts owns in the form of
metadata. Imagine some of your servers have SSD disks and the
other ones SATA, you can map those properties SSD/SATA to a
group of hosts, when a image or flavor with the metaparameter
associated is launched, Nova Scheduler will filter the available
hosts with the meta parameter value and boot the instance on
hosts with the desired property. Host Aggregates are managed by
OpenStack admins.
Availability Zones
Availability Zones represent a logical partition of the
infrastructure(not necessary but is the common use case) in the
form of racks, rooms, buildings, etc. Customers can launch
instances in the desired Availability Zone.
Usually, Host Aggregates are mapped to Availability Zones allowing customers to use the desired set of hardware or characteristics to boot instances.
At the end of this guide you will know how to:
Create Availability Zones and Host Aggregates.
Adding hosts to Host Aggregates and Availability Zones.
Launch instances directly to Availability Zones.
Configure nova scheduler for Host Aggregates usage.
Configure Images and Flavors for scheduling to Host Aggregates.
Launch instances based on flavors and image parameters.
Let's start: \00/
| Create two Host Aggregate called "az1-ag"/"az2-ag", this command also, will create two Availability Zones called "az1"/"az2". | By default, when a Host Aggregate is created with an Availability Zone, a metadata key called "availability_zone=NAME_OF_AZ" will be created.
Add one or more compute nodes to Host Aggregates.
Details about a Host Aggregate can be reviewed with:
List Availability Zones and check status.
Other method you can use:
Launch two instances using "--availability-zone AZ" option, you can even select the compute node to use, just use "--availability-zone AZ:COMPUTE_NODE".
Ensure the instances are running in the desired Availability Zone.
List Glance images.
Update the images with custom properties, i use "availability_zone" because is the default meta parameter a Host Aggregate owns when is inside Availability Zones.
Boot two instances, now we use images with custom properties, those properties will map to Availability Zones(you can use other type of parameters mapping to Host Aggregates characteristics).
Ensure the instances booted in the desired Availability Zone.
| Other method to launch instances is with parameters in flavors. | Create two flavors.
Add metadata to a Host Aggregate with some characteristic property as can be fast HD or cheap HW.
Update the previous created flavors with the associated metadata key with the Host Aggregate.
Ensure, the properties are properly created.
By default, Nova Scheduler don't allow filtering by extra Specs inserted in flavors or images.
First, ensure the following scheduler filters are allowed in Control nodes.
If a change has been done in nova.conf file, restart nova services
Boot another two instances, now using custom flavors
Check where the instances are running.
That's all for now | Hope this guide helps.
Regards
Last updated
Was this helpful?