X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Fintegration%2Fintegration-deploy-openstack-run-test.sh;h=275e6c9c4a2613e88917aa4daafb5b694ca97e85;hb=0b6cc391caff97b2b5300406c4b904c3880bc2d4;hp=fce6e617deba6e87ca8f54eed3ef09b2446191fc;hpb=bf71b1a09ea3908eb0874a5369df8806974d444c;p=releng%2Fbuilder.git diff --git a/jjb/integration/integration-deploy-openstack-run-test.sh b/jjb/integration/integration-deploy-openstack-run-test.sh index fce6e617d..275e6c9c4 100644 --- a/jjb/integration/integration-deploy-openstack-run-test.sh +++ b/jjb/integration/integration-deploy-openstack-run-test.sh @@ -4,22 +4,26 @@ # script. # shellcheck source=${ROBOT_VENV}/bin/activate disable=SC1091 source ${ROBOT_VENV}/bin/activate +source /tmp/common-functions.sh ${BUNDLEFOLDER} + PYTHON="${ROBOT_VENV}/bin/python" SSH="ssh -t -t" ADMIN_PASSWORD="admin" OPENSTACK_MASTER_CLIENTS_VERSION="queens" # TODO: remove this work to run changes.py if/when it's moved higher up to be visible at the Robot level -echo "\nshowing recent changes that made it into the distribution used by this job:" +printf "\nshowing recent changes that made it into the distribution used by this job:\n" $PYTHON -m pip install --upgrade urllib3 python ${WORKSPACE}/test/tools/distchanges/changes.py -d /tmp/distribution_folder \ -u ${ACTUAL_BUNDLE_URL} -b ${DISTROBRANCH} \ -r ssh://jenkins-${SILO}@git.opendaylight.org:29418 || true -echo "\nshowing recent changes that made it into integration/test used by this job:" +printf "\nshowing recent changes that made it into integration/test used by this job:\n" cd ${WORKSPACE}/test -git --no-pager log --pretty=format:'%h %<(13)%ar%<(13)%cr %<(20,trunc)%an%d %s' -n10 -echo +printf "Hash Author Date Commit Date Author Subject\n" +printf "%s\n" "------- ------------------------------ ------------------------------ -------------------- -----------------------------" +git --no-pager log --pretty=format:'%h %<(30)%ad %<(30)%cd %<(20,trunc)%an%d %s' -n20 +printf "\n" cd - cat << EOF @@ -36,7 +40,6 @@ function trap_handler() { local lasterr="$2" echo "trap_hanlder: ${prog}: line ${lastline}: exit status of last command: ${lasterr}" echo "trap_handler: command: ${BASH_COMMAND}" - collect_logs exit 1 } # trap_handler() @@ -74,6 +77,7 @@ ENABLE_OS_PLUGINS: ${ENABLE_OS_PLUGINS} DISABLE_OS_SERVICES: ${DISABLE_OS_SERVICES} TENANT_NETWORK_TYPE: ${TENANT_NETWORK_TYPE} SECURITY_GROUP_MODE: ${SECURITY_GROUP_MODE} +ENABLE_ITM_DIRECT_TUNNELS: ${ENABLE_ITM_DIRECT_TUNNELS} PUBLIC_PHYSICAL_NETWORK: ${PUBLIC_PHYSICAL_NETWORK} ENABLE_NETWORKING_L2GW: ${ENABLE_NETWORKING_L2GW} CREATE_INITIAL_NETWORKS: ${CREATE_INITIAL_NETWORKS} @@ -112,7 +116,9 @@ function create_etc_hosts() { # openstack release function install_openstack_clients_in_robot_vm() { packages=("python-novaclient" "python-neutronclient" "python-openstackclient") - for plugin_name in ${ENABLE_OS_PLUGINS}; do + local os_plugins + os_plugins=$(csv2ssv "${ENABLE_OS_PLUGINS}") + for plugin_name in $os_plugins; do if [ "$plugin_name" == "networking-sfc" ]; then packages+=("networking-sfc") fi @@ -137,18 +143,6 @@ function install_openstack_clients_in_robot_vm() { fi } - - -# convert commas in csv strings to spaces (ssv) -function csv2ssv() { - local csv=$1 - if [ -n "${csv}" ]; then - ssv=$(echo ${csv} | sed 's/,/ /g' | sed 's/\ \ */\ /g') - fi - - echo "${ssv}" -} # csv2ssv - function is_openstack_feature_enabled() { local feature=$1 for enabled_feature in $(csv2ssv ${ENABLE_OS_SERVICES}) @@ -161,17 +155,76 @@ function is_openstack_feature_enabled() { echo 0 } -function fix_libvirt_version_n_cpu_ocata() { +function fix_libvirt_version_n_cpu_pike() { local ip=$1 ${SSH} ${ip} " cd /opt/stack; git clone https://git.openstack.org/openstack/requirements; cd requirements; - git checkout stable/ocata; - sed -i s/libvirt-python===2.5.0/libvirt-python===3.2.0/ upper-constraints.txt + git checkout stable/pike; + sed -i s/libvirt-python===3.5.0/libvirt-python===4.2.0/ upper-constraints.txt " } +#Function to install rdo release +# This will help avoiding installing wrong version of packages which causes +# functionality failures +function install_rdo_release() { + local ip=$1 + case ${OPENSTACK_BRANCH} in + *pike*) + ${SSH} ${ip} "sudo yum install -y https://repos.fedorapeople.org/repos/openstack/openstack-pike/rdo-release-pike-1.noarch.rpm" + ;; + + *queens*) + ${SSH} ${ip} "sudo yum install -y https://repos.fedorapeople.org/repos/openstack/openstack-queens/rdo-release-queens-1.noarch.rpm" + ;; + + master) + ${SSH} ${ip} "sudo yum install -y https://repos.fedorapeople.org/repos/openstack/openstack-queens/rdo-release-queens-1.noarch.rpm" + ;; + esac +} + +# Involves just setting up the shared directory +function setup_live_migration_control() { + local control_ip=$1 + printf "${control_ip}:Setup directory Share with NFS" + cat > ${WORKSPACE}/setup_live_migration_control.sh << EOF +sudo mkdir --mode=777 /vm_instances +sudo chown -R jenkins:jenkins /vm_instances +sudo yum install -y nfs-utils +printf "/vm_instances *(rw,no_root_squash)" | sudo tee -a /etc/exports +sudo systemctl start rpcbind nfs-server +sudo exportfs +EOF + scp ${WORKSPACE}/setup_live_migration_control.sh ${control_ip}:/tmp/setup_live_migration_control.sh + ssh ${control_ip} "bash /tmp/setup_live_migration_control.sh" +} + +# Involves mounting the share and configuring the libvirtd +function setup_live_migration_compute() { + local compute_ip=$1 + local control_ip=$2 + printf "${compute_ip}:Mount Shared directory from ${control_ip}" + printf "${compute_ip}:Configure libvirt in listen mode" + cat > ${WORKSPACE}/setup_live_migration_compute.sh << EOF +sudo yum install -y libvirt libvirt-devel nfs-utils +sudo crudini --verbose --set --inplace /etc/libvirt/libvirtd.conf '' listen_tls 0 +sudo crudini --verbose --set --inplace /etc/libvirt/libvirtd.conf '' listen_tcp 1 +sudo crudini --verbose --set --inplace /etc/libvirt/libvirtd.conf '' auth_tcp '"none"' +sudo crudini --verbose --set --inplace /etc/sysconfig/libvirtd '' LIBVIRTD_ARGS '"--listen"' +sudo mkdir --mode=777 -p /var/instances +sudo chown -R jenkins:jenkins /var/instances +sudo chmod o+x /var/instances +sudo systemctl start rpcbind +sudo mount -t nfs ${control_ip}:/vm_instances /var/instances +sudo mount +EOF + scp ${WORKSPACE}/setup_live_migration_compute.sh ${compute_ip}:/tmp/setup_live_migration_compute.sh + ssh ${compute_ip} "bash /tmp/setup_live_migration_compute.sh" +} + # Add enable_services and disable_services to the local.conf function add_os_services() { local core_services=$1 @@ -209,10 +262,11 @@ function create_control_node_local_conf() { cat > ${local_conf_file_name} << EOF [[local|localrc]] LOGFILE=stack.sh.log -USE_SCREEN=True -SCREEN_LOGDIR=/opt/stack/data/log LOG_COLOR=False +USE_SYSTEMD=True RECLONE=${RECLONE} +# Increase the wait used by stack to poll for services +SERVICE_TIMEOUT=120 disable_all_services EOF @@ -258,7 +312,6 @@ EOF if [ "${ODL_ML2_DRIVER_VERSION}" == "v2" ]; then echo "ODL_V2DRIVER=True" >> ${local_conf_file_name} fi - IFS=, for plugin_name in ${ENABLE_OS_PLUGINS}; do if [ "$plugin_name" == "networking-odl" ]; then @@ -269,7 +322,8 @@ EOF ENABLE_PLUGIN_ARGS="${DEVSTACK_LBAAS_PLUGIN_REPO} ${OPENSTACK_BRANCH}" IS_LBAAS_PLUGIN_ENABLED="yes" elif [ "$plugin_name" == "networking-sfc" ]; then - ENABLE_PLUGIN_ARGS="${DEVSTACK_NETWORKING_SFC_PLUGIN_REPO} ${OPENSTACK_BRANCH}" + ENABLE_PLUGIN_ARGS="${DEVSTACK_NETWORKING_SFC_PLUGIN_REPO} master" + IS_SFC_PLUGIN_ENABLED="yes" else echo "Error: Invalid plugin $plugin_name, unsupported" continue @@ -309,6 +363,9 @@ EOF if [ "${IS_LBAAS_PLUGIN_ENABLED}" == "yes" ]; then SERVICE_PLUGINS+=", lbaasv2" fi + if [ "${IS_SFC_PLUGIN_ENABLED}" == "yes" ]; then + SERVICE_PLUGINS+=", networking_sfc.services.flowclassifier.plugin.FlowClassifierPlugin,networking_sfc.services.sfc.plugin.SfcPlugin" + fi fi #check for ODL_ENABLE_L3_FWD cat >> ${local_conf_file_name} << EOF @@ -316,6 +373,7 @@ EOF [[post-config|\$NEUTRON_CONF]] [DEFAULT] service_plugins = ${SERVICE_PLUGINS} +log_dir = /opt/stack/logs [[post-config|/etc/neutron/plugins/ml2/ml2_conf.ini]] [agent] @@ -327,15 +385,21 @@ minimize_polling=True physical_network_mtus = ${PUBLIC_PHYSICAL_NETWORK}:1400 path_mtu = 1458 +[ml2_odl] +# Trigger n-odl full sync every 30 secs. +maintenance_interval = 30 + [[post-config|/etc/neutron/dhcp_agent.ini]] [DEFAULT] force_metadata = True enable_isolated_metadata = True +log_dir = /opt/stack/logs [[post-config|/etc/nova/nova.conf]] [DEFAULT] force_config_drive = False force_raw_images = False +log_dir = /opt/stack/logs [scheduler] discover_hosts_in_cells_interval = 30 @@ -356,9 +420,10 @@ function create_compute_node_local_conf() { [[local|localrc]] LOGFILE=stack.sh.log LOG_COLOR=False -USE_SCREEN=True -SCREEN_LOGDIR=/opt/stack/data/log +USE_SYSTEMD=True RECLONE=${RECLONE} +# Increase the wait used by stack to poll for the nova service on the control node +NOVA_READY_TIMEOUT=1800 disable_all_services EOF @@ -366,8 +431,6 @@ EOF add_os_services "${CORE_OS_COMPUTE_SERVICES}" "${ENABLE_OS_COMPUTE_SERVICES}" "${DISABLE_OS_SERVICES}" "${local_conf_file_name}" cat >> ${local_conf_file_name} << EOF -#Added to make Nova wait until nova in control node is ready. -NOVA_READY_TIMEOUT=1800 HOST_IP=${HOSTIP} SERVICE_HOST=${SERVICEHOST} Q_ML2_TENANT_NETWORK_TYPE=${TENANT_NETWORK_TYPE} @@ -418,6 +481,10 @@ auth_strategy = keystone [DEFAULT] use_neutron = True force_raw_images = False +log_dir = /opt/stack/logs +[libvirt] +live_migration_uri = qemu+tcp://%s/system +virt_type = qemu EOF echo "Compute local.conf created:" @@ -458,30 +525,26 @@ defaults listen opendaylight bind ${MGRIP}:8080 balance source -EOF - odlindex=1 - for odlip in ${ODL_IPS[*]}; do - cat >> ${WORKSPACE}/haproxy.cfg << EOF - server controller-${odlindex} ${odlip}:8080 check fall 5 inter 2000 rise 2 -EOF - odlindex=$((odlindex+1)) - done - - cat >> ${WORKSPACE}/haproxy.cfg << EOF listen opendaylight_rest bind ${MGRIP}:8181 balance source + +listen opendaylight_websocket + bind ${MGRIP}:8185 + balance source + EOF odlindex=1 for odlip in ${ODL_IPS[*]}; do - cat >> ${WORKSPACE}/haproxy.cfg << EOF - server controller-rest-${odlindex} ${odlip}:8181 check fall 5 inter 2000 rise 2 -EOF + sed -i "/listen opendaylight$/a server controller-${odlindex} ${odlip}:8080 check fall 5 inter 2000 rise 2" ${WORKSPACE}/haproxy.cfg + sed -i "/listen opendaylight_rest$/a server controller-rest-${odlindex} ${odlip}:8181 check fall 5 inter 2000 rise 2" ${WORKSPACE}/haproxy.cfg + sed -i "/listen opendaylight_websocket$/a server controller-websocket-${odlindex} ${odlip}:8185 check fall 5 inter 2000 rise 2" ${WORKSPACE}/haproxy.cfg odlindex=$((odlindex+1)) done + echo "Dump haproxy.cfg" cat ${WORKSPACE}/haproxy.cfg @@ -503,213 +566,6 @@ EOF ${SSH} ${MGRIP} "sudo bash /tmp/deploy_ha_proxy.sh" } # configure_haproxy_for_neutron_requests() -# Collect the list of files on the hosts -function collect_files () { - local -r ip=$1 - local -r folder=$2 - finddir=/tmp/finder - ${SSH} ${ip} "mkdir -p ${finddir}" - ${SSH} ${ip} "sudo find /etc > ${finddir}/find.etc.txt" - ${SSH} ${ip} "sudo find /opt/stack > ${finddir}/find.opt.stack.txt" - ${SSH} ${ip} "sudo find /var > ${finddir}/find2.txt" - ${SSH} ${ip} "sudo find /var > ${finddir}/find.var.txt" - ${SSH} ${ip} "sudo tar -cf - -C /tmp finder | xz -T 0 > /tmp/find.tar.xz" - scp ${ip}:/tmp/find.tar.xz ${folder} - mkdir -p ${finddir} - rsync --rsync-path="sudo rsync" --list-only -arvhe ssh ${ip}:/etc/ > ${finddir}/rsync.etc.txt - rsync --rsync-path="sudo rsync" --list-only -arvhe ssh ${ip}:/opt/stack/ > ${finddir}/rsync.opt.stack.txt - rsync --rsync-path="sudo rsync" --list-only -arvhe ssh ${ip}:/var/ > ${finddir}/rsync.var.txt - tar -cf - -C /tmp finder | xz -T 0 > /tmp/rsync.tar.xz - cp /tmp/rsync.tar.xz ${folder} -} - -function collect_logs () { - set +e # We do not want to create red dot just because something went wrong while fetching logs. - - cat > extra_debug.sh << EOF -echo -e "/usr/sbin/lsmod | /usr/bin/grep openvswitch\n" -/usr/sbin/lsmod | /usr/bin/grep openvswitch -echo -e "\ngrep ct_ /var/log/openvswitch/ovs-vswitchd.log\n" -grep "Datapath supports" /var/log/openvswitch/ovs-vswitchd.log -echo -e "\nsudo netstat -punta\n" -sudo netstat -punta -echo -e "\nsudo getenforce\n" -sudo getenforce -echo -e "\nsudo systemctl status httpd\n" -sudo systemctl status httpd -echo -e "\nenv\n" -env -source /opt/stack/devstack/openrc admin admin -echo -e "\nenv after openrc\n" -env -echo -e "\nsudo du -hs /opt/stack" -sudo du -hs /opt/stack -echo -e "\nsudo mount" -sudo mount -echo -e "\ndmesg -T > /tmp/dmesg.log" -dmesg -T > /tmp/dmesg.log -echo -e "\njournalctl > /tmp/journalctl.log\n" -sudo journalctl > /tmp/journalctl.log -echo -e "\novsdb-tool -mm show-log > /tmp/ovsdb-tool.log" -ovsdb-tool -mm show-log > /tmp/ovsdb-tool.log -EOF - - # Since this log collection work is happening before the archive build macro which also - # creates the ${WORKSPACE}/archives dir, we have to do it here first. The mkdir in the - # archives build step will essentially be a noop. - mkdir -p ${WORKSPACE}/archives - - mv /tmp/changes.txt ${WORKSPACE}/archives - mv ${WORKSPACE}/rabbit.txt ${WORKSPACE}/archives - - sleep 5 - # FIXME: Do not create .tar and gzip before copying. - for i in `seq 1 ${NUM_ODL_SYSTEM}`; do - CONTROLLERIP=ODL_SYSTEM_${i}_IP - echo "collect_logs: for opendaylight controller ip: ${!CONTROLLERIP}" - NODE_FOLDER="odl_${i}" - mkdir -p ${NODE_FOLDER} - echo "Lets's take the karaf thread dump again..." - ssh ${!CONTROLLERIP} "sudo ps aux" > ${WORKSPACE}/ps_after.log - pid=$(grep org.apache.karaf.main.Main ${WORKSPACE}/ps_after.log | grep -v grep | tr -s ' ' | cut -f2 -d' ') - echo "karaf main: org.apache.karaf.main.Main, pid:${pid}" - ssh ${!CONTROLLERIP} "jstack ${pid}" > ${WORKSPACE}/karaf_${i}_${pid}_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' - ${SSH} ${!CONTROLLERIP} "sudo journalctl > /tmp/journalctl.log" - scp ${!CONTROLLERIP}:/tmp/journalctl.log ${NODE_FOLDER} - ${SSH} ${!CONTROLLERIP} "dmesg -T > /tmp/dmesg.log" - scp ${!CONTROLLERIP}:/tmp/dmesg.log ${NODE_FOLDER} - ${SSH} ${!CONTROLLERIP} "tar -cf - -C /tmp/${BUNDLEFOLDER} etc | xz -T 0 > /tmp/etc.tar.xz" - scp ${!CONTROLLERIP}:/tmp/etc.tar.xz ${NODE_FOLDER} - ${SSH} ${!CONTROLLERIP} "cp -r /tmp/${BUNDLEFOLDER}/data/log /tmp/odl_log" - ${SSH} ${!CONTROLLERIP} "tar -cf /tmp/odl${i}_karaf.log.tar /tmp/odl_log/*" - scp ${!CONTROLLERIP}:/tmp/odl${i}_karaf.log.tar ${NODE_FOLDER} - ${SSH} ${!CONTROLLERIP} "tar -cf /tmp/odl${i}_zrpcd.log.tar /tmp/zrpcd.init.log" - scp ${!CONTROLLERIP}:/tmp/odl${i}_zrpcd.log.tar ${NODE_FOLDER} - tar -xvf ${NODE_FOLDER}/odl${i}_karaf.log.tar -C ${NODE_FOLDER} --strip-components 2 --transform s/karaf/odl${i}_karaf/g - grep "ROBOT MESSAGE\| ERROR " ${NODE_FOLDER}/odl${i}_karaf.log > ${NODE_FOLDER}/odl${i}_err.log - grep "ROBOT MESSAGE\| ERROR \| WARN \|Exception" \ - ${NODE_FOLDER}/odl${i}_karaf.log > ${NODE_FOLDER}/odl${i}_err_warn_exception.log - # Print ROBOT lines and print Exception lines. For exception lines also print the previous line for context - sed -n -e '/ROBOT MESSAGE/P' -e '$!N;/Exception/P;D' ${NODE_FOLDER}/odl${i}_karaf.log > ${NODE_FOLDER}/odl${i}_exception.log - rm ${NODE_FOLDER}/odl${i}_karaf.log.tar - mv *_threads* ${NODE_FOLDER} - mv ps_* ${NODE_FOLDER} - mv ${NODE_FOLDER} ${WORKSPACE}/archives/ - done - - print_job_parameters > ${WORKSPACE}/archives/params.txt - - # Control Node - for i in `seq 1 ${NUM_OPENSTACK_CONTROL_NODES}`; do - OSIP=OPENSTACK_CONTROL_NODE_${i}_IP - echo "collect_logs: for openstack control node ip: ${!OSIP}" - NODE_FOLDER="control_${i}" - mkdir -p ${NODE_FOLDER} - scp extra_debug.sh ${!OSIP}:/tmp - ${SSH} ${!OSIP} "bash /tmp/extra_debug.sh > /tmp/extra_debug.log" - scp ${!OSIP}:/etc/dnsmasq.conf ${NODE_FOLDER} - scp ${!OSIP}:/etc/keystone/keystone.conf ${NODE_FOLDER} - scp ${!OSIP}:/etc/keystone/keystone-uwsgi-admin.ini ${NODE_FOLDER} - scp ${!OSIP}:/etc/keystone/keystone-uwsgi-public.ini ${NODE_FOLDER} - scp ${!OSIP}:/etc/kuryr/kuryr.conf ${NODE_FOLDER} - scp ${!OSIP}:/etc/neutron/dhcp_agent.ini ${NODE_FOLDER} - scp ${!OSIP}:/etc/neutron/metadata_agent.ini ${NODE_FOLDER} - scp ${!OSIP}:/etc/neutron/neutron.conf ${NODE_FOLDER} - scp ${!OSIP}:/etc/neutron/neutron_lbaas.conf ${NODE_FOLDER} - scp ${!OSIP}:/etc/neutron/plugins/ml2/ml2_conf.ini ${NODE_FOLDER} - scp ${!OSIP}:/etc/neutron/services/loadbalancer/haproxy/lbaas_agent.ini ${NODE_FOLDER} - scp ${!OSIP}:/etc/nova/nova.conf ${NODE_FOLDER} - scp ${!OSIP}:/etc/nova/nova-api-uwsgi.ini ${NODE_FOLDER} - scp ${!OSIP}:/etc/nova/nova_cell1.conf ${NODE_FOLDER} - scp ${!OSIP}:/etc/nova/nova-cpu.conf ${NODE_FOLDER} - scp ${!OSIP}:/etc/nova/placement-uwsgi.ini ${NODE_FOLDER} - scp ${!OSIP}:/etc/openstack/clouds.yaml ${NODE_FOLDER} - scp ${!OSIP}:/opt/stack/devstack/.stackenv ${NODE_FOLDER} - scp ${!OSIP}:/opt/stack/devstack/nohup.out ${NODE_FOLDER}/stack.log - scp ${!OSIP}:/opt/stack/devstack/openrc ${NODE_FOLDER} - scp ${!OSIP}:/opt/stack/requirements/upper-constraints.txt ${NODE_FOLDER} - scp ${!OSIP}:/opt/stack/tempest/etc/tempest.conf ${NODE_FOLDER} - scp ${!OSIP}:/tmp/*.xz ${NODE_FOLDER} - scp ${!OSIP}:/tmp/dmesg.log ${NODE_FOLDER} - scp ${!OSIP}:/tmp/extra_debug.log ${NODE_FOLDER} - scp ${!OSIP}:/tmp/get_devstack.sh.txt ${NODE_FOLDER} - scp ${!OSIP}:/tmp/journalctl.log ${NODE_FOLDER} - scp ${!OSIP}:/tmp/ovsdb-tool.log ${NODE_FOLDER} - scp ${!OSIP}:/var/log/openvswitch/ovs-vswitchd.log ${NODE_FOLDER} - scp ${!OSIP}:/var/log/openvswitch/ovsdb-server.log ${NODE_FOLDER} - collect_files "${!OSIP}" "${NODE_FOLDER}" - ${SSH} ${!OSIP} "sudo tar -cf - -C /var/log rabbitmq | xz -T 0 > /tmp/rabbitmq.tar.xz " - scp ${!OSIP}:/tmp/rabbitmq.tar.xz ${NODE_FOLDER} - rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/etc/hosts ${NODE_FOLDER} - rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/usr/lib/systemd/system/haproxy.service ${NODE_FOLDER} - rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/audit/audit.log ${NODE_FOLDER} - rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/httpd/keystone_access.log ${NODE_FOLDER} - rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/httpd/keystone.log ${NODE_FOLDER} - rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/messages ${NODE_FOLDER} - rsync -avhe ssh ${!OSIP}:/opt/stack/logs/* ${NODE_FOLDER} # rsync to prevent copying of symbolic links - mv local.conf_control_${!OSIP} ${NODE_FOLDER}/local.conf - # qdhcp files are created by robot tests and copied into /tmp/qdhcp during the test - tar -cf - -C /tmp qdhcp | xz -T 0 > /tmp/qdhcp.tar.xz - mv /tmp/qdhcp.tar.xz ${NODE_FOLDER} - mv ${NODE_FOLDER} ${WORKSPACE}/archives/ - done - - # Compute Nodes - for i in `seq 1 ${NUM_OPENSTACK_COMPUTE_NODES}`; do - OSIP=OPENSTACK_COMPUTE_NODE_${i}_IP - echo "collect_logs: for openstack compute node ip: ${!OSIP}" - NODE_FOLDER="compute_${i}" - mkdir -p ${NODE_FOLDER} - scp extra_debug.sh ${!OSIP}:/tmp - ${SSH} ${!OSIP} "bash /tmp/extra_debug.sh > /tmp/extra_debug.log" - scp ${!OSIP}:/etc/nova/nova.conf ${NODE_FOLDER} - scp ${!OSIP}:/etc/nova/nova-cpu.conf ${NODE_FOLDER} - scp ${!OSIP}:/etc/openstack/clouds.yaml ${NODE_FOLDER} - scp ${!OSIP}:/opt/stack/devstack/.stackenv ${NODE_FOLDER} - scp ${!OSIP}:/opt/stack/devstack/nohup.out ${NODE_FOLDER}/stack.log - scp ${!OSIP}:/opt/stack/devstack/openrc ${NODE_FOLDER} - scp ${!OSIP}:/opt/stack/requirements/upper-constraints.txt ${NODE_FOLDER} - scp ${!OSIP}:/tmp/*.xz ${NODE_FOLDER}/ - scp ${!OSIP}:/tmp/dmesg.log ${NODE_FOLDER} - scp ${!OSIP}:/tmp/extra_debug.log ${NODE_FOLDER} - scp ${!OSIP}:/tmp/get_devstack.sh.txt ${NODE_FOLDER} - scp ${!OSIP}:/tmp/journalctl.log ${NODE_FOLDER} - scp ${!OSIP}:/tmp/ovsdb-tool.log ${NODE_FOLDER} - scp ${!OSIP}:/var/log/openvswitch/ovs-vswitchd.log ${NODE_FOLDER} - scp ${!OSIP}:/var/log/openvswitch/ovsdb-server.log ${NODE_FOLDER} - collect_files "${!OSIP}" "${NODE_FOLDER}" - ${SSH} ${!OSIP} "sudo tar -cf - -C /var/log libvirt | xz -T 0 > /tmp/libvirt.tar.xz " - scp ${!OSIP}:/tmp/libvirt.tar.xz ${NODE_FOLDER} - rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/etc/hosts ${NODE_FOLDER} - rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/audit/audit.log ${NODE_FOLDER} - rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/messages ${NODE_FOLDER} - rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/nova-agent.log ${NODE_FOLDER} - rsync -avhe ssh ${!OSIP}:/opt/stack/logs/* ${NODE_FOLDER} # rsync to prevent copying of symbolic links - mv local.conf_compute_${!OSIP} ${NODE_FOLDER}/local.conf - mv ${NODE_FOLDER} ${WORKSPACE}/archives/ - done - - # Tempest - DEVSTACK_TEMPEST_DIR="/opt/stack/tempest" - TESTREPO=".stestr" - TEMPEST_LOGS_DIR=${WORKSPACE}/archives/tempest - # Look for tempest test results in the $TESTREPO dir and copy if found - if ${SSH} ${OPENSTACK_CONTROL_NODE_1_IP} "sudo sh -c '[ -f ${DEVSTACK_TEMPEST_DIR}/${TESTREPO}/0 ]'"; then - ${SSH} ${OPENSTACK_CONTROL_NODE_1_IP} "for I in \$(sudo ls ${DEVSTACK_TEMPEST_DIR}/${TESTREPO}/ | grep -E '^[0-9]+$'); do sudo sh -c \"${DEVSTACK_TEMPEST_DIR}/.tox/tempest/bin/subunit-1to2 < ${DEVSTACK_TEMPEST_DIR}/${TESTREPO}/\${I} >> ${DEVSTACK_TEMPEST_DIR}/subunit_log.txt\"; done" - ${SSH} ${OPENSTACK_CONTROL_NODE_1_IP} "sudo sh -c '${DEVSTACK_TEMPEST_DIR}/.tox/tempest/bin/python ${DEVSTACK_TEMPEST_DIR}/.tox/tempest/lib/python2.7/site-packages/os_testr/subunit2html.py ${DEVSTACK_TEMPEST_DIR}/subunit_log.txt ${DEVSTACK_TEMPEST_DIR}/tempest_results.html'" - mkdir -p ${TEMPEST_LOGS_DIR} - scp ${OPENSTACK_CONTROL_NODE_1_IP}:${DEVSTACK_TEMPEST_DIR}/tempest_results.html ${TEMPEST_LOGS_DIR} - scp ${OPENSTACK_CONTROL_NODE_1_IP}:${DEVSTACK_TEMPEST_DIR}/tempest.log ${TEMPEST_LOGS_DIR} - if [ "$(echo ${OPENSTACK_BRANCH} | cut -d/ -f2)" != "queens" ]; then - mv ${WORKSPACE}/tempest_output* ${TEMPEST_LOGS_DIR} - fi - else - echo "tempest results not found in ${DEVSTACK_TEMPEST_DIR}/${TESTREPO}/0" - fi -} # collect_logs() - # Following three functions are debugging helpers when debugging devstack changes. # Keeping them for now so we can simply call them when needed. ctrlhn="" @@ -786,12 +642,7 @@ function is_rabbitmq_ready() { local -r ip=${1} local grepfor="nova_cell1" rm -f rabbit.txt - if [ "${OPENSTACK_BRANCH}" == "stable/ocata" ]; then - ${SSH} ${ip} "sudo rabbitmqctl status" > rabbit.txt - grepfor="pid" - else - ${SSH} ${ip} "sudo rabbitmqctl list_vhosts" > rabbit.txt - fi + ${SSH} ${ip} "sudo rabbitmqctl list_vhosts" > rabbit.txt grep ${grepfor} rabbit.txt } @@ -906,10 +757,10 @@ if [ -n "${DEVSTACK_HASH}" ]; then fi git --no-pager log --pretty=format:'%h %<(13)%ar%<(13)%cr %<(20,trunc)%an%d %s%b' -n20 echo -echo "workaround: adjust wait from 60s to 1800s (30m)" -sed -i 's/wait_for_compute 60/wait_for_compute 1800/g' /opt/stack/devstack/lib/nova -# TODO: modify sleep 1 to sleep 60, search wait_for_compute, then first sleep 1 -# that would just reduce the number of logs in the compute stack.log + +echo "workaround: do not upgrade openvswitch" +sudo yum install -y yum-plugin-versionlock +sudo yum versionlock add openvswitch #Install qemu-img command in Control Node for Pike echo "Install qemu-img application" @@ -968,14 +819,11 @@ for i in `seq 1 ${NUM_OPENSTACK_CONTROL_NODES}`; do ssh ${!CONTROLIP} "sed -i 's/flat_networks public/flat_networks public,physnet1/' /opt/stack/devstack/lib/neutron" ssh ${!CONTROLIP} "sed -i '186i iniset \$NEUTRON_CORE_PLUGIN_CONF ml2_type_vlan network_vlan_ranges public:1:4094,physnet1:1:4094' /opt/stack/devstack/lib/neutron" fi - if [[ "${ODL_ML2_BRANCH}" == "stable/ocata" && "$(is_openstack_feature_enabled n-cpu)" == "1" ]]; then - echo "Updating requirements for ${ODL_ML2_BRANCH}" - echo "Workaround for https://review.openstack.org/#/c/491032/" - echo "Modify upper-constraints to use libvirt-python 3.2.0" - fix_libvirt_version_n_cpu_ocata ${!CONTROLIP} - fi create_control_node_local_conf ${!CONTROLIP} ${ODLMGRIP[$i]} "${ODL_OVS_MGRS[$i]}" scp ${WORKSPACE}/local.conf_control_${!CONTROLIP} ${!CONTROLIP}:/opt/stack/devstack/local.conf + echo "Install rdo release to avoid incompatible Package versions" + install_rdo_release ${!CONTROLIP} + setup_live_migration_control ${!CONTROLIP} echo "Stack the control node ${i} of ${NUM_OPENSTACK_CONTROL_NODES}: ${CONTROLIP}" ssh ${!CONTROLIP} "cd /opt/stack/devstack; nohup ./stack.sh > /opt/stack/devstack/nohup.out 2>&1 &" ssh ${!CONTROLIP} "ps -ef | grep stack.sh" @@ -1006,7 +854,6 @@ if [ ${NUM_OPENSTACK_COMPUTE_NODES} -gt 0 ]; then echo "rabbitmq is ready, starting ${NUM_OPENSTACK_COMPUTE_NODES} compute(s)" else echo "rabbitmq was not ready in ${WAIT_FOR_RABBITMQ_MINUTES}m" - collect_logs exit 1 fi fi @@ -1023,14 +870,17 @@ for i in `seq 1 ${NUM_OPENSTACK_COMPUTE_NODES}`; do scp ${WORKSPACE}/hosts_file ${!COMPUTEIP}:/tmp/hosts scp ${WORKSPACE}/get_devstack.sh ${!COMPUTEIP}:/tmp ${SSH} ${!COMPUTEIP} "bash /tmp/get_devstack.sh > /tmp/get_devstack.sh.txt 2>&1" - if [ "${ODL_ML2_BRANCH}" == "stable/ocata" ]; then + if [ "${ODL_ML2_BRANCH}" == "stable/pike" ]; then echo "Updating requirements for ${ODL_ML2_BRANCH}" - echo "Workaround for https://review.openstack.org/#/c/491032/" - echo "Modify upper-constraints to use libvirt-python 3.2.0" - fix_libvirt_version_n_cpu_ocata ${!COMPUTEIP} + echo "Workaround for libvirt-python failing installation" + echo "Modify upper-constraints to use libvirt-python 4.2.0" + fix_libvirt_version_n_cpu_pike ${!COMPUTEIP} fi create_compute_node_local_conf ${!COMPUTEIP} ${!CONTROLIP} ${ODLMGRIP[$SITE_INDEX]} "${ODL_OVS_MGRS[$SITE_INDEX]}" scp ${WORKSPACE}/local.conf_compute_${!COMPUTEIP} ${!COMPUTEIP}:/opt/stack/devstack/local.conf + echo "Install rdo release to avoid incompatible Package versions" + install_rdo_release ${!COMPUTEIP} + setup_live_migration_compute ${!COMPUTEIP} ${!CONTROLIP} echo "Stack the compute node ${i} of ${NUM_OPENSTACK_COMPUTE_NODES}: ${COMPUTEIP}" ssh ${!COMPUTEIP} "cd /opt/stack/devstack; nohup ./stack.sh > /opt/stack/devstack/nohup.out 2>&1 &" ssh ${!COMPUTEIP} "ps -ef | grep stack.sh" @@ -1079,7 +929,6 @@ while [ ${in_progress} -eq 1 ]; do continue elif [ "$stacking_status" == "Stacking Failed" ]; then echo "node $index ${os_node_list[index]}: stacking has failed" - collect_logs exit 1 elif [ "$stacking_status" == "Stacking Complete" ]; then echo "node $index ${os_node_list[index]}: stacking complete" @@ -1093,7 +942,6 @@ while [ ${in_progress} -eq 1 ]; do sleep 60 if [ ${iteration} -eq 60 ]; then echo "stacking has failed - took longer than 60m" - collect_logs exit 1 fi done @@ -1112,13 +960,6 @@ for i in `seq 1 ${NUM_OPENSTACK_SITES}`; do echo "sleep for 60s and print hypervisor-list" sleep 60 - # In Ocata if we do not enable the n-cpu in control node then - # 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 ${SSH} ${!CONTROLIP} "cd /opt/stack/devstack; source openrc admin admin; nova hypervisor-list" # in the case that we are doing openstack (control + compute) all in one node, then the number of hypervisors # will be the same as the number of openstack systems. However, if we are doing multinode openstack then the @@ -1132,17 +973,9 @@ for i in `seq 1 ${NUM_OPENSTACK_SITES}`; do num_hypervisors=$(${SSH} ${!CONTROLIP} "cd /opt/stack/devstack; source openrc admin admin; openstack hypervisor list -f value | wc -l" | tail -1 | tr -d "\r") if ! [ "${num_hypervisors}" ] || ! [ ${num_hypervisors} -eq ${expected_num_hypervisors} ]; then echo "Error: Only $num_hypervisors hypervisors detected, expected $expected_num_hypervisors" - collect_logs exit 1 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. - ${SSH} ${!CONTROLIP} "sudo pip install --upgrade pip" - ${SSH} ${!CONTROLIP} "sudo pip install urllib3 --upgrade" - ${SSH} ${!CONTROLIP} "sudo pip install httplib2 --upgrade" - # Gather Compute IPs for the site for j in `seq 1 ${NUM_COMPUTES_PER_SITE}`; do COMPUTE_INDEX=$(((i-1) * NUM_COMPUTES_PER_SITE + j)) @@ -1324,11 +1157,13 @@ for suite in ${SUITES}; do -v CONTROLLERFEATURES:"${CONTROLLERFEATURES}" \ -v CONTROLLER_USER:${USER} \ -v DEVSTACK_DEPLOY_PATH:/opt/stack/devstack \ + -v ENABLE_ITM_DIRECT_TUNNELS:${ENABLE_ITM_DIRECT_TUNNELS} \ -v HA_PROXY_IP:${HA_PROXY_IP} \ -v HA_PROXY_1_IP:${HA_PROXY_1_IP} \ -v HA_PROXY_2_IP:${HA_PROXY_2_IP} \ -v HA_PROXY_3_IP:${HA_PROXY_3_IP} \ -v JDKVERSION:${JDKVERSION} \ + -v JENKINS_WORKSPACE:${WORKSPACE} \ -v NEXUSURL_PREFIX:${NEXUSURL_PREFIX} \ -v NUM_ODL_SYSTEM:${NUM_ODL_SYSTEM} \ -v NUM_OPENSTACK_SITES:${NUM_OPENSTACK_SITES} \ @@ -1358,6 +1193,7 @@ for suite in ${SUITES}; do -v OS_COMPUTE_4_IP:${OPENSTACK_COMPUTE_NODE_4_IP} \ -v OS_COMPUTE_5_IP:${OPENSTACK_COMPUTE_NODE_5_IP} \ -v OS_COMPUTE_6_IP:${OPENSTACK_COMPUTE_NODE_6_IP} \ + -v CMP_INSTANCES_SHARED_PATH:/var/instances \ -v OS_USER:${USER} \ -v PUBLIC_PHYSICAL_NETWORK:${PUBLIC_PHYSICAL_NETWORK} \ -v SECURITY_GROUP_MODE:${SECURITY_GROUP_MODE} \ @@ -1376,7 +1212,6 @@ ssh ${ODL_SYSTEM_IP} "ls -altr /tmp/${BUNDLEFOLDER}/data/log/" ssh ${ODL_SYSTEM_IP} "du -hs /tmp/${BUNDLEFOLDER}/data/log/*" echo "Tests Executed" -collect_logs true # perhaps Jenkins is testing last exit code # vim: ts=4 sw=4 sts=4 et ft=sh :