Merge "Deploy overcloud images from seed"

This commit is contained in:
Jenkins 2014-04-18 11:43:26 +00:00 committed by Gerrit Code Review
commit 86a4ad985b
2 changed files with 47 additions and 16 deletions

View File

@ -27,6 +27,8 @@ function show_options () {
echo " --nodes NODEFILE -- You are supplying your own list of hardware."
echo " The schema for nodes can be found in the devtest_setup"
echo " documentation."
echo " --no-undercloud -- Use the seed as the baremetal cloud to deploy the"
echo " overcloud from."
echo " --build-only -- Builds images but doesn't attempt to run them."
echo
echo "Note that this script just chains devtest_variables, devtest_setup,"
@ -40,13 +42,14 @@ function show_options () {
BUILD_ONLY=
NODES_ARG=
NO_UNDERCLOUD=
NETS_ARG=
CONTINUE=
USE_CACHE=0
export TRIPLEO_CLEANUP=1
DEVTEST_START=$(date +%s) #nodocs
TEMP=$(getopt -o h,c -l build-only,existing-environment,trash-my-machine,nodes:,bm-networks: -n $SCRIPT_NAME -- "$@")
TEMP=$(getopt -o h,c -l build-only,existing-environment,trash-my-machine,nodes:,bm-networks:,no-undercloud -n $SCRIPT_NAME -- "$@")
if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
# Note the quotes around `$TEMP': they are essential!
@ -59,6 +62,7 @@ while true ; do
--existing-environment) TRIPLEO_CLEANUP=0; shift 1;;
--nodes) NODES_ARG="--nodes $2"; shift 2;;
--bm-networks) NETS_ARG="--bm-networks $2"; shift 2;;
--no-undercloud) NO_UNDERCLOUD="true"; shift 1;;
-c) USE_CACHE=1; shift 1;;
-h) show_options 0;;
--) shift ; break ;;
@ -237,37 +241,53 @@ DEVTEST_RD_START=$(date +%s) #nodocs
devtest_ramdisk.sh
DEVTEST_RD_END=$(date +%s) #nodocs
## #. See :doc:`devtest_seed` for documentation::
## #. See :doc:`devtest_seed` for documentation. If you are not deploying an
## undercloud, (see below) then you will want to add --all-nodes to your
## invocation of devtest_seed.sh,which will register all your nodes directly
## with the seed cloud.::
## devtest_seed.sh
## export no_proxy=${no_proxy:-},192.0.2.1
## source $TRIPLEO_ROOT/tripleo-incubator/seedrc
### --end
DEVTEST_SD_START=$(date +%s)
devtest_seed.sh $BUILD_ONLY
if [ -z "$NO_UNDERCLOUD" ]; then
ALLNODES=""
else
ALLNODES="--all-nodes"
fi
devtest_seed.sh $BUILD_ONLY $ALLNODES
DEVTEST_SD_END=$(date +%s)
export no_proxy=${no_proxy:-},192.0.2.1
if [ -z "$BUILD_ONLY" ]; then
source $TRIPLEO_ROOT/tripleo-incubator/seedrc
fi
### --include
## #. See :doc:`devtest_undercloud` for documentation.
## #. See :doc:`devtest_undercloud` for documentation. The undercloud doesn't
## have to be built - the seed is entirely capable of deploying any
## baremetal workload - but a production deployment would quite probably
## want to have a heat deployed (and thus reconfigurable) deployment
## infrastructure layer).
## If you are only building images you won't need to update your no_proxy
## line or source the undercloudrc file.
## ::
export no_proxy=${no_proxy:-},192.0.2.1
## devtest_undercloud.sh $TE_DATAFILE
## export no_proxy=$no_proxy,$(os-apply-config --type raw -m $TE_DATAFILE --key undercloud.endpointhost)
## source $TRIPLEO_ROOT/tripleo-incubator/undercloudrc
### --end
if [ -z "$BUILD_ONLY" ]; then
source $TRIPLEO_ROOT/tripleo-incubator/seedrc
fi
DEVTEST_UC_START=$(date +%s)
devtest_undercloud.sh $TE_DATAFILE $BUILD_ONLY
if [ -z "$NO_UNDERCLOUD" ]; then
devtest_undercloud.sh $TE_DATAFILE $BUILD_ONLY
if [ -z "$BUILD_ONLY" ]; then
export no_proxy=$no_proxy,$(os-apply-config --type raw -m $TE_DATAFILE --key undercloud.endpointhost)
source $TRIPLEO_ROOT/tripleo-incubator/undercloudrc
fi
fi
DEVTEST_UC_END=$(date +%s)
if [ -z "$BUILD_ONLY" ]; then
### --include
export no_proxy=$no_proxy,$(os-apply-config --type raw -m $TE_DATAFILE --key undercloud.endpointhost)
source $TRIPLEO_ROOT/tripleo-incubator/undercloudrc
fi #nodocs
## #. See :doc:`devtest_overcloud` for documentation.
## If you are only building images you won't need to update your no_proxy

View File

@ -13,13 +13,15 @@ function show_options () {
echo "Options:"
echo " -h -- this help"
echo " --build-only -- build the needed images but don't deploy them."
echo " --all-nodes -- use all the nodes in the testenv rather than"
echo " just the first one."
echo
exit $1
}
BUILD_ONLY=
TEMP=$(getopt -o h -l build-only,help -n $SCRIPT_NAME -- "$@")
TEMP=$(getopt -o h -l all-nodes,build-only,help -n $SCRIPT_NAME -- "$@")
if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
# Note the quotes around `$TEMP': they are essential!
@ -27,6 +29,7 @@ eval set -- "$TEMP"
while true ; do
case "$1" in
--all-nodes) ALL_NODES="true"; shift 1;;
--build-only) BUILD_ONLY="--build-only"; shift 1;;
-h | --help) show_options 0;;
--) shift ; break ;;
@ -224,9 +227,17 @@ setup-neutron $BM_NETWORK_SEED_RANGE_START $BM_NETWORK_SEED_RANGE_END $BM_NETWOR
## If you want to create the VM yourself see footnote [#f2]_ for details
## on its requirements.
## If you want to use real baremetal see footnote [#f3]_ for details.
## If you are building an undercloud, register only the first node.
## ::
setup-baremetal --service-host seed --nodes <(jq '[.nodes[0]]' $TE_DATAFILE)
if [ -z "${ALL_NODES:-}" ]; then #nodocs
setup-baremetal --service-host seed --nodes <(jq '[.nodes[0]]' $TE_DATAFILE)
else #nodocs
## Otherwise, if you are skipping the undercloud, you should register all
## the nodes.::
setup-baremetal --service-host seed --nodes <(jq '.nodes' $TE_DATAFILE)
fi #nodocs
## If you need to collect the MAC address separately, see ``scripts/get-vm-mac`.