Fix up adding availability zone (AZ) to a host on creation
1. Nova AZ returns hosts as service hosts as opposed to hypervisor hostnames 2. Handle case where a Nova AZ has no hosts Change-Id: If6f6cf21170e95c58dd8a0a1b41b9b5f4797a627 Closes-Bug: #1880646
This commit is contained in:
parent
9cb7f6b52b
commit
532544efbf
@ -448,7 +448,7 @@ class FakeNovaHypervisors(object):
|
||||
class FakeHost(object):
|
||||
id = 1
|
||||
availability_zone = 'fake_az1'
|
||||
hypervisor_hostname = 'fake_name'
|
||||
hypervisor_hostname = 'fake_name.openstack.org'
|
||||
vcpus = 1
|
||||
cpu_info = 'fake_cpu'
|
||||
hypervisor_type = 'fake_type'
|
||||
|
@ -478,9 +478,9 @@ class NovaInventory(NovaClientWrapper):
|
||||
|
||||
az_name = ''
|
||||
if CONF.nova.az_aware:
|
||||
host_name = hypervisor.hypervisor_hostname
|
||||
host_name = hypervisor.service['host']
|
||||
for zone in self.nova.availability_zones.list(detailed=True):
|
||||
if (host_name in zone.hosts
|
||||
if (zone.hosts and host_name in zone.hosts
|
||||
and 'nova-compute' in zone.hosts[host_name]):
|
||||
az_name = zone.zoneName
|
||||
|
||||
|
6
releasenotes/notes/bug-1880646-f1af8c48f895f00e.yaml
Normal file
6
releasenotes/notes/bug-1880646-f1af8c48f895f00e.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
fixes:
|
||||
- |
|
||||
Fixes host creation in the presence of availability zones with no hosts.
|
||||
For more details, see `bug 1880646
|
||||
<https://bugs.launchpad.net/blazar/+bug/1880646>`_.
|
Loading…
x
Reference in New Issue
Block a user