Merge "Add OpenStack Ocata runs for netvirt"
[releng/builder.git] / jjb / integration / include-raw-integration-deploy-openstack-run-test.sh
index c3e110fd5d5fdb15f559cfc5b68c339238723b61..a3a38778e844138469ffce1eb164b7aa7282c312 100644 (file)
@@ -370,6 +370,9 @@ set +e  # We do not want to create red dot just because something went wrong whi
 for i in `seq 1 ${NUM_ODL_SYSTEM}`
 do
     CONTROLLERIP=ODL_SYSTEM_${i}_IP
+    echo "Lets's take the karaf thread dump again..."
+    KARAF_PID=$(ssh ${!CONTROLLERIP} "ps aux | grep ${KARAF_ARTIFACT} | grep -v grep | tr -s ' ' | cut -f2 -d' '")
+    ssh ${!CONTROLLERIP} "jstack $KARAF_PID"> ${WORKSPACE}/karaf_${i}_threads_after.log || true
     echo "killing karaf process..."
     ${SSH} "${!CONTROLLERIP}" bash -c 'ps axf | grep karaf | grep -v grep | awk '"'"'{print "kill -9 " $1}'"'"' | sh'
 done
@@ -483,6 +486,13 @@ cd devstack
 git checkout $OPENSTACK_BRANCH
 EOF
 
+cat > "${WORKSPACE}/setup_host_cell_mapping.sh" << EOF
+sudo nova-manage cell_v2 map_cell0
+sudo nova-manage cell_v2 simple_cell_setup
+sudo nova-manage db sync
+sudo nova-manage cell_v2 discover_hosts
+EOF
+
 [ "$NUM_OPENSTACK_SITES" ] || NUM_OPENSTACK_SITES=1
 compute_index=1
 odl_index=1
@@ -636,6 +646,14 @@ do
         exit 1
     fi
 
+    # For Ocata, if we do not enable the n-cpu in control node
+    # We need to discover hosts manually and ensure that they are mapped to cells.
+    # reference: https://ask.openstack.org/en/question/102256/how-to-configure-placement-service-for-compute-node-on-ocata/
+    if [ "${OPENSTACK_BRANCH}" == "stable/ocata" ]; then
+        scp ${WORKSPACE}/setup_host_cell_mapping.sh  ${!CONTROLIP}:/tmp
+        ${SSH} ${!CONTROLIP} "sudo bash /tmp/setup_host_cell_mapping.sh"
+    fi
+
     # upgrading pip, urllib3 and httplib2 so that tempest tests can be run on openstack control node
     # this needs to happen after devstack runs because it seems devstack is pulling in specific versions
     # of these libs that are not working for tempest.