Archive/XCP DRBD

From Xen
Jump to: navigation, search

Introduction

DRBD provides HA for block level devices, essentially allowing the possibility of a replicated SR across multiple XCP instances.

Architecture to allow XenMotion

A dual-primary DRBD device is created spanning two hosts in a resource pool. This device is set up as an LVM SR in the resource pool. VM VDIs are then stored on the SR.

Potential problems

All VMs sharing the same SR must run on the same host to avoid a split-brain situation, which could require manual intervention to rectify and could potentially cause data loss. When VMs are migrated across hosts, they should be separated for only a short time to minimize risk.

When migrating the master role to a slave host, management network interfaces are temporarily brought down and back up. This breaks DRBD replication, again requiring manual intervention. This might be worked around by running DRBD replication on separate network interfaces (needs to be confirmed).

Install

Linbit provides a full install guide here: http://www.linbit.com/fileadmin/tech-guides/xenserver-drbd.pdf

The only modification needed for XCP is the RPMs to be installed need to be those created specifically for XCP, with further directions below.

Source Build

Install the build tools

sed -i -e "s/enabled=0/enabled=1/" /etc/yum.repos.d/CentOS-Base.repo
sed -i -e "s/enabled=1/enabled=0/" /etc/yum.repos.d/Citrix.repo
yum install gcc flex rpm-build redhat-rpm-config make libxslt

Install the kernel development package from the XCP 1.5 beta binary packages ISO

rpm -i kernel-xen-devel-2.6.32.12-0.7.1.xs1.4.90.530.170661.i686.rpm
#might need to put this somewhere else and remote mount it via nfs
wget http://downloads.xen.org/XCP/53341/sources/binpkg.iso
mount -o loop binpkg.iso /mnt
cd /mnt/domain0/RPMS/i686
rpm -i kernel-xen-devel-2.6.32.12-0.7.1.xs1.4.90.530.170661.i686.rpm

Note: http://downloads.xen.org/XCP/53341 contains a beta build. You may want to use 61809c instead (XCP 1.6). We may remove (or not back up) unreleased binaries at some point in future.

Download and build DRBD

mkdir /drbd/
cd /drbd/
wget http://oss.linbit.com/drbd/8.4/drbd-8.4.1.tar.gz
tar zxvf drbd-8.4.1.tar.gz
cd drbd-8.4.1
./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc --with-km
make tgz drbd.spec drbd-km.spec
cp drbd*.tar.gz `rpm -E %_sourcedir`
rpmbuild -bb drbd.spec
rpmbuild -bb drbd-km.spec

You now have RPMs in /usr/src/redhat/RPMS/i386/drbd

Downloads

XCP 1.5 Beta

Locatrix Communications has provided a repository with the 8.4.1 RPMs (32-bit only, no sources) pre-built for XCP 1.5 Beta: http://download.locatrix.com/drbd/

For XCP binaries: see http://xenproject.org/downloads/xen-cloud-platform-archives.html

References