Archive/XCP DRBD: Difference between revisions
(Created page with "=Introduction= DRBD provides HA for block level devices, essentially allowing the possibility of a replicated SR across multiple XCP instances. =Install= Linbit provides a full …") |
Lars.kurth (talk | contribs) |
||
(11 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
=Introduction= |
=Introduction= |
||
DRBD provides HA for block level devices, essentially allowing the possibility of a replicated SR across multiple XCP instances. |
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= |
=Install= |
||
Line 15: | Line 24: | ||
</pre> |
</pre> |
||
Install the kernel development package from the XCP 1.5 binary packages ISO |
Install the kernel development package from the XCP 1.5 beta binary packages ISO |
||
<pre> |
<pre> |
||
rpm -i kernel-xen-devel-2.6.32.12-0.7.1.xs1.4.90.530.170661.i686.rpm |
rpm -i kernel-xen-devel-2.6.32.12-0.7.1.xs1.4.90.530.170661.i686.rpm |
||
Line 24: | Line 33: | ||
rpm -i kernel-xen-devel-2.6.32.12-0.7.1.xs1.4.90.530.170661.i686.rpm |
rpm -i kernel-xen-devel-2.6.32.12-0.7.1.xs1.4.90.530.170661.i686.rpm |
||
</pre> |
</pre> |
||
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 |
Download and build DRBD |
||
Line 33: | Line 43: | ||
cd drbd-8.4.1 |
cd drbd-8.4.1 |
||
./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc --with-km |
./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc --with-km |
||
make tgz |
make tgz drbd.spec drbd-km.spec |
||
cp drbd*.tar.gz `rpm -E _sourcedir` |
cp drbd*.tar.gz `rpm -E %_sourcedir` |
||
rpmbuild -bb drbd.spec |
rpmbuild -bb drbd.spec |
||
rpmbuild -bb drbd-km.spec |
rpmbuild -bb drbd-km.spec |
||
Line 43: | Line 53: | ||
=Downloads= |
=Downloads= |
||
==XCP 1.5 Beta== |
==XCP 1.5 Beta== |
||
Locatrix Communications has provided a repository with the 8.4.1 RPMs pre-built for XCP 1.5 Beta: http://download.locatrix.com/drbd/ |
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= |
=References= |
||
* [https://vimeo.com/46125363 Video Tutorial for XCP + DRDB] and accompanying slides [http://www.slideshare.net/xen_com_mgr/oscon-2012-from-datacenter-to-the-cloud-featuring-xen-and-xcp Step by Step Tutorial (from slide 153)] |
|||
* http://backdrift.org/live-migration-and-synchronous-replicated-storage-with-xen-drbd-and-lvm |
* http://backdrift.org/live-migration-and-synchronous-replicated-storage-with-xen-drbd-and-lvm |
||
* http://joekane.eu/xenserver-drbd-update-4-the-guide |
* http://joekane.eu/xenserver-drbd-update-4-the-guide |
||
* http://www.drbd.org/ |
* http://www.drbd.org/ |
||
[[Category:Users]] |
|||
[[Category:XCP]] |
|||
[[Category:Tutorial]] |
Latest revision as of 10:44, 15 April 2016
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