cluster-aware file locking using ocfs2 and Xen
We are running a Debian Squeeze cluster using ocfs2 and Xen, the
virtualisation technology. We want to enable locking such that once a VM
is created with xen xm create it cannot be created a 2nd time, either by
the creating node or by any other node in the cluster.
To implement locking of this kind, we installed ocfs2-tools 1.6.3.2, and
a Suse patch to Xen that enables lockage of VMs by means of a bash
script that executes flock().
The locking works fine locally--subsequent xm creates on the same node
are blocked, and a message returned saying 'VM already exists with ID
###, etc'.
But xm create run from a node other than the creating node creates,
erroniously, the VM. So we have local, but cluster-wide, flock()
functionality.
1. A cat /proc/mounts does not show that localflock() has been
accidentally activated.
2. I have double-checked that o2cb and ocfs2 processes are running on
both nodes in the cluster.
The documentation and commentary is not so clear: one page says that the default ocfs2 cluster management process, o2cb, does not handle cluster-aware locking.
But on the other hand, ocfs2 docs say 'cluster aware flock()' has been implemented as of ocfs2-tools 1.4.
do bugs remain in ocfs2-tools 1.4, or can cluster-aware locking be done? If so, can it be done running o2cb, or does a user-space cluster management system have to be used?
Any ideas? Any perspectives or comments are greatly appreciated!
|