Booting an instance into an Availability Zone

Instances can be created into a given AZ by passing the --availability-zone parameter as part of the creation process. Additionally, AZ can be selected in OpenStack Horizon as part of the instance creation wizard.

Getting ready

The following information is required to boot an instance into an AZ:

  • The openstack command-line client
  • The openrc file containing appropriate credentials
  • The name or ID of the AZ
  • Additional information required to start an instance

    Tip

    Creating instances is covered in detail in the Booting an instance recipe. As such, this example skips some of the detail, instead it focuses on how to create an instance in a specific AZ.

How to do it…

To boot an instance into a specific AZ, the --availability-zone parameter is specified when running the openstack server create command:

openstack server create --flavor openstack.cookbook
   --image 08b822ba-be44-4639-b577-45e8dd37c06d
   --nic net-id=6cb5a4ce-1ea5-4817-9c34-a2212a66f394
   --security-group bd7d5e0f-538a-4d93-b123-98cc3207b3d2
   --key-name cookbook_key
   --availability-zone cookbook-az
   cookbook.test-03

This will bring back an output like the following, showing the AZ (the OS-EXT-AZ:availability-zone field) where the instance was scheduled to:

How to do it…

How it works…

When specified, the --availability-zone parameter causes the Nova Scheduler to examine the specified AZ to see if the request can be satisfied.

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

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