Commit cc31fa13 authored by Christos Stavrakakis's avatar Christos Stavrakakis
Browse files

cyclades: Map reboot type to shutdown timeout

Fix handling of reboot type option. If 'hard' reboot type is specified
this is mapped to zero shutdown timeout of OP_INSTANCE_REBOOT Ganeti
job. This is only supported from Ganeti>=2.10 and snf-ganeti. In other
versions this options will be ignored, and we will fall back to Ganeti's
default shutdown timeout (120s).
parent b9a187ce
......@@ -682,16 +682,16 @@ def delete_instance(vm):
def reboot_instance(vm, reboot_type):
assert reboot_type in ('soft', 'hard')
# Note that reboot type of Ganeti job must be always hard. The 'soft' and
# 'hard' type of OS API is different from the one in Ganeti, and maps to
# 'shutdown_timeout'.
kwargs = {"instance": vm.backend_vm_id,
"reboot_type": "hard"}
# XXX: Currently shutdown_timeout parameter is not supported from the
# Ganeti RAPI. Until supported, we will fallback for both reboot types
# to the default shutdown timeout of Ganeti (120s). Note that reboot
# type of Ganeti job must be always hard. The 'soft' and 'hard' type
# of OS API is different from the one in Ganeti, and maps to
# 'shutdown_timeout'.
#if reboot_type == "hard":
# kwargs["shutdown_timeout"] = 0
# 'shutdown_timeout' parameter is only support from snf-ganeti>=2.8.2 and
# Ganeti > 2.10. In other versions this parameter will be ignored and
# we will fallback to default timeout of Ganeti (120s).
if reboot_type == "hard":
kwargs["shutdown_timeout"] = 0
if settings.TEST:
kwargs["dry_run"] = True
with pooled_rapi_client(vm) as client:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment