Creating an Availability Zone

Availability Zones (AZs) are a special case of host aggregates. Here, host aggregates are used by Nova to make scheduling decisions; they are generally only visible to operators and administrators of the OpenStack Cloud. AZs are the end-user visible component. An AZ can be configured, like host aggregates, to represent features of the hardware.

AZs are typically used to define failure domains, such as a cabinet or data center, or even geography. When configuring AZs, it is important to note that a host can only be a member of one AZ at a time.

Note

As AZs are a special use-case of host aggregates, a lot of operations, such as adding and removing hosts are the same. Thus, they are not repeated here.

Creating an AZ is a two-step process. First, we create an aggregate with the --zone parameter, or add it to an existing aggregate. Second, a host needs to be added to the aggregate before instances can be scheduled into the zone.

Getting ready

To create an AZ, you will need the following information:

  • The openstack command-line client
  • The openrc file containing appropriate credentials
  • The name or ID of the aggregate
  • The desired name of the AZ
  • The host or hosts to add to the AZ

For our example, these values are as follows:

  • Aggregate name: cookbook-az
  • Availability zone name: cookbook-az
  • Compute host: compute-01

How to do it…

The following steps are to be used when creating an AZ:

  1. First, we will list the current AZs with the following command:
    openstack availability zone list
    

    This will bring back an output like the following:

    How to do it…
  2. Create a new aggregate with the --zone parameter:
    openstack aggregate create --zone cookbook-az cookbook-az
    

    This will bring back an output like the following:

    How to do it…
  3. Now add a host to the aggregate with the following command:
    openstack aggregate add host cookbook-az compute-01
    

    This will bring back an output like the following when successful:

    How to do it…
  4. Now list the AZs we have available:
    openstack availability zone list
    

    This will show the following:

    How to do it…

    Tip

    Listing AZs will show all AZs available, irrespective of whether hosts exist in them or not. To verify that the hosts that are within an AZ, issue the following command:

    openstack availability zone show nameofAZ
    

    This will bring back the output as shown in step 3.

How it works…

The first command, openstack availability zone list, lists all AZs. Next, when creating the new aggregate, the special --zone cookbook-az parameter is passed, telling OpenStack Nova that this aggregate is also an AZ, specifying its name. Finally, a host is added to the AZ much the same as a host is added to an aggregate.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.60.232