mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-05-29 15:24:32 +00:00
destroy_vm: remove VM config *after* unused disk removal
As mentioned on the mailing list [0] disks owned by the VM and unused disks should be removed before the config file is removed. [0] https://pve.proxmox.com/pipermail/pve-devel/2019-October/039593.html Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
20faf21e87
commit
dfda979e61
@ -2592,12 +2592,6 @@ sub destroy_vm {
|
||||
|
||||
});
|
||||
|
||||
if ($keep_empty_config) {
|
||||
PVE::QemuConfig->write_config($vmid, { memory => 128 });
|
||||
} else {
|
||||
PVE::QemuConfig->destroy_config($vmid);
|
||||
}
|
||||
|
||||
# also remove unused disk
|
||||
eval {
|
||||
my $dl = PVE::Storage::vdisk_list($storecfg, undef, $vmid);
|
||||
@ -2612,6 +2606,12 @@ sub destroy_vm {
|
||||
|
||||
};
|
||||
warn $@ if $@;
|
||||
|
||||
if ($keep_empty_config) {
|
||||
PVE::QemuConfig->write_config($vmid, { memory => 128 });
|
||||
} else {
|
||||
PVE::QemuConfig->destroy_config($vmid);
|
||||
}
|
||||
}
|
||||
|
||||
sub parse_vm_config {
|
||||
|
Loading…
Reference in New Issue
Block a user