ymodfiied to include marks comment for labconfig for intel pod6. 51/14751/11
authorNarinder Gupta <narinder.gupta@canonical.com>
Thu, 26 May 2016 19:14:56 +0000 (14:14 -0500)
committerNarinder Gupta <narinder.gupta@canonical.com>
Fri, 27 May 2016 01:41:13 +0000 (20:41 -0500)
Change-Id: I2265e3063c786ad36c1fce0d139cee40b4a2875e
Signed-off-by: Narinder Gupta <narinder.gupta@canonical.com>
ci/02-maasdeploy.sh
ci/deploy.py
labconfig/intel/pod5/labconfig.yaml
labconfig/intel/pod6/labconfig.yaml

index f13e63f..ff00676 100755 (executable)
@@ -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
index 03c6027..72002e6 100644 (file)
@@ -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
index a2d1cad..5339949 100644 (file)
@@ -1,66 +1,78 @@
 labconfig:
     lab_location: intelpod5
-    bridges:
-        - type: admin
-          bridge: brAdm
-          cidr: 10.5.1.0/24
-          gateway: 10.5.1.1
-        - type: data
-          bridge: brData
-          cidr: 10.5.12.0/24
-          gateway:
-        - type: public
-          bridge: brPublic
-          cidr: 10.5.15.0/24
-          gateway: 10.5.15.254
-        - type: external
-          bridge: brExt
-          cidr:
-          gateway:
-          ipaddress: 10.2.117.92
     labsettings:
         upstream_dns: 8.8.8.8
     nodes:
-        - type: control
-          architecture: x86_64 
-          pxe_mac_address:
-              - "00:1e:67:cf:bb:54"
+        - name: rack-5-m1
+          architecture: x86_64
+          roles: [compute,network,storage]
+          nics:
+              - ifname: eth1
+                spaces: [admin]
+                mac: ["00:1E:67:CF:BB:54"]
+              - ifname: eth4
+                spaces: [data]
+                mac: ["90:E2:BA:85:4E:2C"]
           power:
               type: ipmi
               address: 10.2.117.81
               user: root
               pass: root
-        - type: control
-          architecture: x86_64 
-          pxe_mac_address:
-              - "00:1e:67:cf:b8:93"
+        - name: rack-5-m2
+          architecture: x86_64
+          roles: [compute,network,storage]
+          nics:
+              - ifname: eth1
+                spaces: [admin]
+                mac: ["00:1E:67:CF:B8:93"]
+              - ifname: eth4
+                spaces: [data]
+                mac: ["90:E2:BA:84:08:B8"]
           power:
               type: ipmi
               address: 10.2.117.82
               user: root
               pass: root
-        - type: control
-          architecture: x86_64 
-          pxe_mac_address:
-              - "00:1e:67:e0:08:7f"
+        - name: rack-5-m3
+          architecture: x86_64
+          roles: [compute,network,storage]
+          nics:
+              - ifname: eth1
+                spaces: [admin]
+                mac: ["00:1E:67:E0:08:7F"]
+              - ifname: eth4
+                spaces: [data]
+                mac: ["90:E2:BA:84:07:0D"]
           power:
               type: ipmi
               address: 10.2.117.83
               user: root
               pass: root
-        - type: compute
-          architecture: x86_64 
-          pxe_mac_address:
-              - "00:1e:67:e0:08:b1"
+        - name: rack-5-m4
+          architecture: x86_64
+          roles: [compute,network,storage]
+          nics:
+              - ifname: eth1
+                spaces: [admin]
+                mac: ["00:1E:67:E0:08:B1"]
+              - ifname: eth4
+                spaces: [data]
+                mac: ["90:E2:BA:83:FD:80"]
           power:
               type: ipmi
               address: 10.2.117.84
               user: root
               pass: root
-        - type: compute
-          architecture: x86_64 
-          pxe_mac_address:
-              - "00:1e:67:e0:0a:4b"
+        - name: rack-5-m5
+          architecture: x86_64
+          roles: [compute,network,storage]
+          nics:
+              - ifname: eth1
+                spaces: [admin]
+                mac: ["00:1E:67:E0:0A:4B"]
+              - ifname: eth4
+                spaces: [data]
+                mac: ["90:E2:BA:75:22:74"]
           power:
               type: ipmi
               address: 10.2.117.85
@@ -71,11 +83,33 @@ opnfv:
     distro: trusty
     type: nonha
     openstack: liberty
-    sdncontroller: 
-        - type: nosdn
-    storage: 
-        - type: ceph
-          disk: /srv/osd
-    floating-ip-range: 
-    feature: odl_l2 
+    sdncontroller:
+    - type: nosdn
+    storage:
+    - type: ceph
+      disk: /srv
+    floating-ip-range:
+    feature: odl_l2
     ext-port: eth5
+    spaces:
+    - type: admin
+      bridge: brAdm
+      cidr: 10.5.1.0/24
+      gateway: 10.5.1.1
+      vlan:
+    - type: data
+      bridge: brData
+      cidr: 10.5.12.0/24
+      gateway:
+      vlan:
+    - type: public
+      bridge: brPublic
+      cidr: 10.5.15.0/24
+      gateway: 10.5.15.254
+      vlan:
+    - type: external
+      bridge: brExt
+      cidr:
+      gateway:
+      ipaddress: 10.2.117.86
+      vlan:
index a1cdd73..6a9f8c5 100644 (file)
@@ -1,66 +1,78 @@
 labconfig:
     lab_location: intelpod6
-    bridges:
-        - type: admin
-          bridge: brAdm
-          cidr: 10.6.1.0/24
-          gateway: 10.6.1.1
-        - type: data
-          bridge: brData
-          cidr: 10.6.12.0/24
-          gateway:
-        - type: public
-          bridge: brPublic
-          cidr: 10.6.15.0/24
-          gateway: 10.6.15.254
-        - type: external
-          bridge: brExt
-          cidr:
-          gateway:
-          ipaddress: 10.2.117.107
     labsettings:
         upstream_dns: 8.8.8.8
     nodes:
-        - type: control
-          architecture: x86_64 
-          pxe_mac_address:
-              - "00:1e:67:d8:ba:46"
+        - name: rack-6-m1
+          architecture: x86_64
+          roles: [compute,network,storage]
+          nics:
+              - ifname: eth1
+                spaces: [admin]
+                mac: ["00:1e:67:d8:ba:46"]
+              - ifname: eth4
+                spaces: [data]
+                mac: ["90:E2:BA:83:FD:20"]
           power:
               type: ipmi
               address: 10.2.117.96
               user: root
               pass: root
-        - type: control
-          architecture: x86_64 
-          pxe_mac_address:
-              - "00:1e:67:e0:0b:72"
+        - name: rack-6-m2
+          architecture: x86_64
+          roles: [compute,network,storage]
+          nics:
+              - ifname: eth1
+                spaces: [admin]
+                mac: ["00:1e:67:e0:0b:72"]
+              - ifname: eth4
+                spaces: [data]
+                mac: ["90:E2:BA:75:30:F4"]
           power:
               type: ipmi
               address: 10.2.117.97
               user: root
               pass: root
-        - type: control
-          architecture: x86_64 
-          pxe_mac_address:
-              - "00:1e:67:e0:09:33"
+        - name: rack-6-m3
+          architecture: x86_64
+          roles: [compute,network,storage]
+          nics:
+              - ifname: eth1
+                spaces: [admin]
+                mac: ["00:1e:67:e0:09:33"]
+              - ifname: eth4
+                spaces: [data]
+                mac: ["90:E2:BA:83:FE:74"]
           power:
               type: ipmi
               address: 10.2.117.98
               user: root
               pass: root
-        - type: compute
-          architecture: x86_64 
-          pxe_mac_address:
-              - "00:1e:67:e0:09:fb"
+        - name: rack-6-m4
+          architecture: x86_64
+          roles: [compute,network,storage]
+          nics:
+              - ifname: eth1
+                spaces: [admin]
+                mac: ["00:1e:67:e0:09:fb"]
+              - ifname: eth4
+                spaces: [data]
+                mac: ["90:E2:BA:84:15:7C"]
           power:
               type: ipmi
               address: 10.2.117.99
               user: root
               pass: root
-        - type: compute
-          architecture: x86_64 
-          pxe_mac_address:
-              - "00:1e:67:cf:bc:f8"
+        - name: rack-6-m5
+          architecture: x86_64
+          roles: [compute,network,storage]
+          nics:
+              - ifname: eth1
+                spaces: [admin]
+                mac: ["00:1e:67:cf:bc:f8"]
+              - ifname: eth4
+                spaces: [data]
+                mac: ["90:E2:BA:84:08:F4"]
           power:
               type: ipmi
               address: 10.2.117.100
@@ -71,11 +83,33 @@ opnfv:
     distro: trusty
     type: nonha
     openstack: liberty
-    sdncontroller: 
-        - type: nosdn
-    storage: 
-        - type: ceph
-          disk: sda,sdb
-    floating-ip-range: 
-    feature: odl_l2 
+    sdncontroller:
+    - type: nosdn
+    storage:
+    - type: ceph
+      disk: /srv
+    floating-ip-range:
+    feature: odl_l2
     ext-port: eth5
+    spaces:
+    - type: admin
+      bridge: brAdm
+      cidr: 10.6.1.0/24
+      gateway: 10.6.1.1
+      vlan:
+    - type: data
+      bridge: brData
+      cidr: 10.6.12.0/24
+      gateway:
+      vlan:
+    - type: public
+      bridge: brPublic
+      cidr: 10.6.15.0/24
+      gateway: 10.6.15.254
+      vlan:
+    - type: external
+      bridge: brExt
+      cidr:
+      gateway:
+      ipaddress: 10.2.117.107
+      vlan: