This guide shows you how to create and configure availability zones (AZs) in OpenStack from the Linux command line. You’ll use the OpenStack client to define host aggregates, map them to availability zones, and verify the setup. You need working OpenStack credentials and the openstack CLI tool installed.
What You’ll Need
- Access to an OpenStack deployment (admin or project admin role)
- OpenStack CLI client installed (
pip install python-openstackclient) - Source your
openrcorclouds.yamlcredentials file - List of compute hosts (nova-compute nodes) to group into AZs
Step-by-Step
- Source your credentials
Runsource openrc.sh(or your credential file) to set environment variables. Verify withopenstack token issue– you should see a token ID. - List existing host aggregates
Runopenstack aggregate listto see current aggregates and their AZ names. Note the IDs and names. - Create a new host aggregate
Useopenstack aggregate create --zone. Replace<az-name>with the availability zone label (e.g.,az1) and<aggregate-name>with a descriptive name (e.g.,az1-aggregate). Example:openstack aggregate create --zone az1 az1-aggregate. - Add compute hosts to the aggregate
For each host you want in this AZ, runopenstack aggregate add host. Example:openstack aggregate add host az1-aggregate compute1. Repeat for all hosts. - Set additional metadata (optional)
You can add custom metadata withopenstack aggregate set --property key=value. For example,openstack aggregate set --property availability_zone=az1 az1-aggregate(though the--zoneflag already sets this). - Verify the aggregate
Runopenstack aggregate showto confirm the AZ name and host list. The output should showavailability_zoneset to your AZ. - Check availability zones
Runopenstack availability zone listto see all AZs. Your new AZ should appear with the hosts listed as available. - Test launching an instance in the new AZ
Useopenstack server create --flavor. If it launches successfully, your AZ is working.--image --availability-zone test-instance
Common Mistakes
- Forgetting to source credentials – commands fail with authentication errors.
- Using the same AZ name for multiple aggregates – OpenStack merges them, which may cause unexpected host grouping.
- Adding a host that is already in another aggregate with a different AZ – the host will be associated with the last aggregate’s AZ, causing confusion.
- Not checking host availability – if a host is disabled or in maintenance mode, it won’t show as available in the AZ.
Tips
- Name aggregates clearly, e.g.,
az1-aggregate, to avoid confusion. - Use
openstack aggregate list --longto see AZ names and host counts at a glance. - Plan your AZ layout before creating – think about fault domains (e.g., separate racks or power zones).
- Document which hosts belong to which AZ for future maintenance.
- Use the
--zoneflag when creating the aggregate; setting it later via metadata is less reliable.
Troubleshooting
- AZ not showing in list
Runopenstack aggregate listand check if the aggregate exists. If not, recreate it. If it exists but AZ is missing, set it withopenstack aggregate set --zone. - Host not appearing in AZ
Check the host is up:openstack host listandopenstack host show. Ensure the host is added to the aggregate:openstack aggregate show. - Instance fails to launch in AZ
Check the AZ name is exactly as set (case-sensitive). Also verify the flavor and image exist. Look at the compute service logs on the host for scheduler errors. - Commands return ‘Unauthorized’
Re-source your credentials and check your role. You need at leastadminorproject adminto manage aggregates. - Aggregate creation fails with ‘Conflict’
Another aggregate may already have the same AZ name. Use a different AZ name or delete the conflicting aggregate if it’s unused.
Frequently Asked Questions
- Can I create an availability zone without a host aggregate?
No, in OpenStack, availability zones are implemented via host aggregates. You must create an aggregate and assign hosts to it. - What is the difference between an aggregate and an AZ?
An aggregate is a grouping of hosts for scheduling purposes; an AZ is a user-facing label that maps to an aggregate. You can have multiple aggregates with the same AZ name, but it’s not recommended. - Can I move a host from one AZ to another?
Yes, remove the host from the old aggregate withopenstack aggregate remove host, then add it to the new aggregate. - How do I set a default AZ for a project?
Set theavailability_zonein the project’s quota or use a default in the flavor, but the simplest is to specify it when launching instances. - Do I need to restart nova services after creating an AZ?
No, the changes are picked up dynamically. However, if hosts are not showing, you may need to wait a few seconds or restart nova-scheduler in rare cases. - Can I use the same AZ name for aggregates in different regions?
Yes, but they will be independent. Each region has its own set of aggregates and AZs.
Related
General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.
More in this bed
- Fix Device Manager Not Opening in Windows 11
- How to Pause Snapchat Location
- System Restore Points Missing in Windows? Fixes
- Install League of Legends on Linux: Full Guide
- Fix Error 0x80070001: Causes & Solutions
- Facebook.com: What It Is and Is It Safe?9.26 yd³