Browse Source

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
changes/57/749357/2
Riccardo Pittau 1 year ago
parent
commit
ce39115fa7
  1. 2
      devstack/tools/ironic/scripts/create-node.sh

2
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"

Loading…
Cancel
Save