Availability zones (os-availability-zone)
可用区 在openstack中并没有很明确的定义
注: Openstack 对于可用区的定义可能跟一些可用区定义不一样,只以openstack做分析
官方将解释为主机的聚合(Host Aggregates), 可用区在openstack中没有相应的表定义,创建更新接口则使用Host Aggregates功能,
主机组可以被认为是可用区的进一步划分,主机组只对管理员可见而可用区用户可见
然而,主机组与可用区并不是同一个概念
可用区是主机的metadata 的一组聚合
注:
1.一个主机可以属于多个主机组,但是只能属于一个可用区
2.主机默认属于default可用区,即使主机不属于任何主机组
Lists and gets detailed availability zone information.
An availability zone is created or updated by setting the availability_zone parameter
in the create, update, or create or update methods of the Host Aggregates API.
See Host Aggregates for more details.
官方解释为:
Host aggregates can be regarded as a mechanism to further partition an availability zone;
while availability zones are visible to users, host aggregates are only visible to administrators
Availability Zones are the end-user visible logical abstraction for partitioning a cloud without knowing the physical infrastructure.
That abstraction doesn’t come up in Nova with an actual database model since the availability zone is actually a specific metadata information
attached to an aggregate. Adding that specific metadata to an aggregate makes the aggregate visible from an end-user perspective and consequently
allows to schedule upon a specific set of hosts (the ones belonging to the aggregate).
That said, there are a few rules to know that diverge from an API perspective between aggregates and availability zones:
1.one host can be in multiple aggregates, but it can only be in one availability zone
2. by default a host is part of a default availability zone even if it doesn’t belong to an aggregate (the configuration option is named default_availability_zone)
一. url及命令行
- url
url只有GET 获取列表的方法 :
/os-availability-zone
/os-availability-zone/detail
- 命令行
nova availability-zone-list
二. 源码
availability_zone = nova.api.openstack.compute.availability_zone:AvailabilityZone
AvailabilityZone