From 1d54c3571e36014acc2f5a60528f4e472fd6d6c2 Mon Sep 17 00:00:00 2001 From: Vlastimil Holer Date: Thu, 15 Mar 2018 16:54:19 +0100 Subject: [PATCH] B #1585: Resize running KVM VM disks only via libvirt blockresize (#1868) --- src/tm_mad/ceph/resize | 8 ++++++++ src/tm_mad/common/resize | 6 ++++++ src/tm_mad/tm_common.sh | 2 +- src/vmm_mad/remotes/kvm/resize_disk | 28 ++-------------------------- 4 files changed, 17 insertions(+), 27 deletions(-) diff --git a/src/tm_mad/ceph/resize b/src/tm_mad/ceph/resize index 249ec6f048..eb598483ea 100755 --- a/src/tm_mad/ceph/resize +++ b/src/tm_mad/ceph/resize @@ -99,6 +99,14 @@ if [ -n "$CEPH_CONF" ]; then RBD="$RBD --conf ${CEPH_CONF}" fi +### + +# for running VMs, leave disk resize on kvm/resize_disk +if [ `lcm_state $VM_ID` -eq 62 ]; then + log "Not resizing disk ${SRC_PATH} for running virt. machine directly" + exit 0 +fi + RESIZE_CMD=$(cat < /dev/null - -if [ $? -ne 0 ]; then - echo "Could not notify the VM about the disk resize. Poweroff cycle needed." -fi - - +exec_and_log "virsh --connect ${LIBVIRT_URI} blockresize ${DOMAIN} ${DISK_TARGET} ${DISK_SIZE}M" \ + "Failed to resize disk ${DISK_ID} on ${DOMAIN}"