nova/nova/tests/unit/api/openstack/compute
Matt Riedemann ea2ea492a3 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.

Change-Id: I85423c7bcacff3bc465c22686d0675529d211b59
Closes-Bug: #1856925
2019-12-19 15:24:34 -05:00
..
__init__.py
admin_only_action_common.py Ensure source service is up before resizing/migrating 2019-12-19 15:24:34 -05:00
dummy_schema.py
microversions.py Remove the extensions framework from wsgi.py 2018-10-18 02:01:03 +00:00
test_access_ips.py nova-net: Convert remaining API tests to use neutron 2019-12-10 11:03:57 +00:00
test_admin_actions.py Remove mox in tests/unit/api/openstack/compute 2018-05-24 21:31:44 +00:00
test_admin_password.py Remove dead set_admin_password code to generate password 2019-10-29 11:03:26 -04:00
test_agents.py Multiple API cleanup changes 2019-08-12 08:52:38 -05:00
test_aggregates.py Log reason for remove_host action failing 2019-11-04 09:40:13 -05:00
test_api.py Remove unnecessary setUp function in testcase 2017-03-30 12:55:16 +08:00
test_attach_interfaces.py Handle PortLimitExceeded in POST /servers/{server_id}/os-interface 2019-04-04 14:52:20 -04:00
test_auth.py Tests: use fakes.HTTPRequest in compute tests 2016-08-24 19:03:54 +03:00
test_availability_zone.py nova-net: Convert remaining API tests to use neutron 2019-12-10 11:03:57 +00:00
test_baremetal_nodes.py Deprecate Baremetal and fping API 2016-07-26 14:14:44 +08:00
test_certificates.py Replace 'fake' with a real project ID 2019-09-30 14:40:20 +09:00
test_cloudpipe.py Replace 'fake' with a real project ID 2019-09-30 14:40:20 +09:00
test_cloudpipe_update.py Remove cloudpipe APIs 2017-05-04 16:13:45 +08:00
test_console_auth_tokens.py Remove nova-consoleauth 2019-07-05 15:04:47 +00:00
test_console_output.py Minimal construct plumbing for nova show when a cell is down 2018-10-31 15:22:09 -04:00
test_create_backup.py Limit the min length of string for integer JSON-Schema 2017-05-27 10:14:28 +00:00
test_deferred_delete.py Replace 'fake' with a real project ID 2019-09-30 14:40:20 +09:00
test_disk_config.py conf: Remove deprecated 'project_id_regex' opt 2019-09-27 18:59:02 +09:00
test_evacuate.py Follow up (#2) for the bw resource provider series 2019-02-11 14:35:15 -05:00
test_extended_hypervisors.py Replace 'fake' with a real project ID 2019-09-30 14:40:20 +09:00
test_extended_ips.py conf: Remove deprecated 'project_id_regex' opt 2019-09-27 18:59:02 +09:00
test_extended_ips_mac.py conf: Remove deprecated 'project_id_regex' opt 2019-09-27 18:59:02 +09:00
test_extension_info.py Totally freeze the extension_info API 2017-05-08 16:32:48 +08:00
test_flavor_access.py Replace 'fake' with a real project ID 2019-09-30 14:40:20 +09:00
test_flavor_disabled.py conf: Remove deprecated 'project_id_regex' opt 2019-09-27 18:59:02 +09:00
test_flavor_manage.py Replace 'fake' with a real project ID 2019-09-30 14:40:20 +09:00
test_flavorextradata.py conf: Remove deprecated 'project_id_regex' opt 2019-09-27 18:59:02 +09:00
test_flavors.py conf: Remove deprecated 'project_id_regex' opt 2019-09-27 18:59:02 +09:00
test_flavors_extra_specs.py Replace 'fake' with a real project ID 2019-09-30 14:40:20 +09:00
test_floating_ip_pools.py Replace 'fake' with a real project ID 2019-09-30 14:40:20 +09:00
test_floating_ips.py nova-net: Convert remaining API tests to use neutron 2019-12-10 11:03:57 +00:00
test_hosts.py Replace 'fake' with a real project ID 2019-09-30 14:40:20 +09:00
test_hypervisor_status.py Replace 'fake' with a real project ID 2019-09-30 14:40:20 +09:00
test_hypervisors.py Multiple API cleanup changes 2019-08-12 08:52:38 -05:00
test_image_metadata.py Replace 'fake' with a real project ID 2019-09-30 14:40:20 +09:00
test_images.py conf: Remove deprecated 'project_id_regex' opt 2019-09-27 18:59:02 +09:00
test_instance_actions.py Replace 'fake' with a real project ID 2019-09-30 14:40:20 +09:00
test_instance_usage_audit_log.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
test_keypairs.py conf: Remove deprecated 'project_id_regex' opt 2019-09-27 18:59:02 +09:00
test_limits.py Multiple API cleanup changes 2019-08-12 08:52:38 -05:00
test_lock_server.py Microversion 2.73: Support adding the reason behind a server lock 2019-05-11 21:48:27 +00:00
test_microversions.py conf: Remove deprecated 'project_id_regex' opt 2019-09-27 18:59:02 +09:00
test_migrate_server.py Ensure source service is up before resizing/migrating 2019-12-19 15:24:34 -05:00
test_migrations.py Filter migrations by user_id/project_id 2019-10-14 11:35:11 -07:00
test_multinic.py Minimal construct plumbing for nova show when a cell is down 2018-10-31 15:22:09 -04:00
test_networks.py Remove (most) '/os-networks' REST APIs 2019-11-18 16:25:47 +00:00
test_pause_server.py Remove mox in tests/unit/api/openstack/compute 2018-05-24 21:31:44 +00:00
test_quota_classes.py Deprecate file injection 2017-12-12 09:22:21 -05:00
test_quotas.py nova-net: Remove 'networks' quota 2019-11-22 16:49:31 +00:00
test_remote_consoles.py Stop using mox stubs in test_remote_consoles.py 2017-07-18 00:39:01 +00:00
test_rescue.py Merge "Remove mox from api/openstack/compute/test_rescue.py" 2017-01-03 17:06:30 +00:00
test_security_groups.py nova-net: Drop nova-network-base security group tests 2019-12-10 11:03:57 +00:00
test_server_actions.py Ensure source service is up before resizing/migrating 2019-12-19 15:24:34 -05:00
test_server_diagnostics.py conf: Remove deprecated 'project_id_regex' opt 2019-09-27 18:59:02 +09:00
test_server_external_events.py Nix os-server-external-events 404 condition 2019-12-09 11:52:49 -06:00
test_server_group_quotas.py Use uuidsentinel from oslo.utils 2018-09-05 09:08:54 -05:00
test_server_groups.py Replace 'fake' with a real project ID 2019-09-30 14:40:20 +09:00
test_server_metadata.py Replace 'fake' with a real project ID 2019-09-30 14:40:20 +09:00
test_server_migrations.py Merge "Remove compute compat checks for aborting queued live migrations" 2019-10-23 08:08:36 +00:00
test_server_password.py Remove mox in unit/api/*/test_server_password.py 2018-04-09 16:28:08 +09:00
test_server_reset_state.py Minimal construct plumbing for nova show when a cell is down 2018-10-31 15:22:09 -04:00
test_server_start_stop.py conf: Remove deprecated 'project_id_regex' opt 2019-09-27 18:59:02 +09:00
test_server_tags.py conf: Remove deprecated 'project_id_regex' opt 2019-09-27 18:59:02 +09:00
test_server_topology.py Replace 'fake' with a real project ID 2019-09-30 14:40:20 +09:00
test_serversV21.py nova-net: Convert remaining API tests to use neutron 2019-12-10 11:03:57 +00:00
test_services.py Add test coverage of existing os-services policies 2019-11-25 17:27:32 +00:00
test_shelve.py Avoid error 500 on shelve task_state race 2019-10-30 15:56:47 -04:00
test_simple_tenant_usage.py Multiple API cleanup changes 2019-08-12 08:52:38 -05:00
test_snapshots.py Replace 'fake' with a real project ID 2019-09-30 14:40:20 +09:00
test_suspend_server.py Reject live migration and suspend on SEV guests 2019-09-10 13:59:02 +01:00
test_tenant_networks.py nova-net: Remove 'networks' quota 2019-11-22 16:49:31 +00:00
test_urlmap.py conf: Remove deprecated 'project_id_regex' opt 2019-09-27 18:59:02 +09:00
test_versions.py conf: Remove deprecated 'project_id_regex' opt 2019-09-27 18:59:02 +09:00
test_volumes.py trivial: Resolve (most) flake8 3.x issues 2019-12-11 16:57:22 +00:00