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

A return of '0' from the command indicates that the machine is in the 'booting up' state (represented
by the ‘r’ in the grep command) or in the 'booted up' (represented by the ‘b’) state. The command
can be called periodically to check the status of the virtual machine.
Virtualization-mode dependent approach
Fully-Virtualized mode
For every Fully-Virtualized VM, a 'qemu-dm' process is spawned. It is possible to identify which
instance of 'qemu-dm' belong to a particular VM with the following command:
ps -ef | grep "qemu-dm" | grep ${Virtual Machine Name}
Capture the PID of ’qemu-dm’ and touch a file and write the PID into a file. The monitoring can be
done by probing this particular PID on regular intervals.
Para-Virtualized mode
No specific approach has been identified for Para-Virtualized Guests. Hence, usage of the
virtualization-mode independent approach described above should be used.
Pros and Cons of Independent vs. Dependent Approach
The virtualization-mode dependent approach provides more accurate monitoring of the Fully-
Virtualized VMs than the independent approach. The independent approach relies on the ‘xm’
commands to gather monitoring information. There are limitations to this type of monitoring. The
virtual machine name is removed from the 'xm list' before the ‘qemu-dm’ process goes down.
This small time gap may lead to an incorrect interpretation of the virtual machine status at that specific
time. Since the qemu-dm’ process belongs to Fully-Virtualized VMs, the time gap only effects the
Fully-Virtualized VM monitoring.
For these reasons the virtualization-mode independent approach works best for Para-Virtualized
guests as there are no latencies involved, and the virtualization-mode dependent approach is
recommended for Fully-Virtualized VMs.
Monitoring Xen virtual machine network interfaces
Xen provides network availability to virtual machines through the virtual interfaces (vif) configured on
a Xen dom0 host.
A 'vif' interface is created for each virtual machine, at the time of startup. (using‘xm create’
command). The naming convention for the 'vif' interface is dynamic.
vif<vmid>.<interface index>’
Replace the ‘vmid’ and ‘interface index’ values to get the correct name for the vm interface.
The ‘vmid’ of a virtual machine change everytime the virtual machine is halted and started up. Run
the command listed below to extract the ‘vmid’ using the name of the virtual machine.
For example:
12