Removing Snapshots CLI

SawKyrom

New Member
Jun 3, 2021
20
1
3
49
Proxmox stopped working secondary to LVM full storage.

LVS command shows data 100% and several files labeled snap_vm...

I would like to delete these snapshots so that I can restore functionality for the VM's, which currently will not load secondary to full storage.

I attempted: qm delsnapshot 105 snap_vm-105-disk-0_pfSense20210621 only to get error snapshot 'snap...' does not exist. The file is listed as such with lvs.

Is there another means to deleting snapshots in order to free space?
 

bbgeek17

Active Member
Nov 20, 2020
644
120
43
www.blockbridge.com
Perhaps you have orphaned snapshots, this quick loop should tell you what proxmox thinks is present and deleteable:

for v in $(qm list|egrep -v VMID|awk '{print $1}');do for s in $(qm listsnapshot $v|egrep -v current|awk '{print $2}');do echo qm delsnapshot $v $s;done;done
qm delsnapshot 200 snap1
qm delsnapshot 200 snap2

If there are other snapshots you can try removing the them directly at your own risk.


Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
  • Like
Reactions: SawKyrom

SawKyrom

New Member
Jun 3, 2021
20
1
3
49
For anyone who urgently needs space and can sacrifice a VM in order to free LVM-thin space and thus regain functionality, you can use the following command to permanently remove a sacrificial VM:

lvs
remove <vm name>

lvs will show LV data with <100% and should function once more.

*Do NOT try to extend the lvm-thin drive with the following command:

lvresize --size +1G --poolmetadatasize +16M <VG/LV>

Doing so results in reboot error:

Volume group "pve" not found
Cannot process volume group pve
/dev/mapper/pve-root: recovering journal
/dev/mapper/pve-root: clean, 66068/4308992 files, 8793010/17235969 blocks

I am now unable to access proxmox via host IP:8006. Only command line CLI functions. Reports error:
EXT4-fs error (device dm-15): ext4_mb_generate_buddy:747: group 1, block bitmap and bg descriptor inconsistent: 2616 vs 613 free clusters
 

SawKyrom

New Member
Jun 3, 2021
20
1
3
49
@bbgeek17 Thank you for the suggestion. The code entered returned error: -bash: awk{print $1}: command not found.

However, using your code I was able to tease out the correct means to removing snapshot from CLI:

lvs (list snapshots on VG designated as snap_*) qm listsnapshot <VM number> (will list the snapshot name after -> designation) qm delsnapshot <VM number> <snapshot name>

This will free up valuable space on LVM-thin when the Data% 100 and you receive I/O error.

Now I need to start a new Topic on the

"EXT4-fs error (device dm-15): ext4_mb_generate_buddy:747: group 1, block bitmap and bg descriptor inconsistent: 2616 vs 613 free clusters"

I caused by doing an lvresize on VG/LV. :oops:
 

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 your own in 60 seconds.

Buy now!