From f1efdb134ff07e2801746c99acf3a757b4b2b90c Mon Sep 17 00:00:00 2001 From: "Hussey, Scott (sh8121)" Date: Fri, 28 Jun 2019 16:18:28 +0000 Subject: [PATCH] Improve VM failure data collection - Build VMs that log their console to a file within the gate run temporary directory. Change-Id: I4ab38746525baee1e86e279b3ab8668d03e2de58 --- .../airship_gate/lib/airship.sh | 2 ++ .../airship_gate/lib/virsh.sh | 20 ++++++++++++------- .../airship_gate/stages/gate-setup.sh | 3 +++ tools/multi_nodes_gate/gate.sh | 7 +++++-- 4 files changed, 23 insertions(+), 9 deletions(-) diff --git a/tools/multi_nodes_gate/airship_gate/lib/airship.sh b/tools/multi_nodes_gate/airship_gate/lib/airship.sh index 13af063f..a51d147d 100644 --- a/tools/multi_nodes_gate/airship_gate/lib/airship.sh +++ b/tools/multi_nodes_gate/airship_gate/lib/airship.sh @@ -91,6 +91,8 @@ shipyard_action_wait() { ACTION_ID=$(shipyard_cmd create action ${options} "${action}") ACTION_ID=$(echo "${ACTION_ID}" | grep -oE 'action/[0-9A-Z]+') + echo "Action ${ACTION_ID} has been created." + while true; do if [[ $(date +%s) -ge ${end_time} ]] diff --git a/tools/multi_nodes_gate/airship_gate/lib/virsh.sh b/tools/multi_nodes_gate/airship_gate/lib/virsh.sh index b6fcf83c..89772a6f 100644 --- a/tools/multi_nodes_gate/airship_gate/lib/virsh.sh +++ b/tools/multi_nodes_gate/airship_gate/lib/virsh.sh @@ -157,11 +157,13 @@ vm_create() { log Creating VM "${NAME}" and bootstrapping the boot drive virt-install \ --name "${NAME}" \ + --os-variant ubuntu16.04 \ --virt-type kvm \ --cpu ${VIRSH_CPU_OPTS} \ - --graphics vnc,listen=0.0.0.0 \ + --serial file,path=${TEMP_DIR}/console/${NAME}.log \ + --graphics none \ --noautoconsole \ - --network "network=airship_gate,model=virtio" \ + --network "network=airship_gate,model=virtio,address.type=pci,address.slot=0x03" \ --mac="${MAC_ADDRESS}" \ --vcpus "$(config_vm_vcpus ${NAME})" \ --memory "$(config_vm_memory ${NAME})" \ @@ -177,11 +179,13 @@ vm_create() { log Creating VM "${NAME}" virt-install \ --name "${NAME}" \ + --os-variant ubuntu16.04 \ --virt-type kvm \ --cpu ${VIRSH_CPU_OPTS} \ - --graphics vnc,listen=0.0.0.0 \ + --graphics none \ + --serial file,path=${TEMP_DIR}/console/${NAME}.log \ --noautoconsole \ - --network "network=airship_gate,model=virtio" \ + --network "network=airship_gate,model=virtio,address.type=pci,address.slot=0x03" \ --mac="${MAC_ADDRESS}" \ --vcpus "$(config_vm_vcpus ${NAME})" \ --memory "$(config_vm_memory ${NAME})" \ @@ -266,7 +270,8 @@ vol_create_root() { virsh vol-create-as \ --pool "${VIRSH_POOL}" \ --name "airship-gate-${NAME}.img" \ - --capacity 64G \ + --capacity 56G \ + --allocation 56G \ --format qcow2 \ --backing-vol 'airship-gate-base.img' \ --backing-vol-format qcow2 &>> "${LOG_FILE}" @@ -274,8 +279,9 @@ vol_create_root() { virsh vol-create-as \ --pool "${VIRSH_POOL}" \ --name "airship-gate-${NAME}.img" \ - --capacity 64G \ - --format qcow2 &>> "${LOG_FILE}" + --capacity 56G \ + --allocation 56G \ + --format raw &>> "${LOG_FILE}" fi } diff --git a/tools/multi_nodes_gate/airship_gate/stages/gate-setup.sh b/tools/multi_nodes_gate/airship_gate/stages/gate-setup.sh index 891bf781..f2ee0dae 100755 --- a/tools/multi_nodes_gate/airship_gate/stages/gate-setup.sh +++ b/tools/multi_nodes_gate/airship_gate/stages/gate-setup.sh @@ -21,6 +21,9 @@ source "${GATE_UTILS}" # note: currently not used # registry_up +# Create temp_dir structure +mkdir -p ${TEMP_DIR}/console + # SSH setup ssh_setup_declare diff --git a/tools/multi_nodes_gate/gate.sh b/tools/multi_nodes_gate/gate.sh index ebb1f488..a9a1812f 100755 --- a/tools/multi_nodes_gate/gate.sh +++ b/tools/multi_nodes_gate/gate.sh @@ -21,8 +21,11 @@ GATE_UTILS=${WORKSPACE}/multi_nodes_gate/airship_gate/lib/all.sh GATE_COLOR=${GATE_COLOR:-1} -MANIFEST_ARG=${1:-multinode_deploy} -GATE_MANIFEST=${WORKSPACE}/multi_nodes_gate/airship_gate/manifests/${MANIFEST_ARG}.json +MANIFEST_ARG=${1:-"multinode_deploy"} +if [ -z "$GATE_MANIFEST" ] +then + GATE_MANIFEST=${WORKSPACE}/multi_nodes_gate/airship_gate/manifests/${MANIFEST_ARG}.json +fi export GATE_COLOR export GATE_MANIFEST