diff --git a/tests/storage-vm b/tests/storage-vm index 754112b57..95d53b5d9 100755 --- a/tests/storage-vm +++ b/tests/storage-vm @@ -566,9 +566,20 @@ for poolDriver in $poolDriverList; do echo "==> VM Generation ID in LXD config does not match VM Generation ID in QEMU process" false fi - lxc delete -f v1 + echo "==> Publishing VM to image" + lxc init "${TEST_IMG:-ubuntu-minimal-daily:22.04}" v1 --vm -s "${poolName}" + lxc storage volume create "${poolName}" images + lxc config set storage.images_volume "${poolName}"/images + lxc publish v1 --alias v1image + lxc launch v1image v2 -s "${poolName}" + waitInstanceReady v2 + lxc delete v1 v2 -f + lxc image delete v1image + lxc config unset storage.images_volume + lxc storage volume delete "${poolName}" images + if hasNeededAPIExtension instances_migration_stateful; then echo "==> Checking setting instances.migration.stateful for VMs" # Check that migration.stateful is set in the instance's expanded config to the value of `instances.migration.stateful` diff --git a/tests/storage-volumes-vm b/tests/storage-volumes-vm index 7153d0a45..9efe72b9c 100755 --- a/tests/storage-volumes-vm +++ b/tests/storage-volumes-vm @@ -146,17 +146,6 @@ do lxc storage volume detach "${poolName}" vol3 v1 lxc storage volume detach "${poolName}" vol6 v1 || true # optional ISO - echo "==> Publishing VM to image" - lxc storage volume create "${poolName}" images --project=default - lxc config set storage.images_volume "${poolName}"/images - lxc publish v1 --alias v1image - lxc launch v1image v2 -s "${poolName}" - waitInstanceReady v2 - lxc delete v2 -f - lxc image delete v1image - lxc config unset storage.images_volume - lxc storage volume delete "${poolName}" images --project=default - echo "==> Deleting VM" lxc delete v1