Overlapping availability zones don't display properly
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Low
|
Sylvain Bauza |
Bug Description
If you create two overlapping availability zones, the get availability zones command returns odd information.
Repro:
$ nova --os-username admin --os-tenant-name admin --os-password secrete aggregate-create foo foo
+----+-
| Id | Name | Availability Zone | Hosts | Metadata |
+----+-
| 2 | foo | foo | | |
+----+-
$ nova --os-username admin --os-tenant-name admin --os-password secrete aggregate-add-host 2 node001-cont001
Aggregate 2 has been successfully updated.
+----+-
| Id | Name | Availability Zone | Hosts | Metadata |
+----+-
| 2 | foo | foo | [u'node001-
+----+-
$ nova availability-
+------
| Name | Status |
+------
| zone001 | available |
| zone001,foo | available |
+------
Expected:
+------
| Name | Status |
+------
| zone001 | available |
| foo | available |
+------
The admin view is a little more useful:
$ nova --os-username admin --os-tenant-name admin --os-password secrete availability-
+------
| Name | Status |
+------
| internal | available |
...
| zone001 | available |
| |- node005-cont001 | |
| | |- nova-compute | enabled :-) 2014-02-
| |- node007-cont001 | |
| | |- nova-compute | enabled :-) 2014-02-
| |- node009-cont001 | |
| | |- nova-compute | enabled :-) 2014-02-
| |- node003-cont001 | |
| | |- nova-compute | enabled :-) 2014-02-
| zone001,foo | available |
| |- node001-cont001 | |
| | |- nova-compute | enabled :-) 2014-02-
+------
but it could easily show two copies of the node that is in two zones:
+------
| Name | Status |
+------
| internal | available |
...
| zone001 | available |
| |- node005-cont001 | |
| | |- nova-compute | enabled :-) 2014-02-
| |- node007-cont001 | |
| | |- nova-compute | enabled :-) 2014-02-
| |- node009-cont001 | |
| | |- nova-compute | enabled :-) 2014-02-
| |- node003-cont001 | |
| | |- nova-compute | enabled :-) 2014-02-
| |- node001-cont001 | |
| | |- nova-compute | enabled :-) 2014-02-
| foo | available |
| |- node001-cont001 | |
| | |- nova-compute | enabled :-) 2014-02-
+------
Changed in nova: | |
assignee: | nobody → Sylvain Bauza (sylvain-bauza) |
Changed in nova: | |
status: | Triaged → In Progress |
Changed in nova: | |
milestone: | none → juno-2 |
status: | Fix Committed → Fix Released |
Changed in nova: | |
milestone: | juno-2 → 2014.2 |
This line should be modified to return the zones as a list instead of joining them using ',':
https:/ /github. com/openstack/ nova/blob/ e9788089173f03f 9a25e69b61346e5 6af045eccf/ nova/availabili ty_zones. py#L73
The call sites of set_availabilit y_zones should be converted to do the comma join if necessary, and to simply deal with processing a list in other cases.
For example, to fix the issue above:
https:/ /github. com/openstack/ nova/blob/ e9788089173f03f 9a25e69b61346e5 6af045eccf/ nova/availabili ty_zones. py#L118
and
https:/ /github. com/openstack/ nova/blob/ e9788089173f03f 9a25e69b61346e5 6af045eccf/ nova/availabili ty_zones. py#L129
can be modified to have another iteration through the zones when creating the list
for zone_list in zones: zones:
--> for zone in zone_list:
-------> if zone not in not_available_