[Linux-HA] getting heartbeat2, drbd, and xen to work

Michael Grant mgrant at grant.org
Sat Jan 31 03:01:39 MST 2009


I'm trying to set up heartbeat-2 to manage xen in a drbd device over a
cluster of 2 servers.

In the syslog I see this:
xen-strange^I(heartbeat::ocf:Xen):^IStarted strange.example.org
Master/Slave Set: drbd_root1
    c65f6e43-32d4-42cd-a798-691e6f494cc5:0^I(ocf:drbd):^IStarted
strange.example.org (unmanaged) FAILED
    c65f6e43-32d4-42cd-a798-691e6f494cc5:1^I(ocf:drbd):^IStarted
strange.example.org (unmanaged) FAILED

my drbd resource looks like this:

<master_slave id="drbd_root1">
  <instance_attributes>
    <attributes>
      <nvpair name="clone_max" value="2"/>
      <nvpair name="globally_unique" value="true"/>
      <nvpair name="master_max" value="1"/>
    </attributes>
  </instance_attributes>
 <primitive type="drbd" class="ocf">
  <instance_attributes id="ia_drbd_root1">
    <attributes>
      <nvpair id="at_drbd_root1"
              name="drbd_resource"
              value="root1"/>
     </attributes>
  </instance_attributes>
 </primitive>
</master_slave>


My xen resource looks like this:

<resources>
 <primitive id="xen-strange" class="ocf" type="Xen" provider="heartbeat">
  <operations>
   <op id="xen-strange-op01" name="monitor" interval="10s" timeout="60s" prereq=
"nothing"/>
   <op id="xen-strange-op02" name="start" timeout="60s" start_delay="0"/>
   <op id="xen-strange-op03" name="stop" timeout="300s"/>
 </operations>
 <instance_attributes id="xen-strange">
  <attributes>
   <nvpair id="xen-strange-attr01" name="xmfile" value="/etc/xen/strange.xm"/>
   <nvpair id="xen-strange-attr02" name="target_role" value="started"/>
  </attributes>
 </instance_attributes>
 <meta_attributes id="xen-strange-meta01">
  <attributes>
   <nvpair id="xen-strange-meta-attr01" name="allow_migrate" value="true"/>
  </attributes>
 </meta_attributes>
 </primitive>
</resources>

I also have an rsc_order so root1 is started (not mounted, but drbd is
started primary):

<rsc_order id="order-root1-strange"
 from="xen-strange" type="after" to="drbd_root1"/>


I have a working resource named 'root1' in my drbd.conf file, root1 is
/dev/drbd0.

Any ideas why my drbd resource is unmanaged?

I disabled drbd's LSB rc script by removing the symlinks in /etc/rc*.d
(but not /etc/init.d/drbd itself).  I understand I need to do this to
let heartbeat manage that instead.

For Xen, I see 2 lsb scripts: xend and xendomains, which of these (or
both) must I disable in /etc/rc*.d/?

One thing I noticed is that my domU's name, (the name attr in the
xen-strange.xm file), must match the primitive id name in the
resource.  I guess hearbeat uses this and the 'xm list' command to
know if the domain is running (perhaps not the greatest way to know
it's health).  Since those names must be unique in the CIB, I
prepended 'xen-' to the name of my domU, however, this forced me to
then rename the domU in the .xm file.  Maybe there is some attribute I
can set in the CIB to tell heartbeat the domU's name rather than
forcing me to rename all my domUs?

Is there something like a man page for each of these resource types
like a drbd resource, or a xen resource that tells me what the
available attributes I can use are?  I have found loads of great
examples but so far nothing that actually describes everything that's
possible.

p.s. the other node is called 'charm' in case you are wondering why I
choose the name 'strange' for this node.

Michael Grant


More information about the Linux-HA mailing list