https://blueprints.launchpad.net/blazar/+spec/multi-freepools
Support multiple availability zones and enable users to reserve both of hosts and instances with aware of az.
Blazar manages hosts registered in the freepool for reservations. The freepool is agnostic for Nova’s availability zone (az) now. All hosts belong to one freepool and reserved hosts for a reservation can be picked up from different az in Nova. Additionally, users can’t specify az the reserved hosts/instances belong to when they create a reservation.
This BP enables users to specify az in the host reservation and the instance reservation. If users specify az in their request, Blazar picks up hosts which belong to the specified az. If not, Blazar picks up hosts as usual. For the details of API change, please read the Rest API impact section.
Blazar records the original az information a host belongs to when operators register a host by the create host API. The az information comes from Nova’s service list API.
For backword compatibility, this BP introduce a new config, “az_aware”, to utils.openstack.nova.py. If it’s False, Blazar handles reservation requests like before. If it’s True, Blazar tracks availability zone of each hosts.
Blazar manages multi freepools that is one-to-one mapping to each availability zone. Then users specify a freepool when they reserve resources if needed.
This approach also can support multiple availability zone. However, Blazar need to introduce new API sets to create the one-to-one mapping between az and freepool. The API set add extra tasks that operators define the mappings before they call the create host API.
Operators define az information as ComputeExtraCapability to enable users can specify az when they create a reservation.
The good point of this approach is there is no need to change Blazar’s APIs and config since operators only call existing APIs to create extra_capability key and value set.
The drawback is that if Blazar automatically stores az info to ComputeExtraCapability it’s not a good place to store Nova’s info queried by Blazar. ComputeExtraCapability is a table for data specified by operators and ComputeHost is a table for data queried by Blazar.
A availability_zone column is added to the ComputeHost table. This column stores the availability zone the host belongs to.
ALTER TABLE computehosts ADD availability_zone VARCHAR(255) AFTER status;
NULL is assigned to the colum for the upgrade from Pike to later.
Request Example:
{ "name": "instance-reservation-1", "reservations": [ { "resource_type": "virtual:instance", "vcpus": 4, "memory_mb": 4096, "disk_gb": 10, "amount": 5, "affinity": False, "resource_properties": "[\"==\", \"$availability_zone\", \"az1\"]" }, { "resource_type": "physical:host", "min": 3, "max": 4, "hypervisor_properties": "[]", "resource_properties": "[\"==\", \"$availability_zone\", \"az1\"]" } ], "start": "2020-05-17 09:00" "end": "2020-05-17 10:00", "events": [] }
Response Example:
{ "leases": { "reservations": [ { "id": "reservation-id", "status": "pending", "lease_id": "lease-id-1", "resource_id": "resource_id", "resource_type": "virtual:instance", "vcpus": 4, "memory_mb": 4096, "disk_gb": 10, "amount": 5, "affinity": False, "resource_properties": "[\"==\", \"$availability_zone\", \"az1\"]", "created_at": "2017-05-01 10:00:00", "updated_at": "2017-05-01 11:00:00", }], ..snippet.. } }
None
None
The original az name a hypervisor belongs to is only visible through Blazar API. Nova returns az name based on meta data of host aggregate and Blazar sets blazar_* az name to an aggregate of host reservation. It results users need to call Blazar Host details API when they want to know what az value is available in “availability_zone” key.
In most cases, only admin is allowed to configure az in Nova. Admins/cloud providers/cloud deployers inform end users of list of az name. So the impact described above has less impact to end users.
None
When upgrading Blazar, availability_zone column is filled by NULL. If depoloyers set the az_aware flag to True, they need to re-create all hosts registered in Blazar’s freeppol after upgrading to store availability zone information into computehost table. If hosts are used for a host reservation Blazar can’t find out the original az information while deployers upgrade Blazar.
If deployers move a host to another availability zone by Nova API, the deployers need to re-create the host by the Blazar host create API to apply the new availability zone to the Blazar DB. The information is automatically registered by Blazar only in the Blazar host create API.
None
None
None
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.