Designing High-Availability for Xen Virtual Machines with HP Serviceguard for Linux

The two main resources used by a Xen VM are as follows:
‘Xen virtual disk file’ located in a directory specified by the user at time of VM
creation
‘Xen VM configuration file’ located in a sub-directory of ‘/etc/xen/’.
Follow these steps to consolidate the VM resources:
1. Create a logical volume large enough to hold the virtual disk file and the guest configuration
file. If the Xen VM uses a physical shared disk, then the logical volume would hold the
configuration file.
2. Create a file system on the logical volume, for instance, an ‘ext2 or ext3’ file system
using ‘mke2fs’ or simply ‘mkfs’
3. Mount the logical volume.
4. Create identical mount points on other nodes of the Serviceguard for Linux cluster. These
mount points would be used when the package is failed over to the other node.
5. Create a Xen VM guest using ‘virt-install’ (Redhat) or ‘vm-install (Novell).
Specify the install options so that the VM virtual disk and the VM configuration file resides on
the shared logical volume. In the case of a pre-created guest VM, copy the VM configuration
files to the logical volume and edit the VM guest configuration file to change the path entries
to reflect the new location of the VM guest files.
6. Unmount the logical volume.
Modify the Serviceguard for Linux Package Configuration File
An application can be packaged using the legacy method or the modular method. This white paper
describes the legacy method. A modular package scheme will be released in the future.
Legacy Method
Create a package configuration file using the following command
cmmakepkg –v -p pkg.conf
Create a package control script using the command
cmmakepkg –v -s pkg.cntl
Modify the package control script to enter the start, stop functions in the control script.
Appendix I lists the Xen configuration file (xenhost.cnf), which sets the environment for the Xen Control
Script and the Xen Monitor Script.
Refer to Appendix Section II for more details on the Xen control script (xenhost.sh). The Xen control
script can be called from within the SG/LX package control script; define the following functions:
function customer_defined_run_cmds
{
# ADD customer defined run commands.
: # do nothing instruction, because a function must contain some command.
${XENPATH}/xenhost.sh start
}
9