关于Avaiability Zone的概念以下blog说的很详细。
http://russellbryantnet.wordpress.com/2013/05/21/availability-zones-and-host-aggregates-in-openstack-compute-nova/
Openstack中默认的filter如下:
默认包括Availability Zone,但不包括其他的host aggregate filter.
以下blog介绍了所有的filter:
http://blog.csdn.net/lynn_kong/article/details/9354455
在lab中实验了AZ的功能, 步骤如下:
# nova aggregate-list
+----+------------+-------------------+
| Id | Name | Availability Zone |
+----+------------+-------------------+
| 1 | aggregate1 | az1 |
+----+------------+-------------------+
# nova aggregate-create aggregate2 az2
+----+------------+-------------------+-------+----------+
| Id | Name | Availability Zone | Hosts | Metadata |
+----+------------+-------------------+-------+----------+
| 21 | aggregate2 | az2 | | |
+----+------------+-------------------+-------+----------+
# nova aggregate-list
+----+------------+-------------------+
| Id | Name | Availability Zone |
+----+------------+-------------------+
| 1 | aggregate1 | az1 |
| 21 | aggregate2 | az2 |
+----+------------+-------------------+
# nova aggregate-add-host 21 ci91szwcmp002.webex.com
Aggregate 21 has been successfully updated.
+----+------------+-------------------+------------------------------+--------------------------------+
| Id | Name | Availability Zone | Hosts | Metadata |
+----+------------+-------------------+------------------------------+--------------------------------+
| 21 | aggregate2 | az2 | [u'ci91szwcmp002.webex.com'] | {u'availability_zone': u'az2'} |
+----+------------+-------------------+------------------------------+--------------------------------+
# nova availability-zone-list
+----------------------------+----------------------------------------+
| Name | Status |
+----------------------------+----------------------------------------+
| internal | available |
| |- ci91szwcmp001.webex.com | |
| | |- nova-cert | enabled :-) 2013-10-29T01:57:31.000000 |
| | |- nova-conductor | enabled :-) 2013-10-29T01:57:31.000000 |
| | |- nova-consoleauth | enabled :-) 2013-10-29T01:57:31.000000 |
| | |- nova-network | enabled :-) 2013-10-29T01:57:30.000000 |
| | |- nova-scheduler | enabled :-) 2013-10-29T01:57:31.000000 |
| | |- nova-console | enabled :-) 2013-10-29T01:57:31.000000 |
| |- ci91szwcmp002.webex.com | |
| | |- nova-cert | enabled :-) 2013-10-29T01:57:30.000000 |
| | |- nova-conductor | enabled :-) 2013-10-29T01:57:31.000000 |
| | |- nova-consoleauth | enabled :-) 2013-10-29T01:57:30.000000 |
| | |- nova-network | enabled :-) 2013-10-29T01:57:30.000000 |
| | |- nova-scheduler | enabled :-) 2013-10-29T01:57:31.000000 |
| | |- nova-console | enabled :-) 2013-10-29T01:57:31.000000 |
| az1 | available |
| |- ci91szwcmp001.webex.com | |
| | |- nova-compute | enabled :-) 2013-10-29T01:57:30.000000 |
| az2 | available |
| |- ci91szwcmp002.webex.com | |
| | |- nova-compute | enabled :-) 2013-10-29T01:57:29.000000 |
+----------------------------+----------------------------------------+
# nova boot --image 00a0806a-e337-4c56-b876-f70b39806580 --flavor 2 --availability-zone az1 az1_1
+-------------------------------------+--------------------------------------+
| Property | Value |
+-------------------------------------+--------------------------------------+
| OS-EXT-STS:task_state | scheduling |
| image | ct6.3-harden |
| OS-EXT-STS:vm_state | building |
| OS-EXT-SRV-ATTR:instance_name | instance-000028f1 |
| flavor | m1.small |
| id | 62a14df3-a639-4c77-992a-f4c43dfd4a3c |
| security_groups | [{u'name': u'default'}] |
| user_id | 691860d807d84e91a7c9decc6d9de902 |
| OS-DCF:diskConfig | MANUAL |
| accessIPv4 | |
| accessIPv6 | |
| progress | 0 |
| OS-EXT-STS:power_state | 0 |
| OS-EXT-AZ:availability_zone | nova |
| config_drive | |
| status | BUILD |
| updated | 2013-10-29T01:58:24Z |
| hostId | |
| OS-EXT-SRV-ATTR:host | None |
| key_name | None |
| OS-EXT-SRV-ATTR:hypervisor_hostname | None |
| name | az1_1 |
| adminPass | fwcp3vq5gDZZ |
| tenant_id | aeaa274663034168a0740ee6ffb8fc34 |
| created | 2013-10-29T01:58:23Z |
| metadata | {} |
+-------------------------------------+--------------------------------------+
# nova show az1_1
+-------------------------------------+----------------------------------------------------------+
| Property | Value |
+-------------------------------------+----------------------------------------------------------+
| status | ACTIVE |
| updated | 2013-10-29T01:58:32Z |
| OS-EXT-STS:task_state | None |
| OS-EXT-SRV-ATTR:host | ci91szwcmp001.webex.com |
| key_name | None |
| image | ct6.3-harden (00a0806a-e337-4c56-b876-f70b39806580) |
| limao network | 172.168.1.6 |
| hostId | dc9b9f06a3821105cf6f90468d5141cae89788eacaae406797339187 |
| OS-EXT-STS:vm_state | active |
| OS-EXT-SRV-ATTR:instance_name | instance-000028f1 |
| OS-EXT-SRV-ATTR:hypervisor_hostname | ci91szwcmp001.webex.com |
| flavor | m1.small (2) |
| id | 62a14df3-a639-4c77-992a-f4c43dfd4a3c |
| security_groups | [{u'name': u'default'}] |
| user_id | 691860d807d84e91a7c9decc6d9de902 |
| name | az1_1 |
| created | 2013-10-29T01:58:23Z |
| tenant_id | aeaa274663034168a0740ee6ffb8fc34 |
| OS-DCF:diskConfig | MANUAL |
| metadata | {} |
| accessIPv4 | |
| accessIPv6 | |
| progress | 0 |
| OS-EXT-STS:power_state | 1 |
| OS-EXT-AZ:availability_zone | az1 |
| config_drive | |
+-------------------------------------+----------------------------------------------------------+