Home > Server Virtualization Tips > Managing virtual environments > Building high-availability clusters with Xen virtual machines
Server Virtualization Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

MANAGING VIRTUAL ENVIRONMENTS

Building high-availability clusters with Xen virtual machines


Sander van Vugt, Contributor
10.26.2009
Rating: -3.75- (out of 5)


Server virtualization technical tips and expert advice
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


This three-part series explains step by step how to create a Xen-based high-availability cluster with only open source components. Part one covers how to implement an iSCSI storage area network (SAN) with SUSE Linux Enterprise Server (SLES) 11. The second installment explains how to configure a cluster with open source Pacemaker. Finally, this article covers how to create Xen-based virtual machines for the cluster.

Once you virtualize servers in your data center, a single outage on a physical server can take down multiple virtual machines (VMs). A high-availability (HA) cluster enables you to restart a VM in the cluster once its hosting node fails. So, if node one fails in your virtual environment, for example, virtual machines will migrate to node two. This way, if a server goes down, essential services don't have to shut down along with it.

Before a Xen virtual machine can be managed by a cluster and run on any node, however, a node must have access to the VM's configuration file and storage back end. Here I explain how to enable access to both.

Enabling access to a VM's configuration file
Making your VM's configuration files accessible every node is simple. First, place it on a logic unit number (LUN) in your SAN. Next, mount it on the /etc/xen/vm directory with all the hosts participating in the cluster. Then, put the configuration file on a network file share, which should be mounted on the directory, or synchronize the files manually after making changes to the configuration file (which you won't do often). Providing access to VMs' storage back end, however, requires a different approach.

Configuring the storage back end
There are two ways to configure a virtual machine'...

Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google





s storage back end. The default method is to place it in a file. In this scenario, make the file accessible to every host in the cluster. It's also recommended to put this file on a cluster-safe file system, such as Oracle´s Oracle Cluster File System 2.

The simpler option is to set up a device as the storage back end. When creating a VM, configure the installation program to use a logical volume as the storage back end. Just be sure that the logical volume is on a LUN in the SAN and that it's available to every host in the cluster.

Figure 1
I recommend using a storage device such as a logical volume as the storage back end. (Click image for an enlarged view.)
[IMAGE]

Configuring the Xen resource
Once the various Xen components are in place, it's time to create the cluster resource. First, start the hb_gui utility from the host server and authenticate as the user hacluster. Next, select Configuration, then Resources. From there, click Add and then choose the Primitive option. Next, provide an ID for the resource ("Xen-node" would be a good name for the test run). Then, choose the Class OCF, Provider Heartbeat and Type Xen. Once completed, click Forward.

Figure 2
Configuring the basic parameters of a Xen virtual machine resource. (Click image for an enlarged view.)
[IMAGE]

In the next window, you can further configure the properties of your new Xen resource. On the Instance Attributes tab, specify the correct Xen virtual machine configuration file in the xmfile parameter. Then, provide the full path to the virtual machine configuration file, and click Apply. This creates the resource for your virtual machine in the cluster.

Figure 3
To create a Xen virtual machine resource, provide the path to the virtual machine configuration file. (Click image for an enlarged view.)
[IMAGE]

At this point, in the Management section of the hb_gui utility, the virtual machine resource will be visible but not activated. Right-click on it, and select Start. Congratulations: You now have your first virtual machine running in the cluster.

About the expert
Sander van Vugt is an independent trainer and consultant based in the Netherlands. Van Vugt is an expert in Linux high availability, virtualization and performance and has completed several projects that implement all three. He is also the writer of various Linux-related books, such as Beginning the Linux Command Line, Beginning Ubuntu Server Administration and Pro Ubuntu Server Administration.


Rate this Tip
To rate tips, you must be a member of SearchServerVirtualization.com.
Register now to start rating these tips. Log in if you are already a member.




DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Search More Tips on Virtual Implementation
HomeNewsTopicsITKnowledge ExchangeTipsBlogsAsk the ExpertsMultimediaWhite PapersEvents
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2006 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts