Support deploying extra nodes in te-broker

There are situations where we may need to deploy additional
undercloud-like nodes in a test environment.  Support for this has
been added to OVB and this commit wires it into the te-broker.

Change-Id: I84bfba3ee67cd5564ad0a4372c424a2622a97e6f
This commit is contained in:
Ben Nemec 2017-10-17 23:04:04 +00:00
parent 273673d471
commit 8bc85b0c8c
4 changed files with 21 additions and 0 deletions

View File

@ -9,10 +9,12 @@ SSH_KEY=${5:-""}
# We recognize 3 values for NETISO: none, multi-nic, public-bond
NETISO=${6:-'multi-nic'}
COMPUTE_NODECOUNT=${7:-0}
EXTRA_NODECOUNT=${8:-0}
PROVISIONNET=provision-${ENVNUM}
PUBLICNET=public-${ENVNUM}
ENVFILE=env-${ENVNUM}-base.yaml
COMPUTE_ENVFILE=env-${ENVNUM}-compute.yaml
EXTRA_ENVFILE=env-${ENVNUM}-extra.yaml
ROLE_ARGS=
source /etc/nodepoolrc
@ -79,6 +81,18 @@ if [ $COMPUTE_NODECOUNT -gt 0 ]; then
ROLE_ARGS="--role $COMPUTE_ENVFILE"
fi
if [ $EXTRA_NODECOUNT -gt 0 ]; then
/bin/cp --remove-destination environments/base-extra-node.yaml $EXTRA_ENVFILE
sed -i -e "s/baremetal_flavor:.*/baremetal_flavor: m1.small/" $EXTRA_ENVFILE
sed -i -e "s/key_name:.*/key_name: ${KEY_NAME}/" $EXTRA_ENVFILE
sed -i -e "s/node_count:.*/node_count: ${EXTRA_NODECOUNT}/" $EXTRA_ENVFILE
# We changed the path of the environment, so we need to fix the relative
# path in the resource registry too.
sed -i -e "s|../templates/baremetal-ports-extra-node-port-security.yaml|templates/baremetal-ports-extra-node-port-security.yaml|" $EXTRA_ENVFILE
ROLE_ARGS="--role $EXTRA_ENVFILE"
BUILD_NODES_JSON_EXTRA_ARGS="$BUILD_NODES_JSON_EXTRA_ARGS --network_details"
fi
/opt/stack/openstack-virtual-baremetal/bin/deploy.py --name baremetal_${ENVNUM} --quintupleo --id ${ENVNUM} $ENVIRONMENT_ARGS $ROLE_ARGS
while ! heat stack-show baremetal_${ENVNUM} | grep CREATE_COMPLETE ; do

View File

@ -6,10 +6,12 @@ PROVISIONNET=provision-${ENVNUM}
PUBLICNET=public-${ENVNUM}
ENVFILE=env-${ENVNUM}-base.yaml
COMPUTE_ENVFILE=env-${ENVNUM}-compute.yaml
EXTRA_ENVFILE=env-${ENVNUM}-extra.yaml
rm -f /opt/stack/openstack-virtual-baremetal/$ENVFILE
rm -f /opt/stack/openstack-virtual-baremetal/env-${ENVNUM}.yaml
rm -f /opt/stack/openstack-virtual-baremetal/$COMPUTE_ENVFILE
rm -f /opt/stack/openstack-virtual-baremetal/$EXTRA_ENVFILE
rm -f /opt/stack/openstack-virtual-baremetal/temp-key-$ENVNUM.pub
source /etc/nodepoolrc
@ -63,5 +65,6 @@ function delete_stack() {
}
# Extra role stacks must be deleted first
delete_stack baremetal_${ENVNUM}-extra
delete_stack baremetal_${ENVNUM}-compute
delete_stack baremetal_${ENVNUM}

View File

@ -140,6 +140,7 @@ class TEWorkerThread(threading.Thread):
arguments.get("ssh_key", ""),
arguments.get("net_iso", "multi-nic"),
arguments.get("compute_envsize","0"),
arguments.get("extra_nodes", "0"),
],
stderr=subprocess.STDOUT))
clientdata = fp.read()

View File

@ -173,6 +173,9 @@ def main(args=sys.argv[1:]):
'"public-bond" requests one like "multi-nic" '
'but with two public nics for use with bonded '
'nic-configs.')
parser.add_argument('--extra-nodes', default='0',
help='Number of extra undercloud-like nodes to '
'request')
parser.add_argument('--debug', '-d', action='store_true',
help='Set to debug mode.')
opts = parser.parse_args(args)