Skip to contentSkip to conversation

OCF resource agent for an LVM Volume Group

PATCH New Florian Haas 1 participant 1 message Jul 12, 2010 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 OCF resource agent for an LVM Volume Group

Hello everybody,

this is to submit an Open Cluster Framework (OCF) compliant resource agent (RA) to manage a highly available LVM Volume Group. Alasdair and I discussed this at LinuxTag in Berlin just over a month ago, and agreed it would be a good thing to carry this RA with the LVM2 CVS. A diffstat and brief FAQ are below. Any comments are much appreciated. Hope this is useful.

Cheers,
Florian

 configure.in            |   11 ++
 scripts/Makefile.in     |    8 +-
 scripts/VolumeGroup.ocf |  279 +++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 297 insertions(+), 1 deletions(-)

- So what is this good for?

This manages an LVM VG as a highly available cluster resource, enabling and disabling the VG on cluster nodes as needed.

- Which cluster manager does this play with?

Most people will use this in conjunction with the Pacemaker cluster manager (http://www.clusterlabs.org). Pacemaker is maintained by Andrew Beekhof from Red Hat.

- But doesn't Pacemaker already support this?

Yes it does, and it has for a number of years. The currently supported LVM resource agent for Pacemaker is documented here:
http://www.linux-ha.org/doc/re-ra-LVM.html

- How does the submission relate to the existing RA?

It is meant to eventually displace the RA currently living in the Linux-HA.org repository. It makes much more sense to carry the RA inside LVM2. The Linux-HA repository version will eventually be deprecated.

- How do the two versions differ at this time?

The only functional change is that the Linux-HA version still contains support for LVM 1 metadata, which has been dropped from the version being submitted here.

- Can this RA act as a direct drop-in replacement for the Linux-HA one?

For any VG with LVM2 metadata, yes.

- Does this work for clustered VGs too?

Yes it does. Pacemaker supports running this resource in "clone" mode, which in conjunction with clvmd does support clustered VGs. In that configuration, the VG is simultaneously active on multiple nodes.

- How should this be packaged?

This resource agent should probably be packaged in a separate sub-package RPM, named lvm2-resource-agents which requires both lvm2 and resource-agents.

configure.in +11 -0
index 439444f..4ba6b2a 100644
@@ -345,6 +345,7 @@ case "$REPLICATORS" in
   *) AC_MSG_ERROR([--with-replicators parameter invalid ($REPLICATORS)]) ;;
 esac
 
+
 ################################################################################
 dnl -- Disable readline
 AC_MSG_CHECKING(whether to enable readline)
@@ -362,6 +363,15 @@ AC_ARG_ENABLE(realtime,
 AC_MSG_RESULT($REALTIME)
 
 ################################################################################
+dnl -- disable OCF resource agents
+AC_MSG_CHECKING(whether to enable OCF resource agents)
+AC_ARG_ENABLE(ocf,
+            AC_HELP_STRING([--disable-ocf],
+	                   [disable Open Cluster Framework (OCF) compliant resource agents]),
+            OCF=$enableval, OCF=yes)
+AC_MSG_RESULT($OCF)
+
+################################################################################
 dnl -- Init pkg-config with dummy invokation:
 dnl -- this is required because PKG_CHECK_MODULES macro is expanded
 dnl -- to initialize the pkg-config environment only at the first invokation,
@@ -1231,6 +1241,7 @@ AC_SUBST(LVM_PATCHLEVEL)
 AC_SUBST(LVM_RELEASE)
 AC_SUBST(LVM_RELEASE_DATE)
 AC_SUBST(MIRRORS)
+AC_SUBST(OCF)
 AC_SUBST(REPLICATORS)
 AC_SUBST(MSGFMT)
 AC_SUBST(PKGCONFIG)
scripts/Makefile.in +7 -1
index 2220b9c..58b3a89 100644
@@ -29,7 +29,13 @@ vpath %.sh $(srcdir)
 
 install_lvm2: $(SCRIPTS:.sh=_install)
 
-install: install_lvm2
+install_ocf:
+ifeq ("@OCF@", "yes")
+	$(INSTALL_DIR) $(DESTDIR)/usr/lib/ocf/resource.d/lvm2
+	$(INSTALL_SCRIPT) VolumeGroup.ocf $(DESTDIR)/usr/lib/ocf/resource.d/lvm2/VolumeGroup
+endif
+
+install: install_lvm2 install_ocf
 
 # FIXME Customise for other distributions
 install_initscripts:
scripts/VolumeGroup.ocf new file +279 -0

279 lines not on this page · raw message