summaryrefslogtreecommitdiffstats
path: root/ci/deploy.sh
diff options
context:
space:
mode:
authorNarinder Gupta <narinder.gupta@canonical.com>2017-09-01 17:30:42 -0500
committerNarinder Gupta <narinder.gupta@canonical.com>2017-09-01 17:47:10 -0500
commitc7b95f1cdee6d3df0577664ea511a746968add4a (patch)
tree71e8afa344f39f0e602037e6be2e89519398f3bf /ci/deploy.sh
parent48687e6ae064286cd0d607220d7726d228bac8ea (diff)
modified to autostart the VMs created for bootstrap and virtual
deployment. Change-Id: I7afcc6e382f7575fbd2741cded3915763aafe6f6 Signed-off-by: Narinder Gupta <narinder.gupta@canonical.com>
Diffstat (limited to 'ci/deploy.sh')
-rwxr-xr-xci/deploy.sh14
1 files changed, 13 insertions, 1 deletions
diff --git a/ci/deploy.sh b/ci/deploy.sh
index 85374e75..b722d2ae 100755
--- a/ci/deploy.sh
+++ b/ci/deploy.sh
@@ -136,6 +136,17 @@ createresource() {
API_KEY=`sudo maas-region apikey --username=ubuntu`
maas login $PROFILE $API_SERVER $API_KEY
+ # if we have a virshurl configuration we use it, else we use local
+ VIRSHURL=$(cat labconfig.json | jq -r '.opnfv.virshurl')
+ if ([ $VIRSHURL == "" ] || [ "$VIRSHURL" == "null" ]); then
+ VIRSHIP=$MAAS_IP
+ VIRSHURL="qemu+ssh://$USER@$VIRSHIP/system "
+ VIRSHHOST=""
+ else
+ VIRSHHOST=$(echo $VIRSHURL| cut -d\/ -f 3 | cut -d@ -f2)
+ VIRSHIP="" # TODO: parse from $VIRSHURL if needed
+ fi
+
for node in node3-control node4-control
do
node_id=$(maas $PROFILE machines read | \
@@ -149,7 +160,7 @@ createresource() {
--boot network,hd,menu=off \
--noautoconsole --vnc --print-xml | tee _node.xml
node_mac=$(grep "mac address" _node.xml | head -1 | cut -d "'" -f 2)
- sudo virsh -c qemu:///system define --file _node.xml
+ sudo virsh -c $VIRSHURL define --file _node.xml
rm -f _node.xml
maas $PROFILE nodes new autodetect_nodegroup='yes' name=$node \
@@ -157,6 +168,7 @@ createresource() {
mac_addresses=$node3controlmac \
power_parameters_power_address="qemu+ssh://$USER@192.168.122.1/system" \
architecture='amd64/generic' power_parameters_power_id='node3-control'
+ sudo virsh -c $VIRSHURL autostart $node
node_id=$(maas $PROFILE machines read | \
jq -r ".[] | select(.hostname == \"$node\").system_id")
fi