[pve-devel] [PATCH qemu-server v2 1/2] create_vm: assume HA state 'started' when live-restoring guests
Michael Köppl
m.koeppl at proxmox.com
Thu Nov 27 16:40:40 CET 2025
To avoid shutting down the VM when performing a live-restore, consider
live-restore=1 to translate to a HA state of 'started', similar to
start=1.
Signed-off-by: Michael Köppl <m.koeppl at proxmox.com>
---
src/PVE/API2/Qemu.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/PVE/API2/Qemu.pm b/src/PVE/API2/Qemu.pm
index c580bf63..25b6529c 100644
--- a/src/PVE/API2/Qemu.pm
+++ b/src/PVE/API2/Qemu.pm
@@ -1418,7 +1418,7 @@ __PACKAGE__->register_method({
if ($ha_managed) {
print "Add as HA resource\n";
- my $state = $start_after_create ? 'started' : 'stopped';
+ my $state = $start_after_create || $live_restore ? 'started' : 'stopped';
my $cmd = ['ha-manager', 'add', "vm:$vmid", '--state', $state];
eval { PVE::Tools::run_command($cmd); };
warn $@ if $@;
--
2.47.3
More information about the pve-devel
mailing list