Remove missing snapshot - thin LVM.

mailinglists

Renowned Member
Mar 14, 2012
641
67
93
On PM 4.* I wish to remove snapshot shown in the GUI, because the underlying LVM device is not there anymore (overloaded storage with disabled writeback - failed battery - was the culprint).

If I do it via the GUI it states:
Code:
lvremove snapshot 'pvesata/snap_vm-100-disk-2_brisi1' error: Failed to find logical volume "pvesata/snap_vm-100-disk-2_brisi1"

Because is isn't there:
Code:
root@p21:~# lvs -a | grep vm-100
  vm-100-disk-1                       pvesata Vwi-aotz-- 600.00g datasata               48.29                                 
  vm-100-disk-2                       pvesata Vwi-aotz--  32.00g datasata               70.64

Can I just remove the below listed content manually from /etc/pve/qemu-server/100.conf?
And do nothing else?

Code:
[brisi1]
agent: 1
boot: cdn
bootdisk: scsi0
cores: 6
cpu: host
machine: pc-i440fx-2.7
memory: 24000
name: XXX
net0: virtio=86:89:99:DD:3B:07,bridge=vmbr0,firewall=1,rate=15,tag=115
net1: virtio=DE:93:63:E4:C1:51,bridge=vmbr1,tag=600
numa: 1
onboot: 1
ostype: l26
scsi0: local-lvm-sata:vm-100-disk-2,cache=writeback,discard=on,size=32G
scsi1: local-lvm-sata:vm-100-disk-1,backup=0,cache=writeback,discard=on,size=600G
scsihw: virtio-scsi-pci
smbios1: uuid=4b0a9e5c-6cce-43f7-8a82-b967b7ee19db
snapstate: delete
snaptime: 1527543444
sockets: 3
 
You can delete the snapshot entry from the file, then it disappears from the GUI/CLI.
 
  • Like
Reactions: GuiltyNL
root@pve1:~# pct delsnapshot 1015 vzdump
lvremove snapshot 'pve/snap_vm-1015-disk-1_vzdump' error: Failed to find logical volume "pve/snap_vm-1015-disk-1_vzdump"
The volume removal "failed", this leaves the entry in the config file. To remove the entry, you run the same command with -force.

Proxmo version is 5.2-8.
Update to the latest version.
 
The volume removal "failed", this leaves the entry in the config file. To remove the entry, you run the same command with -force.

Hi Alwin, thanks for your answer.
I was just deleting the post because I was doing wrong the entry deletion on the pct config file.


Update to the latest version.
Yes.
In progress, I'm setting up a new cluster to migrate from thisold one.

Thanks again.
Best.
 
You can delete the snapshot entry from the file, then it disappears from the GUI/CLI.
Hello Alvin

Which lines to remove exactly, snapstate and snaptime or the complete block?

Kind regards
Mike

root@vmhost16:/etc/pve/qemu-server# cat 111.conf

#SERVER
#SERVER
agent: 1
bios: ovmf
boot: c
bootdisk: scsi0
cores: 2
efidisk0: local-lvm:vm-111-disk-1,size=4M
memory: 6144
name: SERVER08
net0: e1000=00:50:56:99:91:30,bridge=vmbr96
numa: 0
onboot: 1
ostype: l26
scsi0: local-lvm:vm-111-disk-0,size=50G
scsihw: pvscsi
smbios1: uuid=64aea561-84c8-4ebf-917a-d5a0ba4ed300
sockets: 1
vmgenid: e5348f88-3d80-4676-957a-935a9f041d82

[vor_installation_mysql]
#vor_installation_mysql
agent: 1
bios: ovmf
boot: c
bootdisk: scsi0
cores: 2
efidisk0: local-lvm:vm-111-disk-1,size=4M
memory: 6144
name: SERVER08
net0: e1000=00:50:56:99:91:30,bridge=vmbr96
numa: 0
onboot: 1
ostype: l26
runningcpu: kvm64,enforce,+kvm_pv_eoi,+kvm_pv_unhalt,+lahf_lm,+sep
runningmachine: pc-i440fx-5.1+pve0
scsi0: local-lvm:vm-111-disk-0,size=50G
scsihw: pvscsi
smbios1: uuid=64aea561-84c8-4ebf-917a-d5a0ba4ed300
snapstate: delete
snaptime: 1610610089
sockets: 1
vmgenid: e5348f88-3d80-4676-957a-935a9f041d82
 
Last edited:
Which lines to remove exactly, snapstate and snaptime or the complete block?
Run that command with -force if the snapshot doesn't exist anymore.
root@pve1:~# pct delsnapshot <vmid> <snap> -force
 
Run that command with -force if the snapshot doesn't exist anymore.
root@pve1:~# pct delsnapshot <vmid> <snap> -force
Hello Alvin

The error while removing the Snapshot was:
"lvremove snapshot 'pve/snap_vm-111-disk-0_vor_installation_mysql' error: Failed to find logical volume "pve/snap_vm-111-disk-0_vor_installation_mysql""

The snapshot does not exist anymore:
root@vmhost16:/etc/pve/qemu-server# lvs -a | grep vm-111
vm-111-disk-0 pve Vwi-aotz-- 50.00g data 100.00
vm-111-disk-1 pve Vwi-aotz-- 4.00m data 3.12

<vmid> is clear, that is the ID of the VM. Im my case 111. But what is the <snap> Parameter, where do I take it from? Is it pve/snap_vm-111-disk-0_vor_installation_mysql? in that case the command would be:

pct delsnapshot 111 pve/snap_vm-111-disk-0_vor_installation_mysql -force

is that correct?

Kind regards
Mike
 
Last edited:
See pct help delsnapshot. :)
 
See pct help delsnapshot. :)
root@vmhost16:/etc/pve/qemu-server# pct help delsnapshot
USAGE: pct delsnapshot <vmid> <snapname> [OPTIONS]

Delete a LXC snapshot.

<vmid> <integer> (1 - N)

The (unique) ID of the VM.

<snapname> <string>

The name of the snapshot.

-force <boolean>

For removal from config file, even if removing disk snapshots
fails.

root@vmhost16:/etc/pve/qemu-server# pct delsnapshot 111 pve/snap_vm-111-disk-0_vor_installation_mysql -force
400 Parameter verification failed.
snapname: invalid format - invalid configuration ID 'pve/snap_vm-111-disk-0_vor_installation_mysql'

pct delsnapshot <vmid> <snapname> [OPTIONS]
root@vmhost16:/etc/pve/qemu-server# pct delsnapshot 111 snap_vm-111-disk-0_vor_installation_mysql -force
400 Parameter verification failed.
snapname: value may only be 40 characters long
pct delsnapshot <vmid> <snapname> [OPTIONS]
root@vmhost16:/etc/pve/qemu-server#

Please excuse but after readig the help, I still don't know where to take the <snapname> from, please advise.

Kind regards
Mike
 
pct help, will list all the commands and options for the tool. With eg. pct help listsnapshots and gather the name of the snapshot in question. Then you can run the delsnapshot.

And with man pct you can get the help page for it as well.
 
pct help, will list all the commands and options for the tool. With eg. pct help listsnapshots and gather the name of the snapshot in question. Then you can run the delsnapshot.

And with man pct you can get the help page for it as well.

root@vmhost16:/etc/pve/qemu-server# pct help listsnapshots
ERROR: unknown command 'listsnapshots'
USAGE: pct <COMMAND> [ARGS] [OPTIONS]

pct clone <vmid> <newid> [OPTIONS]
pct create <vmid> <ostemplate> [OPTIONS]
pct destroy <vmid> [OPTIONS]
pct list
pct migrate <vmid> <target> [OPTIONS]
pct move_volume <vmid> <volume> <storage> [OPTIONS]
pct pending <vmid>
pct resize <vmid> <disk> <size> [OPTIONS]
pct restore <vmid> <ostemplate> [OPTIONS]
pct template <vmid>

pct config <vmid> [OPTIONS]
pct set <vmid> [OPTIONS]

pct delsnapshot <vmid> <snapname> [OPTIONS]
pct listsnapshot <vmid>
pct rollback <vmid> <snapname>
pct snapshot <vmid> <snapname> [OPTIONS]

pct reboot <vmid> [OPTIONS]
pct resume <vmid>
pct shutdown <vmid> [OPTIONS]
pct start <vmid> [OPTIONS]
pct stop <vmid> [OPTIONS]
pct suspend <vmid>

pct console <vmid> [OPTIONS]
pct cpusets
pct df <vmid>
pct enter <vmid>
pct exec <vmid> [<extra-args>]
pct fsck <vmid> [OPTIONS]
pct fstrim <vmid> [OPTIONS]
pct mount <vmid>
pct pull <vmid> <path> <destination> [OPTIONS]
pct push <vmid> <file> <destination> [OPTIONS]
pct rescan [OPTIONS]
pct status <vmid> [OPTIONS]
pct unlock <vmid>
pct unmount <vmid>

pct help [<extra-args>] [OPTIONS]

root@vmhost16:/etc/pve/qemu-server# pct listsnapshots
ERROR: unknown command 'pct listsnapshots'

root@vmhost16:/etc/pve/qemu-server# pct listsnapshot 111
Configuration file 'nodes/vmhost16/lxc/111.conf' does not exist

I dont have a LXC container I have a VM.

root@vmhost16:/etc/pve/qemu-server# pct delsnapshot 111 vor_installation_mysql -force
Configuration file 'nodes/vmhost16/lxc/111.conf' does not exist


How can I find out the name of the snapshot in question?

Kind regards
Mike
 
Last edited:
With the tools (pct) I could not determine the name of the snapshot with the instructions given. I finally removed the following lines (Strike-through) out of the vm config file and it worked:

root@vmhost16:/etc/pve/qemu-server# nano 111.conf

#SERVER
#SERVER
agent: 1
bios: ovmf
boot: c
bootdisk: scsi0
cores: 2
efidisk0: local-lvm:vm-111-disk-1,size=4M
memory: 6144
name: SERVER08
net0: e1000=00:50:56:99:91:30,bridge=vmbr96
numa: 0
onboot: 1
ostype: l26
scsi0: local-lvm:vm-111-disk-0,size=50G
scsihw: pvscsi
smbios1: uuid=64aea561-84c8-4ebf-917a-d5a0ba4ed300
sockets: 1
vmgenid: e5348f88-3d80-4676-957a-935a9f041d82

[vor_installation_mysql]
#vor_installation_mysql
agent: 1
bios: ovmf
boot: c
bootdisk: scsi0
cores: 2
efidisk0: local-lvm:vm-111-disk-1,size=4M
memory: 6144
name: SERVER08
net0: e1000=00:50:56:99:91:30,bridge=vmbr96
numa: 0
onboot: 1
ostype: l26
runningcpu: kvm64,enforce,+kvm_pv_eoi,+kvm_pv_unhalt,+lahf_lm,+sep
runningmachine: pc-i440fx-5.1+pve0
scsi0: local-lvm:vm-111-disk-0,size=50G
scsihw: pvscsi
smbios1: uuid=64aea561-84c8-4ebf-917a-d5a0ba4ed300
snapstate: delete
snaptime: 1610610089
sockets: 1
vmgenid: e5348f88-3d80-4676-957a-935a9f041d82


Thank you for your help
Mike
 
Last edited:
  • Like
Reactions: NCom

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!