Sharing disk partitions between Xen instances

Picture this, you have your Xen server and a couple of virtual instances configured and you are very happy. That is however until you want two or more of those instances to read or write files from the same disk partition. One way to get around this problem is to use a network file sharing protocol like NFS or CIFS and have one instance operate as a file server whilst the others connect as clients. Sure, a configuration like this works but it requires quite a bit of time to setup and more importantly it drains precious processor cycles as many extra, resource intensive processes must be run.

Steve Wray pointed out to me a clever way of achieving this task with kpartx. This tool works with LVM and creates pseudo logical volumes so that two Xen instances can mount the same piece of disk real-estate. Setting up your virtual file system with kpartx is a lot less work than configuring and testing a network file sharing system, plus it is less processor intensive as the network layer is not required (sharing occurs at the block level). There are a couple of useful howto's describing how to set kpartx up, the most useful one is on the Fedora Wiki whilst it is also mentioned on XenSource's own Wiki.

I personally cannot vouch for this approach but it seems very sensible and if stable would provide a far more efficient virtualised disk sharing platform than network based file-sharing. Hopefully it does prove to be stable and in the future gain support within Xen configuration tools like Novell's. And by the way, am I the only person who thinks it is stupid that Novell's Xen configuration tool can only be run from within an X-Windows session and does not have an ncurses-based equivalent for console users (arguably the majority for production servers)?