Nethence Newdoc Olddoc Lab Your IP BBDock  

Warning: those guides are mostly obsolete, please have a look at the new documentation.


XEN usage and tweaks
Custom XEN guest wrappers
Install custom XEN guest wrappers,
cd ~/
mkdir -p bin
cd bin
#for f in `ls -1 ~/code/sysutils_xen/`; do
# ln -s ~/code/sysutils_xen/$f
Making a guest template or backup
Remove the SSH keys from the guest,
rm -f /etc/ssh/*key*
ll /etc/ssh/
Tar up the guest,
tar czSf centos5x32.tar.gz centos5x32
Note. -S, --sparse for sparse file virtual disk
Then extract it elsewhere and use the following clone procedure, but use 'mv' instead of 'cp'.
Cloning / renaming a guest
Make sure the source guest is shut down and proceed,
cd /data/guests/
cp -R centos5x32 newguest
#mv centos5x32 newguest
cd newguest
sed 's/centos5x32/newguest/g;
  ' centos5x32 > newguest
rm -f centos5x32
mv centos5x32.disk newguest.disk
Note. 'cp' is sparse capable by default
You can then start the guest and change its network configuration.
Launch guests at boot time
Enable guests at boot time,
cd /etc/xen/auto/
ln -s /data/guests/guestX/guestX
When starting a domU, if you get this error msg while "/kern" is mounted,
Error: [Errno 2] No such file or directory: '/kern/xen/balloon'
It means there's not enough memory left for the guest.
When starting a domU, if you get this error msg,
Error: (22, 'Invalid argument')
the dom0 and domU kernels don't match (PAE vs. non-PAE).
If you get this error when trying to launch a guest,
xc_dom_boot_mem_init: can't allocate low memory for domain
just make sure the guest architecture is supported by the dom0 :-) (e.g. a x86_64 guest might not be supported on x86 host)
Hot migration
Once your XEN farm is configured (IP settings and shared disk filesystem), edit the configuration,
vi xend-config.sxp
(xend-http-server yes)
(xend-relocation-server yes)
(xend-port 8000)
(xend-relocation-port 8002)
(xend-relocation-address '')
### (xend-relocation-hosts-allow '')
Basic dom0 management
On RHEL5 there's a graphical interface,
Note. press "Ctrl" to release the mouse from the guest console
Back to the terminal, list the currently started virtual machines,
xm list
Note. dom0 is the base system, not a VM.
Start a vm,
xm create path/to/vmconfig
to get its console immediately,
xm create path/to/vmconfig -c
or once the VM is started, you can get the console afterwards,
xm console vmname
To exit from the console,
ctrl-altgr-] (something like that)
Besides, it's very convenient to use VM consoles inside a screen session, having a different VM console on each screen window. It's possible to kill the console simply by killing the screen window,
^A k
GNU Screen configuration :
To stop a VM,
xm shutdown vmname
Note "xm destroy" will act the same as an immediate poweroff, while "xm sh" should tell the system to shutdown properly. Check wheter it behaves correctly within both, HVM and paravirtualized guests.
Note. it's possible to use shortcuts. Instead of the full xm commande, do
xm cr <vmname>  # create
xm co <vmname>  # console
xm sh <vmname>  # shutdown
xm de <vmname>  # destroy
xm li      # list
Advanced dom0 management
Detailed information,
xm list -ll
xm info
See what's going on,
xm vcpu-list
xm tmem-list
xm network-list
Set dom0's allocated memory dynamically,
xm mem-set 0 512M
RHEL Kernel Performance Optimization and Characterization and Tuning :
Xen Disk I/O Benchmarking: NetBSD dom0 vs Linux dom0 :
Xen Virtualization on Linux and Solaris :
XEN: Install SLES 9 SP3 domU on SLES 10 XEN dom0 :
Xen DomU Linux Installer Creation :
Virtualization in Fedora 8 :
Xen3 on CentOS4 :
Xen, Virtualization on Linux :
(FR) Virtualisation avec Xen :
Management tools
Virt-manager :
Convirt GUI :
virsh :
Enoalism GUI :
Clobber :

(obsolete, see the new doc)