[Pacemaker] HA KVM over DRBD primary/secondary configuration

Gerrit Jacobsen gjacobsen at x164.com
Wed Apr 17 10:17:39 EDT 2013

High-availability KVM over DRBD active/passive with Pacemaker and Corosync:

- Two hardware nodes with two NICs. One NIC directly connected to the other node for DRBD mirroring, the second to the network, Operating system Debian Wheezy RC1 (no joy with Debian Squeeze)
- A spare partition on each machine is configured as a LVM volume group
- Inside the volume group we carve out logical volumes, one logical volume for each guest machine
- Logical volumes are mirrored with DRBD in an active/passive configuration. Each mirrored logical volume is used as a raw storage device for one KVM machine. Alternatively one could use a file system and store the VMs as files.
The setup allows flexibly move guest machines across the 2 nodes, depending on load. Also disk access is almost as fast as on physical hardware, no fancy cluster file system etc. needed. Overall it is near bare-metal performance.

We used the amazing LCMC tool for the hosts, drbd and pacemaker and Corosync setup

LCMC does lots of the setup automatic - a huge timesaver. Some fine-tuning had to be from the command line with CRM configure as the colocation and order parameters could not be configured from LCMC

Config file for hosting HA KVM machines

node ffmnode3 \
	attributes standby="off"
node ffmnode4 \
	attributes standby="off"
primitive res_VirtualDomain_1 ocf:heartbeat:VirtualDomain \
	params config="/etc/libvirt/qemu/ffmttavpx.xml" \
	operations $id="res_VirtualDomain_1-operations" \
	op start interval="0" timeout="90" \
	op stop interval="0" timeout="90" \
	op monitor interval="10" timeout="30" start-delay="0" \
	op migrate_from interval="0" timeout="60" \
	op migrate_to interval="0" timeout="120" \
	meta target-role="started" migration-threshold="1"
primitive res_drbd_1 ocf:linbit:drbd \
	params drbd_resource="ffmttapx" \
	operations $id="res_drbd_1-operations" \
	op start interval="0" timeout="240" \
	op promote interval="0" timeout="90" \
	op demote interval="0" timeout="90" \
	op stop interval="0" timeout="100" \
	op monitor interval="10" timeout="20" start-delay="0" \
	op notify interval="0" timeout="90" \
	meta target-role="started" resource-stickiness="0"
ms ms_drbd_1 res_drbd_1 \
	meta clone-max="2" notify="true" target-role="started"
colocation ms_drbd_1-with-ffmttavpx inf: res_VirtualDomain_1 ms_drbd_1:Master
order ms_drbd_1-before-ffmttavpx inf: ms_drbd_1:promote res_VirtualDomain_1:start
property $id="cib-bootstrap-options" \
	expected-quorum-votes="2" \
	stonith-enabled="false" \
	dc-version="1.1.7-ee0730e13d124c3d58f00016c3376a1de5323cff" \
	no-quorum-policy="ignore" \
rsc_defaults $id="rsc-options" \

I hope it is useful for someone.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.clusterlabs.org/pipermail/pacemaker/attachments/20130417/ab129de2/attachment-0002.html>

More information about the Pacemaker mailing list