Friday, July 30, 2010

VMware Server 2 - Part 4 - High Availability Services

High availability is a general requirement, rather than a extra feature, in today's server environments.

Especially as organisations and people have become more reliant on IT systems for everyday tasks.

A simple way to build redundancy into VMware Server 2 software is by using the Linux High Availability software on a Linux CentOS installation.
Clustered servers in racks

This example configuration works well for systems that are server-only devices, e.g. web servers, FTP servers or internet mail systems.

Desktop virtual machines are not recommended for this set-up, because information can be lost when the Linux HA starts new instances of all the virtual machines.


Two Things Required

For this project, there are two requirements for constructing a small cluster of VMware Servers.
  • Redundant Datastore
  • Redundant Server Hardware
In this example, the redundant datastore will be using FreeNAS, with Linux HA offering the redundant VMware Server services.


Linux High Availability

The Linux HA software maintains a set of building blocks for high availability cluster systems, including a cluster messaging layer, a huge number of resource agents for a variety of applications, and a plumbing library and error reporting toolkit.

For this example installation of Linux HA, the heartbeat will be using the IPfail service, which will be the main focus for the VMware Server redundancy.

The Pacemaker functionality will not be used for this example, but can be used in larger server farms for cluster management.


Setting up the Linux HA on CentOS

An IP network, using a crossover Ethernet cable on eth3, has been set up on both the CentOS VM servers, which is used to send heartbeat information to and from the Linux HA services.
Heart beat Ethernet cable
It is important that your host file contains the correct host names of the servers, as required by Linux HA.

I.e., for this example Server1 and Server2 need to be in the host file.

more /etc/hosts

127.0.0.1                  localhost
192.168.0.100          Server1.test.com.au server1

Below are the example configuration files for the Linux HA on each of the VM server.

(CentOS Server 1)
/etc/ha.d/ha.conf file
-------------------------------------------------------------------
logfile /var/log/ha-log
watchdog /dev/watchdog
bcast eth3
keepalive 2
warntime   10
deadtime  30
initdead  60
auto_failback on
node Server1
node Server2
udpport  694
respawn root /usr/lib/heartbeat/ipfail
ping 192.168.0.1
--------------------------------------------------------

/etc/ha.d/haresources file
--------------------------------------------------------
Server1 192.168.0.100/24/eth0 vmware::start
--------------------------------------------------------

/etc/ha.d/authkeys file

--------------------------------------------------------
auth 1
1 crc

--------------------------------------------------------

(CentOS Server 2)
/etc/ha.d/ha.conf
--------------------------------------------------------
logfile /var/log/ha-log
watchdog /dev/watchdog
bcast eth3
keepalive 2
warntime   10
deadtime  30
initdead  60
auto_failback on
node Server1
node Server2
udpport  694
respawn root /usr/lib/heartbeat/ipfail
ping 192.168.0.1
--------------------------------------------------------

/etc/ha.d/haresources file
--------------------------------------------------------
Server1 192.168.0.100/24/eth0 vmware::start
--------------------------------------------------------


/etc/ha.d/authkeys file
--------------------------------------------------------
auth 1
1 crc

--------------------------------------------------------



The Network Attached Storage Setup

The network attached storage being used for the VMware is the open source FreeNAS distribution.

FreeNAS is a free network-attached storage server, supporting: CIFS (Samba), FTP, NFS, rsync, AFP protocols, iSCSI, S.M.A.R.T., local user authentication, and software RAID (0,1,5), with a web-based configuration interface.

FreeNAS Logo
In this example, the two VMware Servers are connected on a separate IP network on eth1. The gig-E switching network is then connected to the FreeNAS server where the vmdk files and datastores will reside.

VMware Server cluster


CIFS or NFS mounts will have to be setup on the NAS before installing any virtual machines, so that the VMware Servers can mount the FreeNAS server, giving a redundant storage of the VM's vmdk files.

Example of mounting the NAS from CentOS:

mkdir /vmware
mount -t cifs  //FreeNAS_IP_Address/vmware /vmware -o user=admin,pass=abcde

Make sure that the /etc/fstab file is updated with the mounting information, so that the NAS mounts will reconnect in the VM Servers on reboot.

192.168.10.10:/vmware /vmware cifs defaults 0 0


Overall Setup of the System 

The overall setup uses two separate switched networks for reliability to the NAS and Internet - one network for the redundant NAS services to the VM Server for the VM's vmdk files, and the other network for data access to the Internet and other LAN services.



The two VM Servers are connected by a crossover Ethernet cable to run the heartbeat service.

The heartbeat service controls the VM Server redundancy.

This setup (or close variations) allows for a reliable setup for high availability VM Servers, without investing in an expensive SAN and only using the free VMware Server 2 software.


There is more to come in "VMware Server 2 - parts 5 and 6". 

I talk about monitoring the server, and changing system resources, among other things VM technical.

Stay tuned...

No comments:

Post a Comment

Thanks for commenting on the Burning the Midnight Blog. Your post will show up shortly after a quick look from one of our moderators.