summaryrefslogtreecommitdiffstats
path: root/ci
diff options
context:
space:
mode:
authorNarinder Gupta <narinder.gupta@canonical.com>2016-05-26 14:14:56 -0500
committerNarinder Gupta <narinder.gupta@canonical.com>2016-05-26 20:41:13 -0500
commitd17896f8f943ac15ed333633bcb68247d122c1ce (patch)
tree31ccd14557f3bd08c24b172e5da7d501bdfadd5c /ci
parentcfec7d3cd0d733d9b952a43f5f7264eb8e17e6a1 (diff)
ymodfiied to include marks comment for labconfig for intel pod6.
Change-Id: I2265e3063c786ad36c1fce0d139cee40b4a2875e Signed-off-by: Narinder Gupta <narinder.gupta@canonical.com>
Diffstat (limited to 'ci')
-rwxr-xr-xci/02-maasdeploy.sh6
-rw-r--r--ci/deploy.py57
2 files changed, 38 insertions, 25 deletions
diff --git a/ci/02-maasdeploy.sh b/ci/02-maasdeploy.sh
index f13e63f5..ff006768 100755
--- a/ci/02-maasdeploy.sh
+++ b/ci/02-maasdeploy.sh
@@ -238,13 +238,11 @@ fi
case "$labname" in
'intelpod5' )
maas refresh
- enableautomodebyname eth4 AUTO "10.5.12.0/24" compute || true
- enableautomodebyname eth4 AUTO "10.5.12.0/24" control || true
+ enableautomode eth4 AUTO "10.5.12.0/24" || true
;;
'intelpod6' )
maas refresh
- enableautomodebyname eth4 AUTO "10.6.12.0/24" compute || true
- enableautomodebyname eth4 AUTO "10.6.12.0/24" control || true
+ enableautomode eth4 AUTO "10.6.12.0/24" || true
;;
'intelpod9' )
maas refresh
diff --git a/ci/deploy.py b/ci/deploy.py
index 03c6027e..72002e6f 100644
--- a/ci/deploy.py
+++ b/ci/deploy.py
@@ -72,14 +72,14 @@ c=0
y=0
#z=0
-while c < len(labcfg["labconfig"]["bridges"]):
- brtype = getFromDict(labcfg, ["labconfig","bridges",c,"type"])
- brname = getFromDict(labcfg, ["labconfig","bridges",c,"bridge"])
- brcidr = getFromDict(labcfg, ["labconfig","bridges",c,"cidr"])
+while c < len(labcfg["opnfv"]["spaces"]):
+ brtype = getFromDict(labcfg, ["opnfv","spaces",c,"type"])
+ brname = getFromDict(labcfg, ["opnfv","spaces",c,"bridge"])
+ brcidr = getFromDict(labcfg, ["opnfv","spaces",c,"cidr"])
#
if brtype == "admin":
- ethbrAdmin = getFromDict(labcfg, ["labconfig","bridges",c,"bridge"])
- brgway = getFromDict(labcfg, ["labconfig","bridges",c,"gateway"])
+ ethbrAdmin = getFromDict(labcfg, ["opnfv","spaces",c,"bridge"])
+ brgway = getFromDict(labcfg, ["opnfv","spaces",c,"gateway"])
tmpcidr = brcidr[:-4]
nodegroup={"device": "eth"+str(y), "ip": tmpcidr+"5","subnet_mask": "255.255.255.0", \
@@ -97,13 +97,13 @@ while c < len(labcfg["labconfig"]["bridges"]):
' dns-nameservers '+updns+' '+tmpcidr+'5 127.0.0.1\n')
opnfvcfg['demo-maas']['maas']['ip_address']=tmpcidr+"5"
- opnfvcfg['demo-maas']['maas']['interfaces'].append("bridge="+brname+",model=virtio")
- opnfvcfg['demo-maas']['juju-bootstrap']['interfaces'].append("bridge="+brname+",model=virtio")
+ opnfvcfg['demo-maas']['maas']['interfaces'].append("bridge="+brname+",model=virtio")
+ opnfvcfg['demo-maas']['juju-bootstrap']['interfaces'].append("bridge="+brname+",model=virtio")
opnfvcfg["demo-maas"]["maas"]["node_group_ifaces"].append(nodegroup)
y=y+1
elif brtype:
opnfvcfg["demo-maas"]["maas"]["interfaces"].append("bridge="+brname+",model=virtio")
- brgway = getFromDict(labcfg, ["labconfig","bridges",c,"gateway"])
+ brgway = getFromDict(labcfg, ["opnfv","spaces",c,"gateway"])
if brtype != "external":
tmpcidr = brcidr[:-4]
if brgway:
@@ -126,7 +126,7 @@ while c < len(labcfg["labconfig"]["bridges"]):
if brtype == "public":
opnfvcfg["demo-maas"]["juju-bootstrap"]["interfaces"].append("bridge="+brname+",model=virtio")
if brtype == "external":
- ipaddress = getFromDict(labcfg, ["labconfig","bridges",c,"ipaddress"])
+ ipaddress = getFromDict(labcfg, ["opnfv","spaces",c,"ipaddress"])
ethbrAdm = (ethbrAdm+'\n'
'auto eth'+str(y)+'\n'
' iface eth'+str(y)+' inet static\n'
@@ -137,7 +137,7 @@ while c < len(labcfg["labconfig"]["bridges"]):
c=c+1
# lets modify the maas general settings:
-value = get_ip_address(ethbrAdmin)
+value = get_ip_address(ethbrAdmin)
value = "qemu+ssh://"+getpass.getuser()+"@"+value+"/system"
opnfvcfg['demo-maas']['maas']['virsh']['uri']=value
opnfvcfg['demo-maas']['maas']['network_config']=ethbrAdm
@@ -145,21 +145,24 @@ opnfvcfg['demo-maas']['maas']['network_config']=ethbrAdm
if len(labcfg["labconfig"]["nodes"]) < 1:
print("looks like virtual deployment where nodes were not defined")
opnfvcfg["demo-maas"]["maas"]["nodes"].remove()
- exit()
+ exit()
#lets insert the node details here:
c=0
#
while c < len(labcfg["labconfig"]["nodes"]):
+ valuemac=[]
+ y = 0
# setup value of name and tags accordigly
- value = getFromDict(labcfg, ["labconfig","nodes",c, "type"])
- valuemac = getFromDict(labcfg, ["labconfig","nodes",c, "pxe_mac_address"])
+ noderoleslist = labcfg["labconfig"]["nodes"][c]["roles"]
+ noderoles = " ".join(noderoleslist)
+
valuetype = getFromDict(labcfg, ["labconfig","nodes",c, "power", "type"])
- namevalue = "node" + str(c+1) + "-" + value
- value = getFromDict(labcfg, ["labconfig","nodes",c, "architecture"])
+ namevalue = labcfg["labconfig"]["nodes"][c]["name"]
+ valuearc = getFromDict(labcfg, ["labconfig","nodes",c, "architecture"])
# setup value of architecture
- if value == "x86_64":
- value="amd64/generic"
+ if valuearc == "x86_64":
+ valuearc="amd64/generic"
if valuetype == "wakeonlan":
macvalue = getFromDict(labcfg, ["labconfig","nodes",c, "power", "mac_address"])
@@ -169,11 +172,23 @@ while c < len(labcfg["labconfig"]["nodes"]):
valueuser = getFromDict(labcfg, ["labconfig","nodes",c, "power", "user"])
valuepass = getFromDict(labcfg, ["labconfig","nodes",c, "power", "pass"])
valuedriver = "LAN_2_0"
- power={"type": valuetype, "address": valueaddr,"user": valueuser, "pass": valuepass, "driver": valuedriver}
+ power={"type": valuetype, "address": valueaddr,"user": valueuser,\
+ "pass": valuepass, "driver": valuedriver}
+
+ opnfvcfg["demo-maas"]["maas"]["nodes"].append({"name": namevalue, \
+ "architecture":valuearc,"interfaces":[],"mac_addresses":[],\
+ "power":power,'tags':noderoles})
+ y = 0
+ while y < len(labcfg["labconfig"]["nodes"][c]["nics"]):
+ valueifname = labcfg["labconfig"]["nodes"][c]["nics"][y]["ifname"]
+ valueifmac = labcfg["labconfig"]["nodes"][c]["nics"][y]["mac"][0]
+ valuemac += labcfg["labconfig"]["nodes"][c]["nics"][y]["mac"]
+ opnfvcfg["demo-maas"]["maas"]["nodes"][c]["interfaces"]\
+ .append({"name":valueifname,"mac_address":valueifmac,"mode": "auto"})
- opnfvcfg["demo-maas"]["maas"]["nodes"].append({"name": namevalue, "architecture":value,"mac_addresses":[],"power":power})
+ y=y+1
- if valuemac:
+ if valueifmac:
opnfvcfg["demo-maas"]["maas"]["nodes"][c]['mac_addresses']=valuemac
c=c+1