5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-01-10 01:18:01 +03:00
qemu-server/PVE
Thomas Lamprecht 7585466269 vm destroy: allow opt-out of purging unreferenced disks
Since an old change released with a version bump on 2009-09-07, we
search all enabled storages for VMID maching volumes on VM removal
and purge those too.

This has multiple pitfalls and may be quite unexpected for some
users.

It can make problems when:
* on recovery a VM is created, before disks are reattached the admin
  notices some settings issues and chooses to just recreate the VM;
  but during destroying the dummy VM all related disks get destroyed
  unconditionally which may result in data loss. This actually
  happened and is the original reason for the decision to change
  this.

* a storage is shared between PVE instance (between a set of clusters
  and/or single nodes), while this is against our rules it may still
  come as a surprise if destroying a VM on node A may destroy
  unrelated and unreferenced disks on the unrelated node B without
  asking or allowing to avoid that.

As this the removal of matching but unreferenced disks can result in
permanent data loss (up to the last backup) and may be to subtle and
unforgiving, allow to opt-out of it.

In the long run we want to make this opt-in, but that is an API
change and so needs to wait for next major release. But, we can adapt
the GUI already to make it opt-in there, catching most of the cases.

side-note: CT do not have this behavior at all

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-01-25 15:22:46 +01:00
..
API2 vm destroy: allow opt-out of purging unreferenced disks 2021-01-25 15:22:46 +01:00
CLI qm: import ovf: removed all imported disks on error 2021-01-25 14:58:57 +01:00
QemuServer add PVE::QemuServer::Cgroup 2020-11-24 12:00:33 +01:00
VZDump use get_repository from PVE::PBSClient 2020-12-03 17:25:32 +01:00
Makefile buildsys: use $(MAKE) instead of make 2019-09-24 18:06:16 +02:00
QemuConfig.pm tree wide cleanup of s/return undef/return/ 2020-10-16 16:20:05 +02:00
QemuMigrate.pm migration: sort volumes migrated with storage_migrate 2020-12-15 15:21:37 +01:00
QemuServer.pm vm destroy: allow opt-out of purging unreferenced disks 2021-01-25 15:22:46 +01:00
QMPClient.pm tree wide cleanups 2020-10-16 18:03:32 +02:00