To LVM or not to LVM a VM, that is the question...

Faris Raouf

Well-Known Member
Mar 19, 2018
147
28
58
I am curious to know what Proxmox users' thoughts are on whether or not to use LVM in a simple VM with local storage?

I find myself unable to decide and I could do with some advice on this.

My VMs are all for website hosting. The disk volumes are all stored on local storage and will very occasionally need to be increased in size, and this is very very very slightly easier to do with LVM than with simple partitions. I cannot imagine ever using LVM's ability to span a VG/LV across more than one disk, but it is a nice feature to have.

I will, however, quite frequently need to convert a .vma backup into .raw and attach it to the original VM in order to restore either a single file or maybe a directory.

And that's where LVM falls down. As the backup volume is essentially a clone of the VM, there will be duplicate PVs and UUIDs with the backup volume attached to the original VM. I would have to use vgimportclone or (more safely) attach the backup image to a different VM and change the VG name and UUID before attaching it to the original VM.

Without LVM, as far as I'm aware I could simply attach the backup volume to scsi1 and it would simply become sdb and can be mounted without issues.

And yet I find myself still thinking I should still be using LVM. I'm very interested to hear other people's thoughts on this.

If it makes any difference, we tend to use Centos 7 with ext4 for all our VMs. I do not yet trust Centos 7's default xfs.
 
Last edited:
Hi,

I will, however, quite frequently need to convert a .vma backup into .raw and attach it to the original VM in order to restore either a single file or maybe a directory.
You can convert raw to lvm.
LVMis a raw device so dd will do the job, but I would suggest using qemu-img.
As the backup volume is essentially a clone of the VM, there will be duplicate PVs and UUIDs with the backup volume attached to the original VM.
If you use vgdump for backup this information is not saved, because the backup is made from the guest inside and the guest see a plain blockdev.
I do not yet trust Centos 7's default xfs.
XFS is mature and stable so you could use it but I personally like ext4 too.
 

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!