mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-06 15:47:12 +00:00
rollback: Only create start task with --start if VM is not running
When rolling back to the snapshot of a VM that includes RAM, the VM gets started by the rollback task anyway, so no additional start task is needed. Previously, when rolling back with the start parameter and the VM snapshot included RAM, a start task was created. That task failed because the VM had already been started by the rollback task. Additionally documented this behaviour in the description of the start parameter Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
This commit is contained in:
parent
7bd9abd243
commit
a46d039d3c
@ -5066,7 +5066,8 @@ __PACKAGE__->register_method({
|
||||
snapname => get_standard_option('pve-snapshot-name'),
|
||||
start => {
|
||||
type => 'boolean',
|
||||
description => "Whether the VM should get started after rolling back successfully",
|
||||
description => "Whether the VM should get started after rolling back successfully."
|
||||
. " (Note: VMs will be automatically started if the snapshot includes RAM.)",
|
||||
optional => 1,
|
||||
default => 0,
|
||||
},
|
||||
@ -5093,7 +5094,7 @@ __PACKAGE__->register_method({
|
||||
PVE::Cluster::log_msg('info', $authuser, "rollback snapshot VM $vmid: $snapname");
|
||||
PVE::QemuConfig->snapshot_rollback($vmid, $snapname);
|
||||
|
||||
if ($param->{start}) {
|
||||
if ($param->{start} && !PVE::QemuServer::Helpers::vm_running_locally($vmid)) {
|
||||
PVE::API2::Qemu->vm_start({ vmid => $vmid, node => $node });
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user