From ff9e663cd1f35c8f5d008819507799a05becaebe Mon Sep 17 00:00:00 2001 From: Simon Deziel Date: Tue, 17 Dec 2024 13:36:13 -0500 Subject: [PATCH 1/3] tests/vm-migration: use ZFS pool (CoW) as there are 3 nested VMs Signed-off-by: Simon Deziel --- tests/vm-migration | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/vm-migration b/tests/vm-migration index d29947e1..3ab5167a 100644 --- a/tests/vm-migration +++ b/tests/vm-migration @@ -11,8 +11,8 @@ install_lxd lxc network create lxdbr0 lxc profile device add default eth0 nic network=lxdbr0 -poolName="ctpool$$" -poolDriver=dir +poolName="vmpool$$" +poolDriver=zfs echo "==> Create storage pool using driver ${poolDriver}" lxc storage create "${poolName}" "${poolDriver}" From 8c4130dfbc7c8c9428821fb282a4e700ff530525 Mon Sep 17 00:00:00 2001 From: Simon Deziel Date: Tue, 17 Dec 2024 13:39:15 -0500 Subject: [PATCH 2/3] tests/vm-migration: move timeout inside member1 VM This should avoid leaving the `timeout 600 lxc exec member1 -- lxc move v1 --target member2` process hanging around in the runner VM as a process stopped by SIGTTOU: ``` root@v2:~# ps faux ... root 12517 0.0 0.0 3132 1792 pts/0 S 18:04 0:00 | \_ timeout 600 lxc exec member1 -- lxc move v1 --target me root 12518 0.0 0.1 1611304 16640 pts/0 Tl 18:04 0:00 | \_ /snap/lxd/31719/bin/lxc exec member1 -- lxc move v1 root@v2:~# strace -p 12518 strace: Process 12518 attached --- stopped by SIGTTOU --- ^Cstrace: Process 12518 detached ``` Signed-off-by: Simon Deziel --- tests/vm-migration | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/vm-migration b/tests/vm-migration index 3ab5167a..c1974c8e 100644 --- a/tests/vm-migration +++ b/tests/vm-migration @@ -132,7 +132,7 @@ lxc exec member1 -- lxc start v1 sleep 60 # Move the VM to member2 but with a timeout as this sometimes hangs indefinitely but when it works it's fast. -timeout 600 lxc exec member1 -- lxc move v1 --target member2 +lxc exec member1 -- timeout 600 lxc move v1 --target member2 # shellcheck disable=SC2034 FAIL=0 From 792ba21b15b8bddfda67c436440f1fa9d6703f5c Mon Sep 17 00:00:00 2001 From: Simon Deziel Date: Tue, 17 Dec 2024 14:09:46 -0500 Subject: [PATCH 3/3] tests/vm-migration: check VM location before/after move Signed-off-by: Simon Deziel --- tests/vm-migration | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/vm-migration b/tests/vm-migration index c1974c8e..2f28b5aa 100644 --- a/tests/vm-migration +++ b/tests/vm-migration @@ -131,8 +131,14 @@ lxc exec member1 -- lxc config device add v1 vol1-disk disk pool=ceph source=vol lxc exec member1 -- lxc start v1 sleep 60 +# Ascertain that the VM is indeed on member1. +[ "$(lxc exec member1 -- lxc list -c L -f csv v1)" = "member1" ] + # Move the VM to member2 but with a timeout as this sometimes hangs indefinitely but when it works it's fast. lxc exec member1 -- timeout 600 lxc move v1 --target member2 +# Verify the migration did succeeded and the VM is running on member2. +[ "$(lxc exec member1 -- lxc list -c L -f csv v1)" = "member2" ] + # shellcheck disable=SC2034 FAIL=0