From 30c2548fddba72eded8a1e95c0744d098e029ec8 Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Thu, 1 Feb 2018 09:49:42 +0000 Subject: xci: scripts: vm: Use LVM backend if available The CI nodes come with a big secondary mechanical disk which can be attached directly to the clean VM. As such, we split the disk into one logical volume per distribution and flush the qcow2 image to it before attaching it to the VM. If the XCI volume group is not available, then we revert back to using a file-based storage backend. Finally, we hide stdout/stderr from the package installation process to minimize the script output. Change-Id: I11ea82899c411f8a4168e5f23cbbd8187cc891df Signed-off-by: Markos Chandras --- xci/scripts/vm/start-new-vm.sh | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'xci') diff --git a/xci/scripts/vm/start-new-vm.sh b/xci/scripts/vm/start-new-vm.sh index e5a13b6b..70dc4efb 100755 --- a/xci/scripts/vm/start-new-vm.sh +++ b/xci/scripts/vm/start-new-vm.sh @@ -130,7 +130,7 @@ while true; do pgrep -fa "${pkg_mgr_cmd%*install*}" 2>&1 && sleep 60 || break done -eval ${pkg_mgr_cmd} +eval ${pkg_mgr_cmd} &> /dev/null echo "Ensuring libvirt and docker services are running..." sudo systemctl -q start libvirtd @@ -173,9 +173,6 @@ declare -r OS_IMAGE_FILE=${OS}.qcow2 [[ ! -e ${OS_IMAGE_FILE} ]] && echo "${OS_IMAGE_FILE} not found! This should never happen!" && exit 1 -echo "Resizing disk image '${OS}' to ${DISK}G..." -qemu-img resize ${OS_IMAGE_FILE} ${DISK}G - echo "Creating new network '${NETWORK}' if it does not exist already..." if ! sudo virsh net-list --name --all | grep -q ${NETWORK}; then cat > /tmp/${NETWORK}.xml <