At times, after many live migrations between different disk, and whilst using TrueNAS Scale, you’ll encounter the following error:
Cannot remove image, a guest with VMID ‘139’ exists!
You can delete the image from the guest’s hardware pane
However, when you look at the hardware pane, there is no disk. The best advice on the forum is to do this on the Hypervisor where the VM is located:
qm rescan --vmid ID
However, sometimes even this doesn’t work, as can be seen on the output below:
root@hv:~# qm rescan --vmid 139 rescan volumes... Could not find lu_name for zvol vm-139-disk-0 at /usr/share/perl5/PVE/Storage/ZFSPlugin.pm line 118. root@hv:~# qm rescan --vmid 150 rescan volumes... Could not find lu_name for zvol vm-150-disk-0 at /usr/share/perl5/PVE/Storage/ZFSPlugin.pm line 118.
What we have here is a situation of bad disks or problems during the transfer. What has happened is the LUN has become disconnected at TrueNAS Core. The screenshot below illustrates:
On this diagram, vm-150-disk-0 has become detached. The only solution we found is to delete the disk at TrueNAS Core.
WARNING: This might destroy your data if you make a mistake.