kvm-host: migrate-vm: set drbd role after define/undefine

This commit is contained in:
Jérémy Lecour 2023-10-05 18:06:30 +02:00 committed by Jérémy Lecour
parent 9cd0426d2b
commit 31456aa126
Signed by: jlecour
SSH key fingerprint: SHA256:h+5LgHRKwN9lS0SsdVR5yZPeFlJE4Mt+8UtL4CcP8dY

View file

@ -249,11 +249,11 @@ migrate_from() {
set_drbd_role primary "${resource}"
migrate_vm_from "${vm}" "${remote_ip}" "${current_ip}"
set_drbd_role secondary "${resource}" "${remote_ip}"
if persistent; then
define_vm "${vm}"
undefine_vm "${vm}" "${remote_ip}"
fi
set_drbd_role secondary "${resource}" "${remote_ip}"
}
migrate_to() {
@ -268,11 +268,11 @@ migrate_to() {
set_drbd_role primary "${resource}" "${remote_ip}"
migrate_vm_to "${vm}" "${remote_ip}"
set_drbd_role secondary "${resource}"
if persistent; then
define_vm "${vm}" "${remote_ip}"
undefine_vm "${vm}"
fi
set_drbd_role secondary "${resource}"
}
main() {