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.', description => 'What this warning is about.',
enum => [ enum => [
'cdrom-image-ignored', 'cdrom-image-ignored',
'guest-is-running',
'nvme-unsupported', 'nvme-unsupported',
'ovmf-with-lsi-unsupported', 'ovmf-with-lsi-unsupported',
'serial-port-socket-only', 'serial-port-socket-only',

View File

@ -903,6 +903,7 @@ sub get_create_args {
my $storeid = $self->storeid; my $storeid = $self->storeid;
my $manifest = $self->manifest; my $manifest = $self->manifest;
my $vminfo = $manifest->vm_for_vmx_path($self->vmx_path);
my $create_args = {}; my $create_args = {};
my $create_disks = {}; my $create_disks = {};
@ -1052,6 +1053,8 @@ sub get_create_args {
++$serid; ++$serid;
}); });
$warn->('guest-is-running') if defined($vminfo) && ($vminfo->{power}//'') ne 'poweredOff';
return { return {
type => 'vm', type => 'vm',
source => 'esxi', source => 'esxi',