Comment 4 for bug 1277230

Revision history for this message
Sylvain Bauza (sylvain-bauza) wrote :

I can't reproduce the bug on my devstack... When specifying an az in nova.conf for compute host, I can see it :

bauzas@climate-devstack-ctrl:~$ nova availability-zone-list
+--------------------------+----------------------------------------+
| Name | Status |
+--------------------------+----------------------------------------+
| internal | available |
(...)
| nova | available |
| |- climate-devstack-ctrl | |
| | |- nova-compute | enabled :-) 2014-04-03T12:00:30.000000 |
+--------------------------+----------------------------------------+

I then created an aggregate with AZ both set to foo :
bauzas@climate-devstack-ctrl:~$ nova aggregate-list
+----+----------+-------------------+
| Id | Name | Availability Zone |
+----+----------+-------------------+
| 10 | foo | foo |
| 12 | nova | nova |
+----+----------+-------------------+

But when adding the host in foo, it overrides the default AZ :
bauzas@climate-devstack-ctrl:~$ nova aggregate-add-host foo climate-devstack-ctrl
Aggregate 10 has been successfully updated.
+----+------+-------------------+-------------------------+-------------------------+
| Id | Name | Availability Zone | Hosts | Metadata |
+----+------+-------------------+-------------------------+-------------------------+
| 10 | foo | foo | 'climate-devstack-ctrl' | 'availability_zone=foo' |
+----+------+-------------------+-------------------------+-------------------------+

bauzas@climate-devstack-ctrl:~$ nova availability-zone-list
+--------------------------+----------------------------------------+
| Name | Status |
+--------------------------+----------------------------------------+
| internal | available |
(...)
| foo | available |
| |- climate-devstack-ctrl | |
| | |- nova-compute | enabled :-) 2014-04-03T12:08:30.000000 |
+--------------------------+----------------------------------------+

Besides this, Nova API prevents adding the same host in a second AZ :

bauzas@climate-devstack-ctrl:~$ nova aggregate-list
+----+----------+-------------------+
| Id | Name | Availability Zone |
+----+----------+-------------------+
| 10 | foo | foo |
| 11 | foo2 | foo2 |
| 12 | nova | nova |
+----+----------+-------------------+

bauzas@climate-devstack-ctrl:~$ nova aggregate-add-host foo2 climate-devstack-ctrl
ERROR: Cannot perform action 'add_host_to_aggregate' on aggregate 11. Reason: Host already in availability zone foo. (HTTP 409) (Request-ID: req-120e0b7a-8005-4137-97d3-952375ed6f5c)

This is due to https://github.com/openstack/nova/blob/9d45e9cef624a4a972c24c47c7abd57a72d74432/nova/compute/api.py#L3378

Could someone share his config with me to know how to add the same host in two AZs ?