nova/nova/tests/functional
Matt Riedemann 6c7e53e210 Fix InstanceNotFound during _destroy_evacuated_instances
The _destroy_evacuated_instances method on compute
startup tries to cleanup guests on the hypervisor and
allocations held against that compute node resource
provider by evacuated instances, but doesn't take into
account that those evacuated instances could have been
deleted in the meantime which leads to a lazy-load
InstanceNotFound error that kills the startup of the
compute service.

This change does two things in the _destroy_evacuated_instances
method:

1. Loads the evacuated instances with a read_deleted='yes'
   context when calling _get_instances_on_driver(). This
   should be fine since _get_instances_on_driver() is already
   returning deleted instances anyway (InstanceList.get_by_filters
   defaults to read deleted instances unless the filters tell
   it otherwise - which we don't in this case). This is needed
   so that things like driver.destroy() don't raise
   InstanceNotFound while lazy-loading fields on the instance.

2. Skips the call to remove_allocation_from_compute() if the
   evacuated instance is already deleted. If the instance is
   already deleted, its allocations should have been cleaned
   up by its hosting compute service (or the API).

The functional regression test is updated to show the bug is
now fixed.

Change-Id: I1f4b3540dd453650f94333b36d7504ba164192f7
Closes-Bug: #1794996
(cherry picked from commit 05cd8d1282)
(cherry picked from commit 0208d64397)
2018-12-06 18:58:24 -05:00
..
api Handle CannotDeleteParentResourceProvider to 409 Conflict 2018-06-28 13:50:18 +00:00
api_sample_tests Cleanup RP and HM records while deleting a compute service. 2018-04-23 18:54:54 +02:00
compute Handle volume API failure in _post_live_migration 2018-10-16 22:43:20 -04:00
db Handle missing marker during online data migration 2018-10-16 13:42:07 +00:00
libvirt Merge "Bump minimum required libvirt/qemu versions for Pike" 2017-02-24 02:50:33 +00:00
notification_sample_tests Fix a comment in a notification functional test 2018-01-27 11:36:22 +00:00
regressions Fix InstanceNotFound during _destroy_evacuated_instances 2018-12-06 18:58:24 -05:00
wsgi fixtures: Track volume attachments within CinderFixtureNewAttachFlow 2018-10-22 15:51:59 -04: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 Add pagination and changes-since for instance-actions 2017-12-14 07:42:17 +00:00
integrated_helpers.py Add functional test for affinity with multiple cells 2018-09-04 20:39:09 +00:00
test_aggregates.py re-Allow adding computes with no ComputeNodes to aggregates 2017-05-25 10:56:29 -07:00
test_compute_mgr.py Pass RequestSpec to ConductorTaskAPI.build_instances 2017-12-20 13:58:29 -05:00
test_images.py Add create image functional negative tests 2016-12-26 14:15:14 +09:00
test_instance_actions.py make microversion a client level construct for tests 2016-02-24 11:02:05 -05:00
test_legacy_v2_compatible_wrapper.py Trivial-Fix: Fix typos 2016-06-13 06:41:08 +00: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 [api] Allow multi-attach in compute api 2018-01-22 10:45:13 -05:00
test_nova_manage.py Unmap compute nodes when deleting host mappings in delete cell operation 2018-03-16 10:37:49 +01:00
test_server_group.py Make scheduler.utils.setup_instance_group query all cells 2018-09-05 16:36:22 +00:00
test_servers.py Update RequestSpec.flavor on resize_revert 2018-09-13 13:35:17 -04:00