nova/nova/tests/functional/notification_sample_tests
Matt Riedemann 938b499b1f Ensure source service is up before resizing/migrating
If the source compute service is down when a resize or
cold migrate is initiated the prep_resize cast from the
selected destination compute service to the source will
fail/hang. The API can validate the source compute service
is up or fail the operation with a 409 response if the
source service is down. Note that a host status of
"MAINTENANCE" means the service is up but disabled by
an administrator which is OK for resize/cold migrate.

The solution here works the validation into the
check_instance_host decorator which surprisingly isn't
used in more places where the source host is involved
like reboot, rebuild, snapshot, etc. This change just
handles the resize method but is done in such a way that
the check_instance_host decorator could be applied to
those other methods and perform the is-up check as well.
The decorator is made backward compatible by default.

Note that Instance._save_services is added because during
resize the Instance is updated and the services field
is set but not actually changed, but Instance.save()
handles object fields differently so we need to implement
the no-op _save_services method to avoid a failure.

Conflicts:
    nova/api/openstack/compute/migrate_server.py
    nova/api/openstack/compute/servers.py
    nova/tests/unit/compute/test_compute_api.py
    nova/tests/functional/wsgi/test_servers.py

NOTE(lyarwood): Conflicts as I8c96b337f32148f8f5899c9b87af331b1fa41424,
I711e56bcb4b72605253fa63be230a68e03e45b84,
I098f91d8c498e5a85266e193ad37c08aca4792b2 and
I19db48bd03855d1a1edbeff5adf15a28abcb5d92 are not in stable/train.

Change-Id: I85423c7bcacff3bc465c22686d0675529d211b59
Closes-Bug: #1856925
(cherry picked from commit ea2ea492a3)
2020-01-16 16:11:48 +00:00
..
__init__.py Adds json sample for the versioned notifications 2016-01-28 15:31:21 +01:00
notification_sample_base.py Dump versioned notifications when len assertions fail 2019-08-08 19:27:33 -04:00
test_aggregate.py Transform aggregate.update_prop notification 2018-07-15 23:36:31 +09:00
test_compute_task.py Ensure source service is up before resizing/migrating 2020-01-16 16:11:48 +00:00
test_exception_notification.py Add full traceback to ExceptionPayload in versioned notifications 2018-06-19 16:46:46 +08:00
test_flavor.py Add microversion to allow setting flavor description 2017-11-15 22:10:39 +00:00
test_instance.py Fix a misuse of assertGreaterEqual 2019-09-13 20:11:15 +09:00
test_keypair.py Transform keypair.import notification 2017-10-30 16:44:29 -04:00
test_libvirt.py Transform libvirt.error notification 2018-09-18 07:06:09 +00:00
test_metrics.py Use a static resource tracker in compute manager 2019-01-17 06:34:29 +00:00
test_server_group.py Transform scheduler.select_destinations notification 2018-11-30 13:20:35 +01:00
test_service.py Avoid timeout from service update notification tests 2019-08-12 17:49:11 +02:00
test_volume.py Rename CinderFixtureNewAttachFlow to CinderFixture 2019-07-01 16:00:52 -05:00