Using LVM2 volume groups shared

We have a little SAN storage and using LVM2 to manage the storage. It is possible to create one volume group with logical volumes for both hosts. So I could create one volume group and use the logical volumes for XEN DomUs on both hosts. The only thing I have to do is activate the logical volumes either all volumes of the VG or each logical volumes separately.

But is this a good idea? Is this how it should work or is this a misuage and LVM2 is not capable of preventing such a configuration?

Hi A13923,

there was something called “cLVM” (cluster-aware LVM) which would be what you’d need to handle things the way you started. IIRC, cLVM is discontinued since SLES11SPx.

There are other ways of doing this, too: Depending on your SAN, you could use iSCSI or NPIV LUNs per VM or use OCFS2 to created a shared /var/lib/xen/images and use file-based disks.

From my experience, I prefer solutions that give each VM individual disk resources, accessible via some sort of network. Most use iSCSI LUNs for this. You can then administer resource allocation at the SAN storage (which is designed to handle this) and VMs can access “their” storage independent of the server they run on.

Regards,
Jens

It should still be part of the added HAE pack for SLES.

Our clustered Xen setups run on plain SLES though (no HAE), the DomUs/VMs get thier OS disk on a shared LVM VG volume. Locking on the Xen hosts ensures a guest does not get started multiple times and we have some small scripts that run every couple of minutes that keep configurations across hosts updated.
Main reason for the LVM approach for the OS disk, even if LVM is not cluster aware… is the added functionality of LVM snapshots (makes scripted dumps of domU OS disks quite an easy task while keeping downtime -if needed- to a minimum).
But it must be stressed that this requires knowlegde of correct setup and workings or one might end up with corrupt metadata.

The data disks for the DomUs/VMs are raw iSCSI devices that get passed on through the Xen host to the DomU/VMs.

As central management we are using Convirt, as it also keeps track of who’s running what and it greatly simplifies administration as it’s web based. (Look here for a quick start http://susestudio.com/a/YtQGNq/sles11sp2-convirt-xen-kvm)

So yes, it can be done and done well. Care must be taken in doing it correctly :slight_smile:

-Willem