[pve-devel] pve-manager: bug or feature?

Fabian Grünbichler f.gruenbichler at proxmox.com
Mon Jun 12 13:20:13 CEST 2017


On Mon, Jun 12, 2017 at 12:17:09PM +0200, datanom.net wrote:
> Hi all,
> 
> During my development of the FreeNAS plugin it think I might have stumbled
> upon a bug in pve-manager.

that code is in qemu-server / pve-storage though :P

> 
> What I try to do:
> Delete a VM which is converted to a template where linked clones exists.
> Expected outcome:
> To see an error message explaining that you cannot delete a template VM if
> there exists dependent linked clones and the job should be logged as failed.
> What I see:
> An error in the job log file like this: "Could not remove disk
> 'freenas:base-105-disk-1', check manually: base volume 'base-105-disk-1' is
> still in use by linked clones" but the job is logged as OK and the vmid.conf
> file is removed but all disks are left untouched since no call are made to
> vdisk_free.
> 

you are wrong - vdisk_free is called, but if it fails it is treated as
non-fatal error (since we want to destroy the whole VM), and a simple
warning is logged. this is correct and intended, because once you delete
the first disk, the VM is broken anyhow, even if you can't free the
second(/third/fourth/..) disk...

vdisk_free does a check if the volume is a base volume which is still
referenced by a linked clone, which is why you get the warning in the
log. it probably makes sense to add an additional check and iterate over
all disks and check if they are base and used iff the VM is a template.




More information about the pve-devel mailing list