nova/nova/tests/functional
Lee Yarwood b18e93a2a4 compute: Don't delete the original attachment during pre LM rollback
I0bfb11296430dfffe9b091ae7c3a793617bd9d0d introduced support for live
migration with cinderv3 volume attachments during Queens. This initial
support handled failures in pre_live_migration directly by removing any
attachments created on the destination and reverting to the original
attachment ids before re-raising the caught exception to the source
compute. It also added rollback code within the main
_rollback_live_migration method but missed that this would also be
called during a pre_live_migration rollback.

As a result after a failure in pre_live_migration
_rollback_live_migration will attempt to delete the source host volume
attachments referenced by the bdm before updating the bdms with the now
non-existent attachment ids, leaving the volumes in an `available` state
in Cinder as they have no attachment records associated with them
anymore.

This change aims to resolve this within _rollback_volume_bdms by
ensuring that the current and original attachment_ids are not equal
before requesting that the current attachment referenced by the bdm is
deleted. When called after a failure in pre_live_migration this should
result in no attempt being made to remove the original source host
attachments from Cinder.

Note that the following changes muddy the waters slightly here but
introduced no actual changes to the logic within
_rollback_live_migration:

* I0f3ab6604d8b79bdb75cf67571e359cfecc039d8 reworked some of the error
  handling in Rocky but isn't the source of the issue here.

* Ibe9215c07a1ee00e0e121c69bcf7ee1b1b80fae0 reworked
  _rollback_live_migration to use the provided source_bdms.

* I6bc73e8c8f98d9955f33f309beb8a7c56981b553 then refactored
  _rollback_live_migration, moving the logic into a self contained
  _rollback_volume_bdms method.

Closes-Bug: #1889108
Change-Id: I9edb36c4df1cc0d8b529e669f06540de71766085
(cherry picked from commit 2102f1834a)
(cherry picked from commit 034b2fa8fe)
(cherry picked from commit c6c3483a41)
(cherry picked from commit 6007c41aa8)
2020-09-14 10:20:11 +01:00
..
api Replace time.sleep(10) with service forced_down in tests 2019-11-27 02:01:12 +00:00
api_sample_tests Merge "Fix os-keypairs pagination links" into stable/rocky 2020-03-19 19:34:21 +00:00
compute Remove global state from the FakeDriver 2020-03-12 18:46:18 +01:00
db Fix misuse of nova.objects.base.obj_equal_prims 2019-08-14 08:56:45 +09:00
libvirt Merge "FUP for in-place numa rebuild" into stable/rocky 2020-08-18 02:30:24 +00:00
notification_sample_tests Remove global state from the FakeDriver 2020-03-12 18:46:18 +01:00
regressions compute: Don't delete the original attachment during pre LM rollback 2020-09-14 10:20:11 +01:00
wsgi Block deleting compute services with in-progress migrations 2019-12-09 18:34:52 -05:00
__init__.py move eventlet GREENDNS override to top level 2014-12-08 17:41:03 -05:00
api_paste_fixture.py Remove legacy v2 API functional tests 2016-05-04 18:17:23 +08:00
api_samples_test_base.py Fix os-simple-tenant-usage result order 2018-10-29 08:15:47 +00:00
integrated_helpers.py Block rebuild when NUMA topology changed 2020-07-09 14:06:22 +01:00
test_aggregates.py Remove global state from the FakeDriver 2020-03-12 18:46:18 +01:00
test_availability_zones.py Remove global state from the FakeDriver 2020-03-12 18:46:18 +01:00
test_boot_from_volume.py Properly track local root disk usage during moves 2018-10-31 12:45:49 -04:00
test_compute_mgr.py Unplug VIFs as part of cleanup of networks 2020-03-27 11:45:24 +00:00
test_images.py Share snapshot image membership with instance owner 2019-04-30 21:13:46 +09:00
test_instance_actions.py Improve NeutronFixture and remove unncessary stubbing 2018-08-02 15:15:03 +02:00
test_legacy_v2_compatible_wrapper.py Improve NeutronFixture and remove unncessary stubbing 2018-08-02 15:15:03 +02:00
test_list_servers_ip_filter.py Trivial: Nix duplicate PlacementFixture() in test 2017-12-01 15:39:28 -06:00
test_login.py update api_samples code to use better variables 2015-12-14 11:23:26 +08:00
test_metadata.py Remove unused logging import 2017-02-17 15:17:51 +07:00
test_middleware.py Removes unnecessary utf-8 encoding 2016-12-20 10:27:01 +07:00
test_multiattach.py Improve NeutronFixture and remove unncessary stubbing 2018-08-02 15:15:03 +02:00
test_nova_manage.py Add BFV wrinkle to TestNovaManagePlacementHealAllocations 2019-12-13 15:05:22 -05:00
test_report_client.py Use placement microversion 1.26 in update_from_provider_tree 2018-08-20 11:48:57 -04:00
test_server_faults.py Replace non-nova server fault message 2019-08-06 11:35:58 -04:00
test_server_group.py Update scheduler instance info at confirm resize 2020-05-25 08:03:13 +00:00
test_servers.py Enhance service restart in functional env 2020-03-13 18:03:04 +01:00
test_service.py Reset the cell cache for database access in Service 2020-04-16 20:56:39 +00:00