From 18d6298ea1eb0ff9697258dc323f1aba2b9b3d46 Mon Sep 17 00:00:00 2001 From: Joe Gordon Date: Tue, 28 Oct 2014 13:37:15 -0700 Subject: [PATCH] Make allow_{resize|migrate}_to_same_host configurable In preparation for supporting 2 node devstack jobs, where the first node is an all in one and the second is a compute node. Make nova config options allow_resize_to_same_host and allow_migrate_to_same_host configurable so we can turn them off when we have two compute nodes. Change-Id: If6989200b56c4597d6e8506d0dda2cc75d0881f1 --- lib/nova | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/nova b/lib/nova index f47dc9798c..0f838072c1 100644 --- a/lib/nova +++ b/lib/nova @@ -137,6 +137,10 @@ FLAT_INTERFACE=${FLAT_INTERFACE:-$GUEST_INTERFACE_DEFAULT} # running the VM - removing a SPOF and bandwidth bottleneck. MULTI_HOST=`trueorfalse False $MULTI_HOST` +# ``NOVA_ALLOW_MOVE_TO_SAME_HOST` can be set to False in multi node devstack, +# where there are at least two nova-computes. +NOVA_ALLOW_MOVE_TO_SAME_HOST=`trueorfalse True $NOVA_ALLOW_MOVE_TO_SAME_HOST` + # Test floating pool and range are used for testing. They are defined # here until the admin APIs can replace nova-manage TEST_FLOATING_POOL=${TEST_FLOATING_POOL:-test} @@ -411,8 +415,10 @@ function create_nova_conf { rm -f $NOVA_CONF iniset $NOVA_CONF DEFAULT verbose "True" iniset $NOVA_CONF DEFAULT debug "$ENABLE_DEBUG_LOG_LEVEL" - iniset $NOVA_CONF DEFAULT allow_resize_to_same_host "True" - iniset $NOVA_CONF DEFAULT allow_migrate_to_same_host "True" + if [ "$NOVA_ALLOW_MOVE_TO_SAME_HOST" == "True" ]; then + iniset $NOVA_CONF DEFAULT allow_resize_to_same_host "True" + iniset $NOVA_CONF DEFAULT allow_migrate_to_same_host "True" + fi iniset $NOVA_CONF DEFAULT api_paste_config "$NOVA_API_PASTE_INI" iniset $NOVA_CONF DEFAULT rootwrap_config "$NOVA_CONF_DIR/rootwrap.conf" iniset $NOVA_CONF DEFAULT scheduler_driver "$SCHEDULER"