esxi: warn if the guest was running

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller
2024-03-11 13:50:16 +01:00
committed by Thomas Lamprecht
parent aba709f247
commit 1128100569
2 changed files with 4 additions and 0 deletions

View File

@ -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',

View File

@ -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',