From 52ab46042a832fe103042281c035b5e92912b7af Mon Sep 17 00:00:00 2001 From: Ben Nemec Date: Tue, 27 Sep 2016 22:34:50 +0000 Subject: [PATCH] Test with scheduler hints Enables predictable placement to specific nodes using the nova scheduler hints. Change-Id: Ib64be565494658c8e0b8301240aaf116824692e9 --- scripts/deploy.sh | 27 ++++++++++++++++++++++---- test-environments/scheduler-hints.yaml | 5 +++++ toci_gate_test.sh | 2 +- 3 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 test-environments/scheduler-hints.yaml diff --git a/scripts/deploy.sh b/scripts/deploy.sh index f0a12b530..fa0914f03 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -220,6 +220,18 @@ if [ "$OSINFRA" = "0" ]; then stop_metric "tripleo.introspect.seconds" fi + if [ $PREDICTABLE_PLACEMENT == 1 ]; then + source ~/stackrc + NODE_ID_0=$(ironic node-list | grep available | head -n 1 | tail -n 1 | awk '{print $2}') + NODE_ID_1=$(ironic node-list | grep available | head -n 2 | tail -n 1 | awk '{print $2}') + NODE_ID_2=$(ironic node-list | grep available | head -n 3 | tail -n 1 | awk '{print $2}') + NODE_ID_3=$(ironic node-list | grep available | head -n 4 | tail -n 1 | awk '{print $2}') + ironic node-update $NODE_ID_0 replace properties/capabilities='node:controller-0,boot_option:local' + ironic node-update $NODE_ID_1 replace properties/capabilities='node:controller-1,boot_option:local' + ironic node-update $NODE_ID_2 replace properties/capabilities='node:controller-2,boot_option:local' + ironic node-update $NODE_ID_3 replace properties/capabilities='node:compute-0,boot_option:local' + fi + sleep 60 fi @@ -305,10 +317,17 @@ if [ "$MULTINODE" == 0 ] && [ "$OVERCLOUD" == 1 ] ; then # Verify our public VIP is the one we specified grep -q 10.0.0.9 ~/overcloudrc || (echo "Wrong public vip deployed " && exit 1) # Verify our specified hostnames were used - nova list | grep -q controller-0-tripleo-ci-a-foo - nova list | grep -q controller-1-tripleo-ci-b-bar - nova list | grep -q controller-2-tripleo-ci-c-baz - nova list | grep -q compute-0-tripleo-ci-a-test + INSTANCE_ID_0=$(nova list | grep controller-0-tripleo-ci-a-foo | awk '{print $2}') + INSTANCE_ID_1=$(nova list | grep controller-1-tripleo-ci-b-bar | awk '{print $2}') + INSTANCE_ID_2=$(nova list | grep controller-2-tripleo-ci-c-baz | awk '{print $2}') + INSTANCE_ID_3=$(nova list | grep compute-0-tripleo-ci-a-test | awk '{print $2}') + # Verify the correct ironic nodes were used + echo "Verifying predictable placement configuration was honored." + ironic node-list | grep $INSTANCE_ID_0 | grep -q $NODE_ID_0 || (echo "$INSTANCE_ID_0 not deployed to node $NODE_ID_0" && exit 1) + ironic node-list | grep $INSTANCE_ID_1 | grep -q $NODE_ID_1 || (echo "$INSTANCE_ID_1 not deployed to node $NODE_ID_1" && exit 1) + ironic node-list | grep $INSTANCE_ID_2 | grep -q $NODE_ID_2 || (echo "$INSTANCE_ID_2 not deployed to node $NODE_ID_2" && exit 1) + ironic node-list | grep $INSTANCE_ID_3 | grep -q $NODE_ID_3 || (echo "$INSTANCE_ID_3 not deployed to node $NODE_ID_3" && exit 1) + echo "Verified." fi if [ $PACEMAKER == 1 ] ; then diff --git a/test-environments/scheduler-hints.yaml b/test-environments/scheduler-hints.yaml new file mode 100644 index 000000000..9ef1c26fe --- /dev/null +++ b/test-environments/scheduler-hints.yaml @@ -0,0 +1,5 @@ +parameter_defaults: + ControllerSchedulerHints: + 'capabilities:node': 'controller-%index%' + NovaComputeSchedulerHints: + 'capabilities:node': 'compute-%index%' diff --git a/toci_gate_test.sh b/toci_gate_test.sh index 53cbe8c91..7d7489462 100755 --- a/toci_gate_test.sh +++ b/toci_gate_test.sh @@ -187,7 +187,7 @@ for JOB_TYPE_PART in $(sed 's/-/ /g' <<< "${TOCI_JOBTYPE:-}") ; do # In ci our overcloud nodes don't have access to an external netwrok # --ntp-server is here to make the deploy command happy, the ci env # is on virt so the clocks should be in sync without it. - OVERCLOUD_DEPLOY_ARGS="$OVERCLOUD_DEPLOY_ARGS --control-scale 3 --ntp-server 0.centos.pool.ntp.org -e /usr/share/openstack-tripleo-heat-templates/environments/puppet-pacemaker.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/network-isolation.yaml -e $TRIPLEO_ROOT/tripleo-ci/test-environments/network-templates/network-environment.yaml -e $TRIPLEO_ROOT/tripleo-ci/test-environments/net-iso.yaml -e $TRIPLEO_ROOT/tripleo-ci/test-environments/ips-from-pool-all.yaml -e $TRIPLEO_ROOT/tripleo-ci/test-environments/hostname-map.yaml" + OVERCLOUD_DEPLOY_ARGS="$OVERCLOUD_DEPLOY_ARGS --control-scale 3 --ntp-server 0.centos.pool.ntp.org -e /usr/share/openstack-tripleo-heat-templates/environments/puppet-pacemaker.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/network-isolation.yaml -e $TRIPLEO_ROOT/tripleo-ci/test-environments/network-templates/network-environment.yaml -e $TRIPLEO_ROOT/tripleo-ci/test-environments/net-iso.yaml -e $TRIPLEO_ROOT/tripleo-ci/test-environments/ips-from-pool-all.yaml -e $TRIPLEO_ROOT/tripleo-ci/test-environments/hostname-map.yaml -e $TRIPLEO_ROOT/tripleo-ci/test-environments/scheduler-hints.yaml" NETISO_V4=1 PACEMAKER=1 PREDICTABLE_PLACEMENT=1