Skip to content

Commit

Permalink
tests/storage-vm: Add test for live resizing of VM disks with zfs or …
Browse files Browse the repository at this point in the history
…lvm pool driver

Signed-off-by: Kadin Sayani <[email protected]>
  • Loading branch information
kadinsayani committed Oct 8, 2024
1 parent 939a4b5 commit 3f6a581
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/storage-vm
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,12 @@ for poolDriver in $poolDriverList; do
echo "==> Testing VM optimized export/import (while running to check config.mount is excluded)"
! lxc export v1 --quiet --compression=none - --optimized-storage | tar -tf - | grep -F config.mount || false

if [[ $(hasNeededAPIExtension vm_zfs_storage_disk_live_resize) && $(hasNeededAPIExtension vm_lvm_storage_disk_live_resize) && ( "${poolDriver}" == "zfs" || "${poolDriver}" == "lvm" ) ]]; then
echo "==> Checking live root disk device resize support with ${poolDriver} backend"
lxc config device set v1 root size=16GiB
[ "$(($(lxc exec v1 -- blockdev --getsize64 /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_lxd_root) / GiB))" -eq "16" ]
fi

echo "==> Increasing VM root disk size for next boot (24GiB)"
lxc config device set v1 root size=24GiB
[ "$(lxc config get v1 volatile.root.apply_quota)" = "true" ]
Expand Down

0 comments on commit 3f6a581

Please sign in to comment.