From ac475bbb2a906f481b953494ba28690a716a3554 Mon Sep 17 00:00:00 2001 From: Chris Dent Date: Wed, 7 Feb 2018 18:35:40 +0000 Subject: [PATCH] Correct configuration setting using NUMBER_FAKE_NOVA_COMPUTE In Change-Id Ia3843818014f7c6c7526ef3aa9676bbddb8a85ca the 'host' setting used for each of the fake compute hosts was accidentally named 'nhost' ('\nhost' was edited poorly), so the setting doesn't actually do anything: you create multiple nova-compute processes they think they are all on the same host and only one hypervisor and resource provider is created. With the correction in place, the wait_for_compute function needs to be updated to be aware of the fact that the hostnames on the compute services will have a numeric prefix when the fake virt driver is used. Change-Id: I5e8430d170c0b1c4f195ebe510aff8be59e4a3bc --- functions | 7 ++++++- lib/nova | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/functions b/functions index 959133ce5c..eabe249894 100644 --- a/functions +++ b/functions @@ -446,7 +446,12 @@ function wait_for_compute { ID="" while [[ "\$ID" == "" ]]; do sleep 1 - ID=\$(openstack --os-cloud devstack-admin --os-region "$REGION_NAME" compute service list --host `hostname` --service nova-compute -c ID -f value) + if [[ "$VIRT_DRIVER" = 'fake' ]]; then + # When using the fake driver the compute hostnames have a suffix of 1 to NUMBER_FAKE_NOVA_COMPUTE + ID=\$(openstack --os-cloud devstack-admin --os-region "$REGION_NAME" compute service list --host `hostname`1 --service nova-compute -c ID -f value) + else + ID=\$(openstack --os-cloud devstack-admin --os-region "$REGION_NAME" compute service list --host `hostname` --service nova-compute -c ID -f value) + fi done EOF time_stop "wait_for_service" diff --git a/lib/nova b/lib/nova index fea2b8509a..a6ad907cf4 100644 --- a/lib/nova +++ b/lib/nova @@ -877,7 +877,7 @@ function start_nova_compute { # creating or modifying real configurations. Each fake # gets its own configuration and own log file. local fake_conf="${NOVA_FAKE_CONF}-${i}" - iniset $fake_conf DEFAULT nhost "${HOSTNAME}${i}" + iniset $fake_conf DEFAULT host "${HOSTNAME}${i}" run_process "n-cpu-${i}" "$NOVA_BIN_DIR/nova-compute --config-file $NOVA_CPU_CONF --config-file $fake_conf" done else