From d51baee40d0e50675d8055cab67b262ef0fc9f1f Mon Sep 17 00:00:00 2001 From: Matt Riedemann Date: Fri, 12 Jul 2019 11:51:17 -0400 Subject: [PATCH] Add NOVA_SHUTDOWN_TIMEOUT variable This adds a variable to control the [DEFAULT]/shutdown_timeout config in nova to control whether or not a guest should have a graceful shutdown of the OS or if it should just stop immediately (no timeout). Since devstack uses CirrOS images by default, the default value for the NOVA_SHUTDOWN_TIMEOUT variable is 0 which should speed up tempest runs. The default in nova.conf [1] is 60 seconds. [1] https://docs.openstack.org/nova/latest/configuration/config.html#DEFAULT.shutdown_timeout Change-Id: Ida83f70a1c4e61e5248f2bd42b4c24f7ac6d2310 Related-Bug: #1829896 --- lib/nova | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/nova b/lib/nova index 29bce5a819..f423b570cd 100644 --- a/lib/nova +++ b/lib/nova @@ -153,6 +153,11 @@ ISCSID_DEBUG_LEVEL=${ISCSID_DEBUG_LEVEL:-4} # Other options include "versioned" and "both". NOVA_NOTIFICATION_FORMAT=${NOVA_NOTIFICATION_FORMAT:-unversioned} +# Timeout for servers to gracefully shutdown the OS during operations +# like shelve, rescue, stop, rebuild. Defaults to 0 since the default +# image in devstack is CirrOS. +NOVA_SHUTDOWN_TIMEOUT=${NOVA_SHUTDOWN_TIMEOUT:-0} + # Functions # --------- @@ -401,6 +406,7 @@ function create_nova_conf { iniset $NOVA_CONF DEFAULT instance_name_template "${INSTANCE_NAME_PREFIX}%08x" iniset $NOVA_CONF DEFAULT osapi_compute_listen "$NOVA_SERVICE_LISTEN_ADDRESS" iniset $NOVA_CONF DEFAULT metadata_listen "$NOVA_SERVICE_LISTEN_ADDRESS" + iniset $NOVA_CONF DEFAULT shutdown_timeout $NOVA_SHUTDOWN_TIMEOUT iniset $NOVA_CONF key_manager backend nova.keymgr.conf_key_mgr.ConfKeyManager