typo corrected. 11/34711/4
authorNarinder Gupta <narinder.gupta@canonical.com>
Sat, 13 May 2017 05:41:57 +0000 (00:41 -0500)
committerNarinder Gupta <narinder.gupta@canonical.com>
Sat, 13 May 2017 14:03:57 +0000 (09:03 -0500)
Change-Id: I1189a542d3975edc6ae3b6681f7dad31524dd4ca
Signed-off-by: Narinder Gupta <narinder.gupta@canonical.com>
ci/03-maasdeploy.sh
ci/deploy.sh
labconfig/huawei/pod12/labconfig.yaml
labconfig/intel/pod5/labconfig.yaml

index c66bf16..7aa5ef4 100755 (executable)
@@ -88,7 +88,6 @@ KEYRING_FILE=/usr/share/keyrings/ubuntu-cloudimage-keyring.gpg
 SOURCE_ID=1
 FABRIC_ID=1
 PRIMARY_RACK_CONTROLLER="$MAAS_IP"
-SUBNET_CIDR=`cat labconfig.json | jq '.opnfv.spaces[] | select(.type=="admin")'.cidr | cut -d \" -f 2 `
 VLAN_UNTTAGED="untagged"
 
 # In the case of a virtual deployment get deployconfig.yaml
@@ -328,7 +327,7 @@ addnodes(){
     # make sure there is no machine entry in maas
     for m in $(maas $PROFILE machines read | jq -r '.[].system_id')
     do
-        maas ubuntu machine delete $m
+        maas $PROFILE machine delete $m
     done
 
     # if we have a virshurl configuration we use it, else we use local
@@ -342,7 +341,7 @@ addnodes(){
 
     if [ "$virtinstall" -eq 1 ]; then
         netw=" --network bridge=virbr0,model=virtio"
-    elif [ $VIRSHHOST != "" ]; then
+    elif ([ $VIRSHHOST != "" ]); then
         # Get the bridge hosting the remote virsh
         brid=$(ssh $VIRSHHOST "ip a l | grep $VIRSHHOST | perl -pe 's/.* (.*)\$/\$1/g'")
         netw=" --network bridge=$brid,model=virtio"
@@ -556,15 +555,17 @@ if [ -e ./labconfig.json ]; then
                 # rename interface if needed
                 IF_MACLOWER=$( cat labconfig.json | jq ".lab.racks[0].nodes[$NODE_ID].nics[] | select(.ifname==\"$IF_NEWNAME\")".mac[0])
                 IF_MAC=(${IF_MACLOWER,,})
-                IF_ID=$( maas ubuntu interfaces read $NODE_SYS_ID | jq ".[] | select(.mac_address==$IF_MAC)".id)
-                maas $PROFILE interface update $NODE_SYS_ID $IF_ID name=$IF_NEWNAME
+                IF_ID=$( maas $PROFILE interfaces read $NODE_SYS_ID | jq ".[] | select(.mac_address==$IF_MAC)".id)
+                if ([ $IF_ID ] && [ "$IF_ID" != "null" ]); then
+                    maas $PROFILE interface update $NODE_SYS_ID $IF_ID name=$IF_NEWNAME
+                fi
             fi
             # Configure the interface
             if ([ $SUBNET_CIDR ] && [ "$SUBNET_CIDR" != "null" ]); then
                 VLANID=$(maas $PROFILE subnet read $SUBNET_CIDR | jq -r '.vlan.id')
                 if !([ $IF_VLAN ] && [ "$IF_VLAN" != "null" ]); then
                     # If this interface is not a VLAN (done withe create-vlan)
-                    maas $PROFILE interface update $NODE_SYS_ID $IF_NAME vlan=$VLANID
+                    maas $PROFILE interface update $NODE_SYS_ID $IF_NAME vlan=$VLANID || true
                 fi
                 maas $PROFILE interface link-subnet $NODE_SYS_ID $IF_NAME  mode=$IF_MODE subnet=$SUBNET_CIDR || true
                 sleep 2
index b0df68b..932a9f9 100755 (executable)
@@ -220,25 +220,27 @@ cnt_list=$(for cnt in $srv_list; do juju status $cnt --format=json | jq -r ".mac
 # get public network gateway (supposing it is the first ip of the network)
 public_api_gw=$(cat labconfig.json | jq --raw-output ".opnfv.spaces[] | select(.type==\"public\")".gateway)
 admin_gw=$(cat labconfig.json | jq --raw-output ".opnfv.spaces[] | select(.type==\"admin\")".gateway)
-# set default gateway to public api gateway
-for cnt in $cnt_list; do
-    echo "changing default gw on $cnt"
-    juju ssh $cnt "sudo ip r d default && sudo ip r a default via $public_api_gw";
-    juju ssh $cnt "gw_dev=\$(ip  r l | grep 'via $public_api_gw' | cut -d \  -f5) &&\
+
+if ([ $admin_gw ] && [ $admin_gw != "null" ])
+    # set default gateway to public api gateway
+    for cnt in $cnt_list; do
+        echo "changing default gw on $cnt"
+        juju ssh $cnt "sudo ip r d default && sudo ip r a default via $public_api_gw";
+        juju ssh $cnt "gw_dev=\$(ip  r l | grep 'via $public_api_gw' | cut -d \  -f5) &&\
                    sudo cp /etc/network/interfaces /etc/network/interfaces.bak &&\
                    echo 'removing old default gateway' &&\
                    sudo perl -i -pe 's/^\ *gateway $admin_gw\n$//' /etc/network/interfaces &&\
                    sudo perl -i -pe \"s/iface \$gw_dev inet static/iface \$gw_dev inet static\\n  gateway $public_api_gw/\" /etc/network/interfaces \
                    ";
-done
+    done
+fi
 
 echo "...... configure  ......."
 
-if [[ "$opnfvmodel" = "openstack" ]]; then
+if ([ $opnfvmodel == "openstack" ]); then
     ./openstack.sh "$opnfvsdn" "$opnfvlab" "$opnfvdistro" "$openstack" || true
 
     # creating heat domain after puching the public API into /etc/hosts
-
     if [[ "$jujuver" > "2" ]]; then
         status=`juju run-action heat/0 domain-setup`
         echo $status
@@ -247,12 +249,10 @@ if [[ "$opnfvmodel" = "openstack" ]]; then
         echo $status
     fi
 
-
     sudo ../juju/get-cloud-images || true
     ../juju/joid-configure-openstack || true
 
-fi
-if [[ "$opnfvmodel" = "kubernetes" ]]; then
+elif ([ $opnfvmodel == "kubernetes" ]); then
     ./k8.sh
 fi
 
index 1d3da94..fb9ebc5 100644 (file)
@@ -7,14 +7,14 @@ lab:
       architecture: x86_64
       roles: [network,control]
       nics:
-      - ifname: eth1
+      - ifname: intf0
         spaces: [admin]
         mac: ["88:cf:98:83:31:d8"]
-      - ifname: eth4
+      - ifname: intf1
         spaces: [data]
         mac: ["88:cf:98:e9:9a:99"]
-      - ifname: eth5
-        spaces: [public]
+      - ifname: intf2
+        spaces: [floating]
         mac: ["88:cf:98:e9:9a:9a"]
       power:
         type: ipmi
@@ -25,14 +25,14 @@ lab:
       architecture: x86_64
       roles: [compute,control,storage]
       nics:
-      - ifname: eth1
+      - ifname: intf0
         spaces: [admin]
         mac: ["88:cf:98:61:66:0b"]
-      - ifname: eth4
+      - ifname: intf1
         spaces: [data]
         mac: ["88:cf:98:e9:9a:c3"]
-      - ifname: eth5
-        spaces: [public]
+      - ifname: intf2
+        spaces: [floating]
         mac: ["88:cf:98:e9:9a:c4"]
       power:
         type: ipmi
@@ -43,14 +43,14 @@ lab:
       architecture: x86_64
       roles: [compute,control,storage]
       nics:
-      - ifname: eth1
+      - ifname: intf0
         spaces: [admin]
         mac: ["88:cf:98:61:66:d9"]
-      - ifname: eth4
+      - ifname: intf1
         spaces: [data]
         mac: ["88:cf:98:e9:9a:9b"]
-      - ifname: eth5
-        spaces: [public]
+      - ifname: intf2
+        spaces: [floating]
         mac: ["88:cf:98:e9:9a:9c"]
       power:
         type: ipmi
@@ -61,14 +61,14 @@ lab:
       architecture: x86_64
       roles: [compute,storage]
       nics:
-      - ifname: eth1
+      - ifname: intf0
         spaces: [admin]
         mac: ["88:cf:98:83:30:b4"]
-      - ifname: eth4
+      - ifname: intf1
         spaces: [data]
         mac: ["88:cf:98:e9:9a:9b"]
-      - ifname: eth5
-        spaces: [public]
+      - ifname: intf2
+        spaces: [floating]
         mac: ["88:cf:98:e9:9a:9c"]
       power:
         type: ipmi
@@ -79,14 +79,14 @@ lab:
       architecture: x86_64
       roles: [compute,storage]
       nics:
-      - ifname: eth1
+      - ifname: intf0
         spaces: [admin]
         mac: ["88:cf:98:83:31:db"]
-      - ifname: eth4
+      - ifname: intf1
         spaces: [data]
         mac: ["88:cf:98:e9:9a:a5"]
-      - ifname: eth5
-        spaces: [public]
+      - ifname: intf2
+        spaces: [floating]
         mac: ["88:cf:98:e9:9a:a6"]
       power:
         type: ipmi
@@ -119,12 +119,12 @@ opnfv:
     bridge: brData
     cidr: 10.6.12.0/24
     gateway:
-    vlan: 31
+    vlan:
   - type: floating
     bridge: brPublic
     cidr: 10.6.15.0/24
     gateway:
-    vlan: 31
+    vlan:
   - type: external
     bridge: brExt
     cidr: 192.168.30.0/24
index 48ff2ab..4264d4d 100644 (file)
@@ -142,7 +142,7 @@ lab:
 #        user: root
 #        pass: root
     floating-ip-range: 10.5.15.6,10.5.15.250,10.5.15.1,10.5.15.0/24
-    xt-port: "intf1.505"
+    ext-port: "intf1.505"
     dns: 8.8.8.8
     osdomainname:
 opnfv: