-   Linux - Server (
-   -   Why always LVM in HA environments? (

IMNOboist 02-10-2012 02:05 PM

Why always LVM in HA environments?
I'm looking to get a Xen cluster running (using drbd, Pacemaker and OCFS2) and nearly every how-to I look at uses LVM and creates a new LV for each virtual machine.

Looking further, a how-to on creating an HA NFS cluster does something similar, creating a new LV for each NFS export.

Why does LVM get used so much in environments like this? I suppose I could see the usage on NFS, but with the Xen cluster, having to create a new LV for each virtual machine adds a lot of extra work.

acid_kewpie 02-10-2012 02:16 PM

My understanding is that the creation of a new LV gives a flexible way to create a block device that is not sitting on top of a filesystem. If you create a disk file, then that has to traverse ext4 (or other) before hitting disk. By using LVM there is no filesystem in the way to put overhead on it. I think it's pretty slick actually, and it's really NOT a lot of extra work at all.

IMNOboist 02-10-2012 02:23 PM

Thanks acid_kewpie. So you think it's done for performance reasons, then? From the small amount of evidence I've read I was getting the impression that Pacemaker prefers it to be on an LVM for some sort of management reason. Perhaps so it can control the locking of the virtual disk better.

Do I understand correctly that when you have Xen access a LV, the LV doesn't need to have a filesystem? Not even OCFS2? How are concurrent writes prevented? Through Pacemaker?

Sorry to bombard with more questions.

acid_kewpie 02-10-2012 02:37 PM

Well I'm no clustered filesystem expert, someone else, probably you, are a better judge of that side, but as far as the usage of it, you'd have a block device presented which would be your VG, and then further LV's on that would be independent block devices. You would be using those LV's in a way that should be managed to not require concurrent writes. You should have no reason to think a virtual disk is going to be accessed by more than one VM in the first place.

All times are GMT -5. The time now is 07:16 PM.