From ce39115fa73e7d4f82b6c47a652c130a83cce3f6 Mon Sep 17 00:00:00 2001 From: Riccardo Pittau Date: Tue, 1 Sep 2020 18:14:40 +0200 Subject: [PATCH] Explicitely do not allocate initial space for virtual volumes Initialize virtual volumes with no allocated initial space to prevent consuming all space available during volume creation. The behavior of virsh has changed, by default in the past the virtual volumes were initialized automatically with no initial allocated space, while with recent versions we need to specify explicitly to not allocate initial space for the virtual volumes. Change-Id: I588d0888c19304119af607433de6e35199f7c555 --- devstack/tools/ironic/scripts/create-node.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devstack/tools/ironic/scripts/create-node.sh b/devstack/tools/ironic/scripts/create-node.sh index 55b47858c5..15f1110f73 100755 --- a/devstack/tools/ironic/scripts/create-node.sh +++ b/devstack/tools/ironic/scripts/create-node.sh @@ -113,7 +113,7 @@ if ! virsh list --all | grep -q $NAME; then fi virsh vol-list --pool $LIBVIRT_STORAGE_POOL | grep -q $vol_name && virsh vol-delete $vol_name --pool $LIBVIRT_STORAGE_POOL >&2 - virsh vol-create-as $LIBVIRT_STORAGE_POOL ${vol_name} ${DISK}G --format $DISK_FORMAT $PREALLOC >&2 + virsh vol-create-as $LIBVIRT_STORAGE_POOL ${vol_name} ${DISK}G --allocation 0 --format $DISK_FORMAT $PREALLOC >&2 volume_path=$(virsh vol-path --pool $LIBVIRT_STORAGE_POOL $vol_name) # Pre-touch the VM to set +C, as it can only be set on empty files. sudo touch "$volume_path"