why snapshot works on lvm (not thin)?

hanzfritz85

Member
Dec 15, 2018
43
0
11
36
Dear All,
Looks like I can do a snapshot on LVM (not thin)

below are the details

Am I missing something?
 
Last edited:
LVM version: 2.02.168(2) (2016-11-30)
Library version: 1.02.137 (2016-11-30)
Driver version: 4.35.0

LVM version: 2.02.168(2) (2016-11-30)
Library version: 1.02.137 (2016-11-30)
Driver version: 4.39.0
 
If you can use snapshot, you either use lvm thin, or file based images with qcow2, on a filesystem, on an lvm volume. But you can't use snapshot with non thin lvm directly
Yes, exactly, i use raw and qcow2 vm disks on ext4 over lvm. Can you please point me to the right direction where I can get more info about that? You state it is as it's an expected behavior, but it is a surprise for me.
 
If you use file based images, it doesn't really matters what's under the filesystem (could be a standard lvm, thin lvm, raw partition, nfs etc...). You just rely on the qcow2 format to provide snapshots features. But proxmox can also use raw lvm volume as images (in which case there's no filesystem, so no file either). In this case, standard lvm can't use snapshots (but has the advantage of being shareable, for example on a shared iscsi lun). And thin lvm can use snapshots (lvm level snapshots)
 
  • Like
Reactions: hanzfritz85
If you use file based images, it doesn't really matters what's under the filesystem (could be a standard lvm, thin lvm, raw partition, nfs etc...). You just rely on the qcow2 format to provide snapshots features. But proxmox can also use raw lvm volume as images (in which case there's no filesystem, so no file either). In this case, standard lvm can't use snapshots (but has the advantage of being shareable, for example on a shared iscsi lun). And thin lvm can use snapshots (lvm level snapshots)
It's absolutely clear now.
And according to https://pve.proxmox.com/wiki/Storage
All storage types which have the “Snapshots” feature also support thin provisioning.​

Thank you for clarification!
 
In this case, standard lvm can't use snapshots (but has the advantage of being shareable, for example on a shared iscsi lun). And thin lvm can use snapshots (lvm level snapshots)

You can also create snapshots on thick LVM, but it is as with thin LVM not cluster aware and will therefore not work in a clustered setup. LVM thick snapshots are different than "normal" VM snapshots and do have a size. If the snapshot is full, it is not working anymore. Totally incompatible with the modern age of immutable VM snapshots.
 
  • Like
Reactions: hanzfritz85
You can also create snapshots on thick LVM, but it is as with thin LVM not cluster aware and will therefore not work in a clustered setup. LVM thick snapshots are different than "normal" VM snapshots and do have a size. If the snapshot is full, it is not working anymore. Totally incompatible with the modern age of immutable VM snapshots.
Hm. You mean snapshot on thick LVM is not a point in time logical snapshot, but more a full backup of vm disk + ram?
 
Hm. You mean snapshot on thick LVM is not a point in time logical snapshot, but more a full backup of vm disk + ram?

No, unfortunately neither. A snapshot is the place where all changed blocks will be written to and if the space is exhausted, your snapshot is useless. Therefore you have to create the new snapshot with the same size as the old disk in order to never run out of space.

More information can be found here: https://www.tecmint.com/take-snapshot-of-logical-volume-and-restore-in-lvm/
 
No, unfortunately neither. A snapshot is the place where all changed blocks will be written to and if the space is exhausted, your snapshot is useless.

Besides that, is there any reason that Proxmox doesn't supports thick LVM snapshots, esspecially in a LVM-over-iSCSI scenario? Is it safe to create them manually via the LVM tools?
 
Besides that, is there any reason that Proxmox doesn't supports thick LVM snapshots, esspecially in a LVM-over-iSCSI scenario? Is it safe to create them manually via the LVM tools?
LVM thick snapshots basically only serve on purpose - getting a frozen view of the LV so that you can make a backup. PVE uses other mechanisms for that (Qemu copy-before-write), They are not workable for snapshots that are kept around, so they are not supported. Of course you can manually create such a snapshot on the storage layer, PVE will not interfere with it in any way AFAIK. I am not sure how it might negatively affected migration in case the VG is shared across a cluster via iSCSI.
 
LVM thick snapshots basically only serve on purpose - getting a frozen view of the LV so that you can make a backup. PVE uses other mechanisms for that (Qemu copy-before-write), They are not workable for snapshots that are kept around, so they are not supported. Of course you can manually create such a snapshot on the storage layer, PVE will not interfere with it in any way AFAIK. I am not sure how it might negatively affected migration in case the VG is shared across a cluster via iSCSI.
thick LVM snapshots are also something completely different than thin snapshots. They have a given space and - as fabian already wrote - are only there to get a frozen view. If you write a block on your logical volume, the old block will be written into the snapshot, so that it'll always represent the data of the snapshot but if you run out of space for changes, your snapshot will get invalid and useless.
 

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!