nova/nova/tests/functional
Lee Yarwood 6007c41aa8 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)
2020-09-03 18:56:31 +01:00
..
api Include all network devices in nova diagnostics 2019-05-04 09:44:22 -06:00
api_sample_tests Merge "Fix os-keypairs pagination links" into stable/stein 2020-03-13 00:53:43 +00:00
compute Remove global state from the FakeDriver 2020-01-17 16:04:46 +01:00
db Make quotas respect instance_list_per_project_cells 2020-05-21 21:56:44 +00:00
libvirt libvirt: Don't delete disks on shared storage during evacuate 2020-06-10 02:24:13 +00:00
notification_sample_tests Remove global state from the FakeDriver 2020-01-17 16:04:46 +01:00
regressions compute: Don't delete the original attachment during pre LM rollback 2020-09-03 18:56:31 +01:00
wsgi Block deleting compute services with in-progress migrations 2019-11-25 11:11:13 -05:00
__init__.py Eventlet monkey patching should be as early as possible 2019-03-25 09:22:01 +01:00
api_paste_fixture.py Use external placement in functional tests 2018-12-12 18:46:49 +00:00
api_samples_test_base.py Merge "Fix os-simple-tenant-usage result order" 2018-10-27 08:57:52 +00:00
fixtures.py Convert driver supported capabilities to compute node provider traits 2019-02-28 23:28:19 +00:00
integrated_helpers.py Functional test for UnexpectedDeletingTaskStateError 2020-03-27 11:32:17 +00:00
test_aggregates.py Remove global state from the FakeDriver 2020-01-17 16:04:46 +01:00
test_availability_zones.py Remove global state from the FakeDriver 2020-01-17 16:04:46 +01:00
test_boot_from_volume.py Properly track local root disk usage during moves 2018-10-08 17:33:49 -04:00
test_compute_mgr.py Unplug VIFs as part of cleanup of networks 2020-03-27 11:38:49 +00:00
test_conf_max_attach_disk_devices.py Add configuration of maximum disk devices to attach 2019-01-30 15:47:10 +00:00
test_images.py Share snapshot image membership with instance owner 2019-02-08 18:06:27 -05: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 Use external placement in functional tests 2018-12-12 18:46:49 +00:00
test_login.py update api_samples code to use better variables 2015-12-14 11:23:26 +08:00
test_metadata.py Use external placement in functional tests 2018-12-12 18:46:49 +00: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-11-21 17:32:39 -05:00
test_report_client.py Use a placement conf when testing report client 2019-03-04 20:43:48 +00:00
test_server_faults.py Replace non-nova server fault message 2019-08-06 10:48:49 -04:00
test_server_group.py Update scheduler instance info at confirm resize 2020-05-20 19:48:46 +02:00
test_servers.py Enhance service restart in functional env 2020-01-20 16:56:13 +00:00
test_service.py Reset the cell cache for database access in Service 2020-04-16 19:55:10 +00:00