Test with scheduler hints

Enables predictable placement to specific nodes using the nova
scheduler hints.

Change-Id: Ib64be565494658c8e0b8301240aaf116824692e9
This commit is contained in:
Ben Nemec 2016-09-27 22:34:50 +00:00
parent c10d5f7c08
commit 52ab46042a
3 changed files with 29 additions and 5 deletions

View File

@ -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

View File

@ -0,0 +1,5 @@
parameter_defaults:
ControllerSchedulerHints:
'capabilities:node': 'controller-%index%'
NovaComputeSchedulerHints:
'capabilities:node': 'compute-%index%'

View File

@ -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