Report original request ID on failed shelve

Building on I3d5aa41d96f7fa4fc860ed9d1076a247d5fa7bf6, and similar to
Ic1ffd62f9d6ed0d69467f678c1820cddbb1fda12 and
I5aee6c831abeb404c98751034903fd4d4ac9f47f, start logging the original
shelve request ID if shelving fails.

Change-Id: I5c8966b897bffdef8c8fe943e4c5c6a1a2fc27b7
This commit is contained in:
Artom Lifshitz 2023-11-15 14:15:45 -05:00
parent 94649e792e
commit 3f233b24dd

View File

@ -371,19 +371,22 @@ def shelve_server(servers_client, server_id, force_shelve_offload=False):
is configured not to offload server
automatically after offload time.
"""
servers_client.shelve_server(server_id)
body = servers_client.shelve_server(server_id)
request_id = body.response['x-openstack-request-id']
offload_time = CONF.compute.shelved_offload_time
if offload_time >= 0:
waiters.wait_for_server_status(servers_client, server_id,
'SHELVED_OFFLOADED',
extra_timeout=offload_time)
extra_timeout=offload_time,
request_id=request_id)
else:
waiters.wait_for_server_status(servers_client, server_id, 'SHELVED')
if force_shelve_offload:
servers_client.shelve_offload_server(server_id)
waiters.wait_for_server_status(servers_client, server_id,
'SHELVED_OFFLOADED')
'SHELVED_OFFLOADED',
request_id=request_id)
def create_websocket(url):