summaryrefslogtreecommitdiff
path: root/nova/api
diff options
context:
space:
mode:
authorRené Ribaud <rribaud@redhat.com>2022-06-13 15:20:51 +0200
committerRené Ribaud <rribaud@redhat.com>2022-07-22 10:22:24 +0200
commita263fa46f861c091d93782d4796c8302f9c30f4a (patch)
treed5c3cf27c193c692f71149548adfffb27445f50d /nova/api
parentbcb96f362ab12e297f125daa5189fb66345b4976 (diff)
downloadnova-a263fa46f861c091d93782d4796c8302f9c30f4a.tar.gz
Allow unshelve to a specific host (Compute API part)
This patch introduce changes to the compute API that will allow PROJECT_ADMIN to unshelve an shelved offloaded server to a specific host. This patch also supports the ability to unpin the availability_zone of an instance that is bound to it. Implements: blueprint unshelve-to-host Change-Id: Ieb4766fdd88c469574fad823e05fe401537cdc30
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/compute/shelve.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/nova/api/openstack/compute/shelve.py b/nova/api/openstack/compute/shelve.py
index 829247cac4..deef3265f5 100644
--- a/nova/api/openstack/compute/shelve.py
+++ b/nova/api/openstack/compute/shelve.py
@@ -95,14 +95,15 @@ class ShelveController(wsgi.Controller):
context.can(shelve_policies.POLICY_ROOT % 'unshelve',
target={'project_id': instance.project_id})
- new_az = None
+ unshelve_args = {}
+
unshelve_dict = body['unshelve']
support_az = api_version_request.is_supported(req, '2.77')
if support_az and unshelve_dict:
- new_az = unshelve_dict['availability_zone']
+ unshelve_args['new_az'] = unshelve_dict['availability_zone']
try:
- self.compute_api.unshelve(context, instance, new_az=new_az)
+ self.compute_api.unshelve(context, instance, **unshelve_args)
except (exception.InstanceIsLocked,
exception.UnshelveInstanceInvalidState,
exception.MismatchVolumeAZException) as e: