Merge "fix cpu model for aarch64 kvm"
authorNarinder Gupta <narinder.gupta@canonical.com>
Thu, 17 Aug 2017 14:08:47 +0000 (14:08 +0000)
committerGerrit Code Review <gerrit@opnfv.org>
Thu, 17 Aug 2017 14:08:47 +0000 (14:08 +0000)
17 files changed:
ci/02-deploybundle.sh
ci/03-maasdeploy.sh
ci/config_tpl/juju2/bundle_tpl/ceilometer.yaml
ci/config_tpl/juju2/bundle_tpl/ceph.yaml
ci/config_tpl/juju2/bundle_tpl/cinder.yaml
ci/config_tpl/juju2/bundle_tpl/glance.yaml
ci/config_tpl/juju2/bundle_tpl/oclphase1.yaml
ci/config_tpl/juju2/bundle_tpl/openstack-dashboard.yaml
ci/config_tpl/juju2/bundle_tpl/spaces.yaml
ci/config_tpl/juju2/bundlek8_tpl/bundle.yaml
ci/config_tpl/juju2/bundlek8_tpl/easyrsa.yaml
ci/config_tpl/juju2/bundlek8_tpl/etcd.yaml
ci/config_tpl/juju2/bundlek8_tpl/flannel.yaml
ci/config_tpl/juju2/bundlek8_tpl/kubernetes.yaml
ci/config_tpl/juju2/bundlek8_tpl/ovn.yaml
ci/config_tpl/juju2/bundlek8_tpl/spaces.yaml [new file with mode: 0644]
ci/deploy.sh

index 1bb0084..0d4166e 100755 (executable)
@@ -151,25 +151,13 @@ fi
 #keep the back in cloud for later debugging.
 pastebinit bundles.yaml || true
 
-if [[ "$jujuver" < "2" ]]; then
-    echo "... Deployment Started ...."
-    juju-deployer -vW -d -t 7200 -r 5 -c bundles.yaml $opnfvdistro-"$openstack"-nodes
-    count=`juju status nodes --format=short | grep nodes | wc -l`
-    c=0
-    while [ $c -lt $count ]; do
-        juju ssh nodes/$c 'echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p' || true
-        juju ssh nodes-compute/$c 'echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p' || true
-        juju ssh nodes/$c 'echo 2048 | sudo tee /proc/sys/fs/inotify/max_user_instances' || true
-        juju ssh nodes-compute/$c 'echo 2048 | sudo tee /proc/sys/fs/inotify/max_user_instances' || true
-        let c+=1
-    done
+# with JUJU 2.0 bundles has to be deployed only once.
+juju deploy bundles.yaml --debug
+sleep 120
+check_status allocating
 
-    juju-deployer -vW -d -t 7200 -r 5 -c bundles.yaml $opnfvdistro-"$openstack" || true
-else
-    # with JUJU 2.0 bundles has to be deployed only once.
-    juju deploy bundles.yaml --debug
-    sleep 120
-    check_status allocating
+# need to revisit later if not needed we will remove the below.
+openfile_fix() {
     # seeing issue related to number of open files.
     count=`juju status nodes --format=short | grep nodes | wc -l`
     c=0
@@ -180,7 +168,7 @@ else
         juju ssh nodes-compute/$c 'echo 2048 | sudo tee /proc/sys/fs/inotify/max_user_instances' || true
         let c+=1
     done
-fi
+}
 
 if [ "$opnfvsdn" = "ocl" ]
 then
index dcf4b46..d74214b 100755 (executable)
@@ -255,9 +255,9 @@ configuremaas(){
 
     #create the required spaces.
     maas $PROFILE space update 0 name=default || true
-    for space in unused admin-api internal-api public-api \
+    for space in admin-api internal-api public-api \
                  storage-access storage-cluster admin \
-                 tenant-data tenant-api tenant-public oam-space
+                 tenant-data tenant-api tenant-public  os-api
     do
         echo_info "Creating the space $space"
         maas $PROFILE spaces create name=$space || true
@@ -281,7 +281,7 @@ configuremaas(){
 setupspacenetwork(){
 
     #get space, subnet and vlan and create accordingly.
-    #for type in pxe admin data storage external floating public; do
+    #for type in admin osapi data storage external floating public; do
     nettypes=`cat labconfig.json | jq '.opnfv.spaces[]'.type | cut -d \" -f 2`
     for type in $nettypes; do
         config_done=0
@@ -335,13 +335,13 @@ setupspacenetwork(){
             fi
         fi
         case "$type" in
-            'pxe')             JUJU_SPACE="oam-space";     DHCP='enabled' ;;
             'admin')           JUJU_SPACE="internal-api";  DHCP='enabled' ;;
             'data')            JUJU_SPACE="tenant-data";   DHCP='' ;;
             'public')          JUJU_SPACE="public-api";    DHCP='' ;;
             'storage')         JUJU_SPACE="storage-cluster";   DHCP='' ;;
             'storageaccess')   JUJU_SPACE="storage-data";  DHCP='' ;;
             'floating')        JUJU_SPACE="tenant-public"; DHCP='' ;;
+            'osapi')           JUJU_SPACE="os-api";        DHCP='' ;;
             *)                 JUJU_SPACE='default';       DHCP='OFF'; echo_info "      >>> Unknown SPACE" ;;
         esac
         JUJU_SPACE_ID=$(maas $PROFILE spaces read | jq -r ".[] |  select(.name==\"$JUJU_SPACE\")".id)
@@ -352,7 +352,7 @@ setupspacenetwork(){
                 maas $PROFILE vlan update $NET_FABRIC_ID $JUJU_VLAN_VID space=$JUJU_SPACE_ID
             fi
         fi
-        if ([ $type == "admin" ] || [ $type == "pxe" ]); then
+        if ([ $type == "admin" ]); then
             # If we have a network, we create it
             if ([ $NET_FABRIC_ID ]); then
                 # Set ranges
@@ -409,10 +409,9 @@ addnodes(){
 
         brid=`brctl show | grep 8000 | cut -d "8" -f 1 |  tr "\n" " " | tr "    " " " | tr -s " "`
         ADMIN_BR=`cat labconfig.json | jq '.opnfv.spaces[] | select(.type=="admin")'.bridge | cut -d \" -f 2 `
-        PXE_BR=`cat labconfig.json | jq '.opnfv.spaces[] | select(.type=="admin")'.bridge | cut -d \" -f 2 `
 
         for feature in $brid; do
-            if ([ "$feature" == "$ADMIN_BR" ] || [ "$feature" == "$PXE_BR" ]); then
+            if ([ "$feature" == "$ADMIN_BR" ]); then
                 netw=$netw" --network bridge="$feature",model=virtio"
             else
                 netw=$netw
@@ -489,8 +488,6 @@ addnodes(){
             units=$(($units - 1));
             NODE_NAME=`cat labconfig.json | jq ".lab.racks[].nodes[$units].name" | cut -d \" -f 2 `
             MAC_ADDRESS=`cat labconfig.json | jq ".lab.racks[].nodes[$units].nics[] | select(.spaces[]==\"admin\").mac"[0] | cut -d \" -f 2 `
-            MAC_ADDRESS_PXE=`cat labconfig.json | jq ".lab.racks[].nodes[$units].nics[] | select(.spaces[]==\"pxe\").mac"[0] | cut -d \" -f 2 `
-            #MAC_ADDRESS1=`cat labconfig.json | jq ".lab.racks[].nodes[$units].nics[] | select(.spaces[]==\"floating\").mac"[0] | cut -d \" -f 2 `
             POWER_TYPE=`cat labconfig.json | jq ".lab.racks[].nodes[$units].power.type" | cut -d \" -f 2 `
             POWER_IP=`cat labconfig.json |  jq ".lab.racks[].nodes[$units].power.address" | cut -d \" -f 2 `
             POWER_USER=`cat labconfig.json |  jq ".lab.racks[].nodes[$units].power.user" | cut -d \" -f 2 `
@@ -508,17 +505,10 @@ addnodes(){
             NODE_ARC="$NODE_ARCHES/generic"
 
             echo_info "Creating node $NODE_NAME"
-            if ([ $MAC_ADDRESS_PXE ] && ["$MAC_ADDRESS_PXE" != "null" ]); then
-                maas $PROFILE machines create autodetect_nodegroup='yes' name=$NODE_NAME \
-                    hostname=$NODE_NAME power_type=$POWER_TYPE power_parameters_power_address=$POWER_IP \
-                    power_parameters_power_user=$POWER_USER power_parameters_power_pass=$POWER_PASS \
-                    mac_addresses=$MAC_ADDRESS_PXE architecture=$NODE_ARC
-            else
-                maas $PROFILE machines create autodetect_nodegroup='yes' name=$NODE_NAME \
-                    hostname=$NODE_NAME power_type=$POWER_TYPE power_parameters_power_address=$POWER_IP \
-                    power_parameters_power_user=$POWER_USER power_parameters_power_pass=$POWER_PASS \
-                    mac_addresses=$MAC_ADDRESS architecture=$NODE_ARC
-            fi
+            maas $PROFILE machines create autodetect_nodegroup='yes' name=$NODE_NAME \
+                hostname=$NODE_NAME power_type=$POWER_TYPE power_parameters_power_address=$POWER_IP \
+                power_parameters_power_user=$POWER_USER power_parameters_power_pass=$POWER_PASS \
+                mac_addresses=$MAC_ADDRESS architecture=$NODE_ARC
         done
     fi
 
index b34bec2..de6a121 100644 (file)
@@ -1,6 +1,7 @@
     mongodb:
       charm: ./{{ ubuntu.release }}/mongodb
       num_units: 1
+      constraints: *oam-space-constr
 {% if os.service.bindings %}
       bindings:
         "": *internal-space
index 87591a4..cdbe486 100644 (file)
@@ -28,8 +28,8 @@
 {% endfor %}
 {% else %}
         - "lxd:nodes/0"
-        - "lxd:nodes/1"
-        - "lxd:nodes/2"
+        - "lxd:nodes/0"
+        - "lxd:nodes/0"
 {% endif %}
 {% endif %}
     ceph-osd:
@@ -83,6 +83,7 @@
       charm: "./{{ ubuntu.release }}/ceph-radosgw"
       num_units: {{ unit_qty() if os.beta.hacluster_ceph_radosgw else 1 }}
 {% if os.service.bindings %}
+      constraints: *ceph-access-constr
       bindings:
         "": *oam-space
         public: *public-space
index 027fc04..0313f07 100644 (file)
@@ -6,6 +6,7 @@
       num_units: {{ unit_qty() }}
 {% endif %}
 {% if os.service.bindings %}
+      constraints: *ceph-access-constr
       bindings:
         "": *oam-space
         public: *public-space
index 198cefb..725c436 100644 (file)
@@ -2,6 +2,7 @@
       charm: "./{{ ubuntu.release }}/glance"
       num_units: {{ unit_qty() }}
 {% if os.service.bindings %}
+      constraints: *ceph-access-constr
       bindings:
         "": *oam-space
         public: *public-space
index 588eeb2..e27b0d4 100644 (file)
       charm: ./{{ ubuntu.release }}/contrail-keystone-auth
       num_units: 1
       bindings:
-        "": internal-api
+        "": *oam-space
       to:
         - "lxd:nodes/0"
 
index 5e240e2..9132096 100644 (file)
@@ -2,6 +2,7 @@
       charm: "./{{ ubuntu.release }}/openstack-dashboard"
       num_units: {{ unit_qty() }}
 {% if os.service.bindings %}
+      constraints: *oam-space-constr
       bindings:
         "": *public-space
         shared-db: *internal-space
index 63f624f..3023dfc 100644 (file)
@@ -1,34 +1,35 @@
-
-
 {% if os.release == 'mitaka' %}
     openstack-origin:    &openstack-origin    distro
 {% else %}
     openstack-origin:    &openstack-origin    cloud:{{ ubuntu.release }}-{{ os.release }}
 {% endif %}
-
     openstack-region:    &openstack-region    {{ os.region }}
     worker-multiplier:   &worker-multiplier   {{ os.api.worker_multiplier }}
     data-port:           &data-port           br-data:{{ opnfv.ext_port }}
 
     # OAM - Operations, Administration and Maintenance
-{% if opnfv.spaces_dict.pxe is defined %}
-    oam-space:           &oam-space           oam-space
-{% else %}
     oam-space:           &oam-space           internal-api
-{% endif %}
 
+    # This is OpenStack Internal network; for internalURL endpoints
     # This is OpenStack Admin network; for adminURL endpoints
+{% if opnfv.spaces_dict.osapi is defined %}
+    internal-space:      &internal-space      os-api
+    admin-space:         &admin-space         os-api
+{% else %}
+    internal-space:      &internal-space      internal-api
     admin-space:         &admin-space         internal-api
+{% endif %}
 
     # This is OpenStack Public network; for publicURL endpoints
 {% if opnfv.spaces_dict.public is defined %}
     public-space:        &public-space        public-api
+{% else %}
+{% if opnfv.spaces_dict.osapi is defined %}
+    public-space:        &public-space        os-api
 {% else %}
     public-space:        &public-space        internal-api
 {% endif %}
-
-    # This is OpenStack Internal network; for internalURL endpoints
-    internal-space:      &internal-space      internal-api
+{% endif %}
 
     # This is the overlay network
 {% if opnfv.spaces_dict.data is defined %}
 
     # CEPH configuration
     # CEPH access network
-    ceph-public-space:   &ceph-public-space   internal-api
+{% if opnfv.spaces_dict.storageaccess is defined %}
+    ceph-public-space:   &ceph-public-space  storage-access-space
+    ceph-access-constr:  &ceph-access-constr  spaces=storage-access-space
+{% else %}
+    ceph-public-space:   &ceph-public-space  internal-api
+    ceph-access-constr:  &ceph-access-constr  spaces=internal-api
+{% endif %}
 
     # CEPH replication network
 {% if opnfv.spaces_dict.storage is defined %}
@@ -49,8 +56,7 @@
 {% endif %}
 
     # Workaround for 'only one default binding supported'
-    oam-space-constr:    &oam-space-constr    spaces=oam-space
-    ceph-access-constr:  &ceph-access-constr  spaces=ceph-access-space
+    oam-space-constr:    &oam-space-constr    spaces=internal-api
 
     # CEPH OSD and journal devices; temporary workaround for #1674148
 {% if os.lxd %}
index 96a27cf..b4ed14a 100644 (file)
@@ -6,6 +6,8 @@
 # deployment before moving to production.
 #
   series: {{ ubuntu.release }}
+  variables:
+{% include 'spaces.yaml' %}
   services:
     nodes:
       charm: "cs:{{ ubuntu.release }}/ubuntu"
index ea46e42..87802a0 100644 (file)
@@ -3,7 +3,7 @@
       num_units: 1
 {% if os.service.bindings %}
       bindings:
-        "": internal-api
+        "": *oam-space
 {% endif %}
       to:
 {% if k8.network.controller == 'ovn' %}
index d902adf..0908e3a 100644 (file)
@@ -11,7 +11,7 @@
 {% endif %}
 {% if os.service.bindings %}
       bindings:
-        "": internal-api
+        "": *oam-space
 {% endif %}
       to:
 {% if k8.network.controller == 'ovn' %}
index 561e088..79b89c7 100644 (file)
@@ -3,5 +3,5 @@
       charm: cs:~containers/flannel
 {% if os.service.bindings %}
       bindings:
-        "": internal-api
-{% endif %}
\ No newline at end of file
+        "": *oam-space
+{% endif %}
index 933c1ef..645ab15 100644 (file)
@@ -4,7 +4,7 @@
       expose: true
 {% if os.service.bindings %}
       bindings:
-        "": internal-api
+        "": *oam-space
 {% endif %}
 {% if k8.network.controller == 'ovn' %}
       options:
@@ -23,7 +23,7 @@
       expose: true
 {% if os.service.bindings %}
       bindings:
-        "": internal-api
+        "": *oam-space
 {% endif %}
 {% if k8.network.controller == 'ovn' %}
       options:
index 978c07c..98def5a 100644 (file)
@@ -3,7 +3,8 @@
       charm: "cs:~aakashkt/ovn-15"
 {% if os.service.bindings %}
       bindings:
-        "": internal-api
+        "": *oam-space
 {% endif %}
       options:
-        gateway-physical-interface: "none"
\ No newline at end of file
+        gateway-physical-interface: "none"
+
diff --git a/ci/config_tpl/juju2/bundlek8_tpl/spaces.yaml b/ci/config_tpl/juju2/bundlek8_tpl/spaces.yaml
new file mode 100644 (file)
index 0000000..17dbd7d
--- /dev/null
@@ -0,0 +1,5 @@
+
+
+    # OAM - Operations, Administration and Maintenance
+    oam-space:           &oam-space           internal-api
+
index f9c1b2d..b013b33 100755 (executable)
@@ -228,29 +228,32 @@ echo_info "Configuring public access"
 
 # translate bundle.yaml to json
 python -c 'import sys, yaml, json; json.dump(yaml.load(sys.stdin), sys.stdout, indent=4)' < bundles.yaml > bundles.json
-# get services list having a public interface
-srv_list=$(cat bundles.json | jq -r ".services | to_entries[] | {\"key\": .key, \"value\": .value[\"bindings\"]} | select (.value!=null) | select(.value[] | contains(\"public-api\"))".key)
-# get cnt list from service list
-cnt_list=$(for cnt in $srv_list; do juju status $cnt --format=json | jq -r ".machines[].containers | to_entries[]".key; done)
-# 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)
-
-if ([ $admin_gw ] && [ $admin_gw != "null" ]); then
-    # set default gateway to public api gateway
-    for cnt in $cnt_list; do
-        echo_info "Changing default gateway on $cnt"
-        if ([ $public_api_gw ] && [ $public_api_gw != "null" ]); then
-            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) &&\
+
+public_service() {
+    # get services list having a public interface
+    srv_list=$(cat bundles.json | jq -r ".services | to_entries[] | {\"key\": .key, \"value\": .value[\"bindings\"]} | select (.value!=null) | select(.value[] | contains(\"public-api\"))".key)
+    # get cnt list from service list
+    cnt_list=$(for cnt in $srv_list; do juju status $cnt --format=json | jq -r ".machines[].containers | to_entries[]".key; done)
+    # 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)
+
+    if ([ $admin_gw ] && [ $admin_gw != "null" ]); then
+        # set default gateway to public api gateway
+        for cnt in $cnt_list; do
+            echo_info "Changing default gateway on $cnt"
+            if ([ $public_api_gw ] && [ $public_api_gw != "null" ]); then
+                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 \
                    ";
-        fi
-    done
-fi
+            fi
+        done
+    fi
+}
 
 # Configuring deployment
 if ([ $opnfvmodel == "openstack" ]); then