~ggouzi/obinstall/obinstall

« back to all changes in this revision

Viewing changes to demos/SDN/plumgrid/01-deploy.sh

  • Committer: MMorana
  • Date: 2016-03-24 01:18:40 UTC
  • Revision ID: mass@ubuntu.com-20160324011840-blxydmf7ca4ggle0
Splitting out demos from install

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/bash
2
 
 
3
 
 
4
 
set -eaux
5
 
 
6
 
#Get ob number
7
 
ob_number=`hostname | cut -c 10- -`
8
 
 
9
 
maas admin tags new name=gateway || true
10
 
maas admin tags new name=controller || true
11
 
maas admin tags new name=compute || true
12
 
for i in {11..20}
13
 
do
14
 
     mac=$(arp -n | fgrep ${ob_number}.$i | awk '{print $3}')
15
 
     system_id=$(maas admin nodes list mac_address=$mac | grep system_id | cut -d'"' -f4)
16
 
     maas admin tag update-nodes "compute" add=$system_id || true
17
 
     if [ $i -eq 12 ]; then
18
 
          maas admin tag update-nodes "controller" add=$system_id || true
19
 
     fi
20
 
done
21
 
 
22
 
     vmmac=$(virsh dumpxml node00vm1ob${ob_number}.maas | python -c 'import sys, lxml.etree; print list(lxml.etree.parse(sys.stdin).iter("mac"))[0].get("address")')
23
 
     vmsystem_id=$(maas admin nodes list mac_address=$vmmac | grep system_id | cut -d'"' -f4)
24
 
     maas admin tag update-nodes "gateway" add=$vmsystem_id || true
25
 
 
26
 
juju set-constraints tags=
27
 
time juju-deployer -d -c bundle.yaml
28
 
 
29
 
echo "Deployment finished"