From 112810056904098b42f6f8b298068de81197ec46 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Mon, 11 Mar 2024 13:50:16 +0100 Subject: [PATCH] esxi: warn if the guest was running Signed-off-by: Wolfgang Bumiller --- src/PVE/API2/Storage/Status.pm | 1 + src/PVE/Storage/ESXiPlugin.pm | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/PVE/API2/Storage/Status.pm b/src/PVE/API2/Storage/Status.pm index 8a99b77..01615c1 100644 --- a/src/PVE/API2/Storage/Status.pm +++ b/src/PVE/API2/Storage/Status.pm @@ -751,6 +751,7 @@ __PACKAGE__->register_method({ description => 'What this warning is about.', enum => [ 'cdrom-image-ignored', + 'guest-is-running', 'nvme-unsupported', 'ovmf-with-lsi-unsupported', 'serial-port-socket-only', diff --git a/src/PVE/Storage/ESXiPlugin.pm b/src/PVE/Storage/ESXiPlugin.pm index 91fb208..95bd8a5 100644 --- a/src/PVE/Storage/ESXiPlugin.pm +++ b/src/PVE/Storage/ESXiPlugin.pm @@ -903,6 +903,7 @@ sub get_create_args { my $storeid = $self->storeid; my $manifest = $self->manifest; + my $vminfo = $manifest->vm_for_vmx_path($self->vmx_path); my $create_args = {}; my $create_disks = {}; @@ -1052,6 +1053,8 @@ sub get_create_args { ++$serid; }); + $warn->('guest-is-running') if defined($vminfo) && ($vminfo->{power}//'') ne 'poweredOff'; + return { type => 'vm', source => 'esxi',