Use correct space binding for live migration

Ensure that the 'migration' network space binding or the fallback
configuration option is passed to the nova-cloud-controller application
so that the correct IP address is SSH host scanned during setup of
live migration between hypervisors.

Change-Id: I6e20cd0b03f564ee9c110cf58fb0466f6a1f6c82
Closes-Bug: 1874235
This commit is contained in:
James Page 2020-05-26 09:20:38 +01:00
parent 747fa2d68d
commit 8aa29cc755
3 changed files with 9 additions and 1 deletions

View File

@ -339,7 +339,7 @@ def compute_joined(rid=None):
settings = {
'hostname': gethostname(),
'private-address': get_relation_ip(
'cloud-compute', cidr_network=config('os-internal-network')),
'migration', cidr_network=config('libvirt-migration-network')),
}
if migration_enabled():

View File

@ -23,7 +23,9 @@ provides:
interface: nrpe-external-master
scope: container
extra-bindings:
# Used for console access to instances
internal:
# Used for live/cold migration of instances
migration:
requires:
amqp:

View File

@ -401,6 +401,9 @@ class NovaComputeRelationsTests(CharmTestCase):
'hostname': 'testserver',
'private-address': '10.0.0.50',
})
self.get_relation_ip.assert_called_with(
'migration', cidr_network=None
)
def test_compute_joined_with_resize(self):
self.migration_enabled.return_value = False
@ -420,6 +423,9 @@ class NovaComputeRelationsTests(CharmTestCase):
'hostname': 'testserver',
'private-address': '10.0.0.50',
})
self.get_relation_ip.assert_called_with(
'migration', cidr_network=None
)
def test_compute_changed(self):
hooks.compute_changed()