Clone of Template fails

Boss

Member
Apr 22, 2024
42
1
13
Hi - Running PVE 9.2.10
I've created a WS 2025 VM and then converted it to a template. As well the system disk, it has an EFI and TPM disks, both 4M
When I try to create a full clone from the template, it fails at the start when creating the efidisk.
This is the first time I've tried to clone a template. Any thoughts on a solution for this issue?
Checked and there is no existing vm-103 -disk-* on the storage.

Code:
creating a clone of VM 110 with ID 103
create full clone of drive efidisk0 (NAS401_0:vm-110-disk-0)
  Rounding up size to full physical extent 4.00 MiB
  device-mapper: create ioctl on NAS401_0-vm--103--disk--0 LVM-2svtJUeVsjpmNesBibJbJVSWRawgFB57apGMF9223aZ1n1oPbVgnKWOfQ1w4QulA failed: Device or resource busy
TASK ERROR: clone failed: lvcreate 'NAS401_0/vm-103-disk-0' error:   Failed to activate new LV NAS401_0/vm-103-disk-0.
 
Last edited:
Thanks for your prompt responses!

lvs command returns nothing

# dmsetup ls | grep 103
NAS401_0-vm--103--disk--0 (252:6)
NAS401_0-vm--103--disk--1 (252:7)
NAS401_0-vm--103--disk--2 (252:8)
 
NAS401_0-vm--103--disk--0 (252:6)
NAS401_0-vm--103--disk--1 (252:7)
NAS401_0-vm--103--disk--2 (252:8)
The LVs are gone but the kernel devices were never removed.

Double check they're not in use:
dmsetup info -c | grep 103

If that outputs zero you can safely remove them and try to create the VM again:
dmsetup remove NAS401_0-vm--103--disk--0
dmsetup remove NAS401_0-vm--103--disk--1
dmsetup remove NAS401_0-vm--103--disk--2
 
  • Like
Reactions: gfngfn256
Would be interesting to know how the OP removed the VM103 originally and what options he chose at that time.
 
Many thanks for pointing me in the right direction - I removed the orphaned disks with the dmsetup command. And can now clone from a template using that VMID 103.

FYI - I removed the VM via the PVE web interface and ticked the boxes for "Purge job configurations" & "Destroy unreferenced disks" (even though it didn't have any other unused disks). The remove VM operation reported OK - output below:

Code:
Logical volume "vm-103-disk-2" successfully removed.
  Logical volume "vm-103-disk-0" successfully removed.
  Logical volume "vm-103-disk-1" successfully removed.
purging VM 103 from related configurations..
TASK OK
 
  • Like
Reactions: gfngfn256
FYI - I removed the VM via the PVE web interface
Thanks for the added info.

I'm not sure what to make of this, why the device mappers still existed for these LV disks. Would also be interesting to know, if the host node was rebooted after the VM deletion. (Not that this should be necessary).