IndexError adding host to availability zone
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Low
|
Hans Lindgren | ||
Kilo |
Won't Fix
|
Low
|
Gonzalo De La Torre |
Bug Description
There appears to be a bug in the code dealing with adding a disabled host to an aggregate that is exported as an availability zone.
I disable the nova-compute service on a host and then tried to add it to an aggregate that is exported as an availabilty zone. This resulted in the following error.
File "/usr/lib64/
six.
File "/usr/lib64/
return f(self, context, *args, **kw)
File "/usr/lib64/
aggregate=
File "/usr/lib64/
host_az = host_azs.pop()
IndexError: pop from empty list
The code looks like this:
if 'availability_zone' in metadata:
_hosts = hosts or aggregate.hosts
zones, not_zones = availability_
for host in _hosts:
# NOTE(sbauza): Host can only be in one AZ, so let's take only
# the first element
It appears that for a disabled host, host_azs can be empty, resulting in an error when we try to pop() from it.
It works fine if the service is enabled on the host, and it works fine if the service is diabled and I try to add the host to an aggregate that is not exported as an availability zone.
Changed in nova: | |
assignee: | nobody → jichenjc (jichenjc) |
Changed in nova: | |
importance: | Undecided → Low |
Changed in nova: | |
milestone: | none → liberty-1 |
status: | Fix Committed → Fix Released |
Changed in nova: | |
milestone: | liberty-1 → 12.0.0 |
I confirmed same situation on my env