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

1. To get the virtual machine ID of the virtual machine “s102vm1” , use the command
xm list | grep “s102vm1” | awk ‘{print $2}’
2. Now use the ‘vmid’ to get the name of the virtual interface that is mapped to the virtual
machine on the dom0 host.
vif < vmid >.<interface index>
so, the derived interface is ‘vif2.0’
3. Probe the interface using the command
‘ifconfig vif2.0 | grep “UP”’.
vif2.0 Link encap:Ethernet HWaddr FE:FF:FF:FF:FF:FF
inet6 addr: fe80::fcff:ffff:feff:ffff/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:805 errors:0 dropped:0 overruns:0 frame:0
TX packets:3744 errors:0 dropped:18 overruns:0 carrier:0
collisions:0 txqueuelen:32
RX bytes:26624 (26.0 Kb) TX bytes:247301 (241.5 Kb)
The virtual machine network can be monitored from the host by simply probing the 'vif' interface
associated with the VM.
A failure of the physical interface or the virtual machine would bring the virtual interface down, thus
notifying that the network on the virtual machine has failed.
Serviceguard for Linux can then fail the package and restart it on a different node where the network
is available. Repeat the steps listed above to identify the new virtual interface on the other node and
monitor it accordingly.
Xen VM Application High Availability through Application Monitoring
The Xen Toolkit provides advanced support for integration with Application Monitoring feature
on SG/LX 11.19. It is now possible to control and monitor applications running on a Xen VM guest
through the use of Application monitoring feature in SG/LX 11.19.
There are two components to Application monitoring : ‘cmappserver’ and ‘cmappmgr’. The
cmappserver’ component runs on a Xen VM guest. This is started when the Xen VM guest is
booted up. The ‘cmappmgr’ component is located on the Xen Host. The server then waits and listens
to connections from ‘cmappmgr’. The ‘cmappmgr’ component is under SG/LX package control and
provides control and monitoring status for applications under the ‘cmappserver’ on a Xen VM
guest. If ‘cmappserver’ detects an application failure on the guest, the information is passed to
cmappmgr’. The ‘cmappmgr’ then fails and notifies SG/LX of failure. This brings the Xen VM
package to halt. The Xen VM package can then be failed over to anotherSG/LX Xen Host.
The Xen Toolkit provides a new package config attribute to control Application Monitoring.
XEN_VM_APPMON
The attribute takes a "YES" or "NO" to enable or disable application monitoring.
Note: The attribute is ignored if Serviceguard version is below A.11.19.
In addition to XEN_VM_APPMON, the application monitoring also requires a ‘service_cmd’ block
13