VM protection mode added

used to prevent an unintended virtual machine remove operation

v3 changes:

- changed man page message
- removed protection parameter (where not needed)
This commit is contained in:
Alen Grizonic 2015-09-03 15:35:37 +02:00 committed by Dietmar Maurer
parent 1dbd6d30e0
commit cb0e4540f7
2 changed files with 9 additions and 0 deletions

View File

@ -1142,6 +1142,9 @@ __PACKAGE__->register_method({
my $storecfg = PVE::Storage::config(); my $storecfg = PVE::Storage::config();
die "can't remove VM $vmid - protection mode enabled\n"
if ($conf->{protection} == 1);
die "unable to remove VM $vmid - used in HA resources\n" die "unable to remove VM $vmid - used in HA resources\n"
if PVE::HA::Config::vm_is_ha_managed($vmid); if PVE::HA::Config::vm_is_ha_managed($vmid);

View File

@ -384,6 +384,12 @@ EODESCR
maxLength => 256, maxLength => 256,
optional => 1, optional => 1,
}, },
protection => {
optional => 1,
type => 'boolean',
description => "Sets the protection flag of the VM. This will prevent the remove operation.",
default => 0,
},
}; };
# what about other qemu settings ? # what about other qemu settings ?