Fix rescue of volume-based instances

Rescue of volume-based instances is supported since Nova
microversion 2.87.
However, Horizon does not use this microversion when requesting
rescue of any instances, causing a Nova exception for volume-
based ones.

The patch fixes this by explicitly setting the required
microversion.

Closes-Bug: #1941744
Signed-off-by: Jan Hartkopf <jhartkopf@inovex.de>
Change-Id: Ic0cdfd326475882f839fd218cd7b4bfa62a2a76b
This commit is contained in:
Jan Hartkopf 2022-09-12 15:04:50 +02:00
parent 0b1dd3d89e
commit 05dd53a3cf
2 changed files with 7 additions and 3 deletions

View File

@ -37,6 +37,7 @@ MICROVERSION_FEATURES = {
"auto_allocated_network": ["2.37", "2.60"],
"key_types": ["2.2", "2.9"],
"key_type_list": ["2.9"],
"rescue_instance_volume_based": ["2.87", "2.93"],
},
"cinder": {
"groups": ["3.27", "3.43", "3.48", "3.58"],

View File

@ -665,9 +665,12 @@ def server_metadata_delete(request, instance_id, keys):
@profiler.trace
def server_rescue(request, instance_id, password=None, image=None):
_nova.novaclient(request).servers.rescue(instance_id,
password=password,
image=image)
microversion = get_microversion(request, "rescue_instance_volume_based")
_nova.novaclient(request, version=microversion).servers.rescue(
instance_id,
password=password,
image=image
)
@profiler.trace