Apr 19 2008

Xen Tips

Published by at 12:00 am under Linux,Virtualization

Disabling Image Files




Xen usually stores running domains in /var/lib/xen/save, causing a /var full on many systems when dom0 is shut down. Edit /etc/sysconfig/xendomains or /etc/default/xendomains and replace

"XENDOMAINS_SAVE=/var/lib/xen/save"

with

"XENDOMAINS_SAVE="

This sends a shutdown signal to all virtual machines before dom0 reboots. A 300 second timeout is defined before killing an OS that hangs on shutdown.

Static Routes

The file /etc/sysconfig/static-routes is still supported but routes are removed after the Xen daemon is launched. Since Redhat Enterprise Linux 3, it is advised to use /etc/sysconfig/network-scripts/route-ethX. It should include similar information to this for instance:

GATEWAY0=10.25.207.163
NETMASK0=255.255.252.0
ADDRESS0=10.22.40.0

GATEWAY1=10.25.207.163
NETMASK1=255.255.252.0
ADDRESS1=10.22.208.0

Virtual Console Access

2 methods can be used to access a domU console:

  • "xm console xenhost" If the virtual host is shut down, "xm create -c xenhost" boots it and launches the console. However, user space messages are not displayed – like services startup.
  • The 2nd option is to launch vncviewer that emulates a colored console.
    Every single Xen host has its own VNC port on the physical machine. They are usually on the 590X format. You can find the ports with netstat.
    Open a X11 manager on your local system and run on dom0:

    export DISPLAY=10.22.41.229:0.0
    vncviewer localhost:590X
    

Keyboard in console

Before Redhat Enterprise 5.1, the keyboard always uses the qwerty layout in its minimal definition. Upgrade to RHEL5.1 to access all characters and specify a custom layout.
Add keyword "keymap" to the Xen configuration file. Example:

vfb = [ "type=vnc,keymap=fr" ]

Serial Console

To get the serial console to work with a Xen kernel, Grub had to be configured this way:

title Systeme principal
       root (hd0,0)
       kernel /xen.gz-2.6.18-53.el5 com2=115200,8n1 pnpacpi=off console=com2L
       module /vmlinuz-2.6.18-53.el5xen ro root=/dev/sys1liege/rootfs console=xvc xencons=xvc
       module /initrd-2.6.18-53.el5xen.img

The following line is also needed in /etc/inittab

7:2345:respawn:/sbin/agetty -L 115200 ttyS1 vt102 or
co:2345:respawn:/sbin/agetty xvc0 115200 vt100-nav

Adding "xvc0" to /etc/securetty may be needed.

NTP

NTP doesn’t need to be set up on virtual machines. Time is synchronized with the hosting machine.


No responses yet

Comments RSS

Leave a Reply