Skip to content

Commit db8c7a6

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Fix LM rollback w/o multi port bindings extension" into stable/yoga
2 parents 9e96274 + 5f086d4 commit db8c7a6

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

nova/tests/functional/regressions/test_bug_1888395.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,7 @@ def test_live_migration_rollback(self):
146146

147147
self.assertFalse(
148148
self.neutron_api.has_port_binding_extension(self.ctxt))
149-
# FIXME(artom) Until bug 1969980 is fixed, this will fail with a
150-
# NotImplementedError.
151-
self._live_migrate(self.server, migration_expected_state='error',
152-
server_expected_state='ERROR')
153-
server = self.api.get_server(self.server['id'])
154-
self.assertIn(
155-
"NotImplementedError: Cannot load 'vifs' in the base class",
156-
server['fault']['details']
157-
)
149+
# NOTE(artom) The live migration will still fail (we fail it in
150+
# _migrate_stub()), but the server should correctly rollback to ACTIVE.
151+
self._live_migrate(self.server, migration_expected_state='failed',
152+
server_expected_state='ACTIVE')

nova/virt/libvirt/driver.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10469,10 +10469,13 @@ def rollback_live_migration_at_source(self, context, instance,
1046910469
:param instance: the instance being migrated
1047010470
:param migrate_date: a LibvirtLiveMigrateData object
1047110471
"""
10472-
network_info = network_model.NetworkInfo(
10473-
[vif.source_vif for vif in migrate_data.vifs
10474-
if "source_vif" in vif and vif.source_vif])
10475-
self._reattach_instance_vifs(context, instance, network_info)
10472+
# NOTE(artom) migrate_data.vifs might not be set if our Neutron doesn't
10473+
# have the multiple port bindings extension.
10474+
if 'vifs' in migrate_data and migrate_data.vifs:
10475+
network_info = network_model.NetworkInfo(
10476+
[vif.source_vif for vif in migrate_data.vifs
10477+
if "source_vif" in vif and vif.source_vif])
10478+
self._reattach_instance_vifs(context, instance, network_info)
1047610479

1047710480
def rollback_live_migration_at_destination(self, context, instance,
1047810481
network_info,

0 commit comments

Comments
 (0)