Cannot remove image, a guest with VMID 'xxx' exists!

Arbru

Member
May 7, 2019
4
1
8
53
Dear sirs,

A moved vm disk (vm-122-disk-0) that is no longer in use is still present in one of my storage pools and I can't delete it. It's not in the VM configuration file:

# cat /etc/pve/qemu-server/122.conf
agent: 1
bootdisk: scsi0
cores: 3
ide2: none,media=cdrom
memory: 16384
name: nofdcbvmmar00
net0: virtio=D6:CE:48:AA:55:82,bridge=vmbr1,tag=4021
numa: 0
onboot: 1
ostype: l26
scsi0: storage_nvme:vm-122-disk-1,cache=writethrough,size=380G
scsihw: virtio-scsi-pci
smbios1: uuid=d554ac92-e277-49bc-9aec-7cfd0aeec360
sockets: 2
startup: order=1
===

# pvesm list storage_nvme
storage_nvme:vm-122-disk-0 raw 408021893120 122
storage_nvme:vm-122-disk-1 raw 408021893120 122
storage_nvme:vm-135-disk-0 raw 214748364800 135
===

How can I delete it, as Proxmox refuses to do so, as it says the VM exists.

Cheers,

Alvaro
 
do
Code:
qm rescan --vmid ID

then the disk should show up as 'unused' in the hardware tab of that vm
there you can delete it

Hi Dominik,

Thanks for the prompt answer, but it didn't work.

I tried with the VM operational and shutdown, but no difference whatsoever. :(

No snapshots attached either:

Code:
# qm listsnapshot 122
current              no-parent            You are here!

Any other ideas?
 
Last edited:
what is the output of
Code:
qm rescan
qm config ID
?
 
Hi Dominik,

Code:
root@nofdcbprox02:~# qm rescan
rescan volumes...
VM 133: add unreferenced volume 'storage01_vm:vm-133-disk-0' as 'unused0' to config.

It corrected another VM (lol), but not for VM 122.

Code:
root@nofdcbprox02:~# qm config 122
agent: 1
bootdisk: scsi0
cores: 3
ide2: none,media=cdrom
memory: 16384
name: nofdcbvmmar00
net0: virtio=D6:CE:48:AA:55:82,bridge=vmbr1,tag=4021
numa: 0
onboot: 1
ostype: l26
scsi0: storage_nvme:vm-122-disk-1,cache=writethrough,size=380G
scsihw: virtio-scsi-pci
smbios1: uuid=d554ac92-e277-49bc-9aec-7cfd0aeec360
sockets: 2
startup: order=1

Disks on the storage:
Code:
root@nofdcbprox02:~# pvesm list storage_nvme
storage_nvme:vm-122-disk-0   raw 408021893120 122
storage_nvme:vm-122-disk-1   raw 408021893120 122
storage_nvme:vm-135-disk-0   raw 214748364800 135
 
Please post the output of `pveversion -v`
 
Dominik,

Your command worked like a charm. Solved!

Code:
root@nofdcbprox00:~# pvesm list storage_nvme
storage_nvme:vm-122-disk-1   raw 408021893120 122
storage_nvme:vm-135-disk-0   raw 214748364800 135

Stoiko,

Code:
root@nofdcbprox00:~# pveversion -v
proxmox-ve: 5.4-1 (running kernel: 4.15.18-9-pve)
pve-manager: 5.4-3 (running version: 5.4-3/0a6eaa62)
pve-kernel-4.15: 5.3-3
pve-kernel-4.15.18-12-pve: 4.15.18-35
pve-kernel-4.15.18-9-pve: 4.15.18-30
pve-kernel-4.15.18-4-pve: 4.15.18-23
pve-kernel-4.15.18-1-pve: 4.15.18-19
pve-kernel-4.15.17-1-pve: 4.15.17-9
ceph: 12.2.11-pve1
corosync: 2.4.4-pve1
criu: 2.11.1-1~bpo90
glusterfs-client: 3.8.8-1
ksm-control-daemon: 1.2-2
libjs-extjs: 6.0.1-2
libpve-access-control: 5.1-8
libpve-apiclient-perl: 2.0-5
libpve-common-perl: 5.0-50
libpve-guest-common-perl: 2.0-20
libpve-http-server-perl: 2.0-13
libpve-storage-perl: 5.0-41
libqb0: 1.0.3-1~bpo9
lvm2: 2.02.168-pve6
lxc-pve: 3.1.0-3
lxcfs: 3.0.3-pve1
novnc-pve: 1.0.0-3
proxmox-widget-toolkit: 1.0-25
pve-cluster: 5.0-36
pve-container: 2.0-37
pve-docs: 5.4-2
pve-edk2-firmware: 1.20190312-1
pve-firewall: 3.0-19
pve-firmware: 2.0-6
pve-ha-manager: 2.0-9
pve-i18n: 1.1-4
pve-libspice-server1: 0.14.1-2
pve-qemu-kvm: 2.12.1-3
pve-xtermjs: 3.12.0-1
qemu-server: 5.0-50
smartmontools: 6.5+svn4324-1
spiceterm: 3.0-5
vncterm: 1.5-3
zfsutils-linux: 0.7.13-pve1~bpo2

I'm not currently using the latest version because I had to downgrade as requested on another ticket open with Arwin investigating re-transmits in one of corosync rings.
 
  • Like
Reactions: Stoiko Ivanov
mhm... weird

in any case you should be able to remove it on the cli directly with

Code:
pvesm free volumeid

where volumeid is the storage:volume string, e.g. storage_nvme:vm-YYY-disk-Z
HI,

volumes were not visible in the hardware tab of the VM, only in cli, but the proposed solution worked. THNX.

Code:
root@pm-3:~# pvesm list local-zfs
Volid                              Format  Type              Size VMID
local-zfs:vm-103-disk-0            raw     images    536870912000 103
local-zfs:vm-103-state-old raw     images     22011707392 103

root@pm-c3:~# pvesm free local-zfs:vm-103-state-old raw
Removed volume 'local-zfs:vm-103-state-old raw'

proxmox version

Code:
pveversion --v
proxmox-ve: 6.1-2 (running kernel: 5.3.13-1-pve)
pve-manager: 6.1-5 (running version: 6.1-5/9bf06119)
pve-kernel-5.3: 6.1-1
pve-kernel-helper: 6.1-1
pve-kernel-5.0: 6.0-11
pve-kernel-4.15: 5.4-9
pve-kernel-5.3.13-1-pve: 5.3.13-1
pve-kernel-5.3.10-1-pve: 5.3.10-1
pve-kernel-5.0.21-5-pve: 5.0.21-10
pve-kernel-4.15.18-21-pve: 4.15.18-48
pve-kernel-4.15.18-17-pve: 4.15.18-43
pve-kernel-4.15.18-12-pve: 4.15.18-36
ceph-fuse: 12.2.11+dfsg1-2.1+b1
corosync: 3.0.2-pve4
criu: 3.11-3
glusterfs-client: 5.5-3
ifupdown: 0.8.35+pve1
ksm-control-daemon: 1.3-1
libjs-extjs: 6.0.1-10
libknet1: 1.13-pve1
libpve-access-control: 6.0-5
libpve-apiclient-perl: 3.0-2
libpve-common-perl: 6.0-9
libpve-guest-common-perl: 3.0-3
libpve-http-server-perl: 3.0-3
libpve-storage-perl: 6.1-3
libqb0: 1.0.5-1
libspice-server1: 0.14.2-4~pve6+1
lvm2: 2.03.02-pve3
lxc-pve: 3.2.1-1
lxcfs: 3.0.3-pve60
novnc-pve: 1.1.0-1
proxmox-mini-journalreader: 1.1-1
proxmox-widget-toolkit: 2.1-1
pve-cluster: 6.1-2
pve-container: 3.0-15
pve-docs: 6.1-3
pve-edk2-firmware: 2.20191127-1
pve-firewall: 4.0-9
pve-firmware: 3.0-4
pve-ha-manager: 3.0-8
pve-i18n: 2.0-3
pve-qemu-kvm: 4.1.1-2
pve-xtermjs: 3.13.2-1
qemu-server: 6.1-4
smartmontools: 7.0-pve2
spiceterm: 3.1-1
vncterm: 1.6-1
zfsutils-linux: 0.8.2-pve2
[
 
Hey guys
Not such great with Linux have this problem here where guest doesn't want to remove please help try to read this post as best as I can but no can't catch a thing
 
Hey guys
Not such great with Linux have this problem here where guest doesn't want to remove please help try to read this post as best as I can but no can't catch a thing
Please consider opening a new thread and provide a bit more information (which error-messages do you get, what gets logged, screenshots)

I hope this helps!
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!