From b4a7dfec8c638cd5fe754e6da9d3c822262fe9a1 Mon Sep 17 00:00:00 2001 From: Narinder Gupta Date: Wed, 15 Feb 2017 17:30:30 -0600 Subject: Some adjustments related to MAAS import images. Change-Id: Ib654069c2845708e92e5163cc58862458e381d90 Signed-off-by: Narinder Gupta --- ci/03-maasdeploy.sh | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/ci/03-maasdeploy.sh b/ci/03-maasdeploy.sh index e74de25d..53ff0514 100755 --- a/ci/03-maasdeploy.sh +++ b/ci/03-maasdeploy.sh @@ -197,18 +197,6 @@ configuremaas(){ maas $PROFILE maas set-config name='maas_name' value=$MAAS_NAME || true maas $PROFILE maas set-config name='ntp_server' value='ntp.ubuntu.com' || true maas $PROFILE sshkeys create "key=$SSH_KEY" || true - maas $PROFILE boot-source update $SOURCE_ID \ - url=$URL keyring_filename=$KEYRING_FILE || true - maas $PROFILE boot-source-selections create 1 \ - release='trusty' arches='amd64' labels='daily' \ - os='ubuntu' subarches='*' || true - maas $PROFILE boot-resources import || true - - while [ "$(maas $PROFILE boot-resources read | grep trusty | wc -l )" -le 0 ]; - do - maas $PROFILE boot-resources import || true - sleep 20 - done maas $PROFILE tags create name='bootstrap' || true maas $PROFILE tags create name='compute' || true @@ -226,6 +214,17 @@ configuremaas(){ maas $PROFILE spaces create name=storage-data || true maas $PROFILE spaces create name=storage-cluster || true + maas $PROFILE boot-source update $SOURCE_ID \ + url=$URL keyring_filename=$KEYRING_FILE || true + + maas $PROFILE boot-resources import || true + sleep 10 + + while [ "$(maas $PROFILE boot-resources is-importing)" == "true" ]; + do + sleep 60 + done + #maas $PROFILE subnet update vlan: name=internal-api space=<0> gateway_ip=10.5.1.1 #maas $PROFILE subnet update vlan: name=admin-api space=<2> gateway_ip=10.5.12.1 #maas $PROFILE subnet update vlan: name=public-api space=<1> gateway_ip=10.5.15.1 @@ -374,6 +373,13 @@ addnodes(){ maas $PROFILE tag update-nodes compute add=$compute2nodeid || true maas $PROFILE tag update-nodes compute add=$compute5nodeid || true fi + + # make sure nodes are added into MAAS and none of them is in commisoning state + while [ "$(maas $PROFILE nodes read | grep Commissioning )" ]; + do + sleep 60 + done + } #configure MAAS with the different options. @@ -383,22 +389,19 @@ if [ "$virtinstall" -eq 1 ]; then enablesubnetanddhcp fi -sleep 60 +#just make sure rack controller has been synced and import only +# just whether images have been imported or not. +sleep 120 #reconfigure maas with correct MAAS address. #Below code is needed as MAAS have issue in commisoning without restart. sudo ./maas-reconfigure-rack.sh $MAAS_IP sudo ./maas-reconfigure-region.sh $MAAS_IP -# lets sleep for around 5 more minutes to make sure all images are in sync. -sleep 240 - +sleep 30 #lets add the nodes now. Currently works only for virtual deploymnet. addnodes -#take another 5 minutes to commision the nodes. -sleep 300 - echo "... Deployment of maas finish ...." #Added the Qtip public to run the Qtip test after install on bare metal nodes. -- cgit 1.2.3-korg