Virtual Machine Replication & Failover with VMWare Server & Debian Etch (4.0) 

Version 1.0
Author: Francis Theys  <francis [at] fusiontek [dot] be>, Falko Timme , Till Brehm <t [dot] brehm [at] projektfarm [dot] de>
Last edited 08/10/2007

This tutorial provides step-by-step instructions about how to create a highly available VMware Server environment on a Debian Etch system. With this tutorial, you will be able to create Virtual Machines that will be available on multiple systems with failover/failback capabilities.

The system is based using components of "The High Availability Linux Project" , namely "DRBD" and "Heartbeat".
The free open-source edition of DRBD will only allow a 2-node active/passive environment, so this is not for large businesses!. Also, the heartbeat/drbd setup configured in this tutorial, is by using 2 Ethernet NIC's. I recommend that at least the nic to be used for DRBD replication (eth1 in this tutorial) is 1Gbit or more.

Warning: This tutorial requires at least basic Linux & Networking knowledge and is not for so called "newbies" to Linux and/or Networking and/or Vmware !

There are many ways of achieving this goal but this is the way I take. I do not issue any guarantee that this will work for you!

1. Preliminary Note

I assume you have already set up a basic Debian Etch system with VMWare Server installed on both servers as described in the following tutorials:

"The Perfect Setup - Debian Etch (Debian 4.0)" !!Only the first 2 pages!!


NOTE:When using a server with 4GB RAM or more, please install a "bigmem" kernel and respective headers!

apt-get install linux-image-2.6.18-4-686-bigmem linux-headers-2.6.18.-4-686-bigmem

Since we will be needing a separate filesystem to be replicated between both servers, I suggest using a manual partition scheme like the following:

/dev/sda1 -- 500 MB /boot (primary, ext3, Bootable flag: on)
/dev/sda5 -- 10000 MB / (logical, ext3)
/dev/sda6 -- 2000 MB swap (logical)
/dev/sda7 -- 60 GB unmounted (logical) (will contain the /var/vm directory)

You can vary the sizes of the partitions depending on your hard disk size, and the names of your partition might also vary, depending on your hardware (e.g. you might have /dev/hda1 instead of /dev/sda1 and so on) Also, make sure /dev/sda7 is identical in size on server1 and server2, and please do not mount them when the installer asks you:
No mount point is assigned for the ext3 file system in partition #7 of SCSI1 (0,0,0) (sda).
Do you want to return to the partitioning menu?

please answer No!


"How To Install VMware Server On Debian 4.0" !!Only the first page!!

UNLESS OTHERWISE SPECIFIED, ALL COMMANDS ARE DONE ON BOTH SERVERS

2. Installing the required packages on both servers

First we update our package database:

apt-get update

Now we install the packages required for this tutorial

apt-get install ssh drbd0.7* module-assistant heartbeat build-essential psmisc

Share this page:

6 Comment(s)

Add comment

Comments

From: at: 2008-08-05 15:35:58

Thank you for this great howto! I've only one thing which is a bit unclear, how needs /dev/sda7 to be created? Should it only be created or formatted too, with ext3? Because you say "No mount point is assigned for the ext3 file system in partition #7 of SCSI1 (0,0,0) (sda)." but here "/dev/sda7 -- 60 GB unmounted (logical, ext3) (will contain the /var/vm directory)". Thanks again for this great howto!

From: Chris Trainor at: 2008-10-06 15:58:35

In this example /dev/sda7 is just a local partition that was created to eventually be the local storage for the drbd mirrored partition.    Just use whatever your normal partition tools to create it on the local drives (of each machine in your mirrored pair).  fdisk, parted, etc.   No need to format it.  You format the mirrored virtual partition after you're all done creating them.

--Chris

 

From: sjouken at: 2009-01-07 08:52:47

When I read this tutoral, my question rased if your manual could be used between 2 "regular" debian servers.

Kind regards, John Sjouken

From: at: 2007-08-24 11:12:16

use "watch cat /proc/drbd" for repeat the output

From: AtomiX at: 2011-10-21 11:24:26

I follow this tutorial in squeeze (debian 6.0) and is work fine just 2 poin of this page was change:

Do not need any more to compile, in Debian repository have the pre-build package of drbd.

the file /etc/drbd.conf  have some deprecate syntax i have modify like this:

  protocol C;

#  incon-degr-cmd "echo '!DRBD! pri on incon-degr' | wall ; sleep 60 ; halt -f"; # old

 handlers { pri-on-incon-degr "echo '!DRBD! pri on incon-degr' | wall ; sleep 60 ; halt -f"; }#new 

and in syncer the "group 1;"
was not reconize by drbd, so just comment or remove it and work fine
 

From: at: 2007-12-12 19:54:48

I took a similiar yet different approach to this. I built a virtual machine with all tools I needed, cloned it, re-ip'd and hostnamed it. Then setup drbd & heartbeat between the 2 virtual machines.

 This allows me to maintain multiple configuration on the host OS machines yet still have the redundant & failover capability of heartbeat/drbd with in the virtual machines.

 I've been hosting my website/mailserver for almost 9 months in this configuration. If it's of any use I can write something up to be appended to this instruction set.

regards,

Ryan