Skip to content. | Skip to navigation

Personal tools
Log in
Sections
You are here: Home Blog Topics xen

xen

Linux 3.0 and Xen

by Bastian Blank — last modified Jun 23, 2011 06:35 PM
Filed Under:

Linux 3.0 includes the traditional device backends and supports full Dom0-operation.

It took a long time to get all the parts of the Xen support into the Linux kernel. While rudimentary Dom0-support was available since 2.6.38, support for device backends were missing. It was possible to replace this backend with a userspace implementation included in qemu, but I never tested that.

With Linux 3.0, both the traditional block backend and the network backend are available. They are already enabled in the current 3.0-rc3/-rc4 packages in experimental, so the packages can be used as Dom0 and run guests. Right now the backend modules are not loaded, so this still needs some work. Neither the init scripts loads them, because the names where in flux the last time I laid hand on it, nor does the kernel themself expose enough information to load them via udev. I think using udev to load the modules is the way to go.

This step marks the end of a five year journey. Around 2.6.16 the Xen people started to stay really close to Linux upstream. With the 2.6.18 releas this stopped and the tree was pushed in different states into Debian Etch and RHEL 5. After that, Xen upstream ceased work on newer versions completely, only changes to the now old 2.6.18 tree where done. SuSE started a forward port of the old code base to newer kernel versions and Debian Lenny released with such a patched 2.6.26. Around that time, minimal support for DomU on i386 using paravirt showed up and Lenny had two different kernels with Xen support. Since 2.6.28 this support was mature and works rather flawless since. Somehow after that, a new port of the Dom0 support, now using paravirt, showed up. This tree based on 2.6.32 is released with Debian Squeeze. After several more rounds of redefining and polishing it is now mostly merged into the core kernel.

I don't know what the future brings. We have two virtualization systems supported by Linux now. The first is KVM that converts the kernel into a hypervisor and runs systems with help of the hardware virtualization. The later one is Xen that runs under a standalone hypervisor and supports both para- and hardware virtualization. Both works, KVM is easier to use and even works on current System z hardware. It can be used by any user with hopefully enough margin of security between them. Xen's home is more suited for servers, where you don't have users at all. Both have advantages and disadvantages, so everyone have to decide what he needs, there is no "one size fits all".

Xen update

by Bastian Blank — last modified Sep 28, 2008 11:08 PM
Filed Under:

I found a machine which is not so ancient and did some tests with Xen on it.

Kernels

First was some tests with different Linux kernels and hypervisors (3.2 and 3.3). I have to say the overall compatibility got better. As unpriviledged domain (DomU) only one of the kernels failed, the one from Etch (2.6.18-6-xen-686) on the x86_64 hypervisor because of missing setup code.

For the operation as priviledged domain (Dom0) it looks not so good. The 2.6.18 from Xen 3.1 works mostly, the Lenny-targeted 2.6.26 is a little bit picky about the hardware and seems to work better in the 64bit variant, the 2.6.18 from 3.3 is old but rock-stable.

Stub domain

Xen 3.3 adds the possibility to move a the qemu which provides the emulated hardware for full virtualized domains in its own (paravirtualized) domain. The documentation is not really complete and the whole thing rather fragile. Error messages from the emulation domain are swallowed and depending on the config it also likes to crash.

It wants a new service, a filesystem backend, which is implemented in a root process in the dom0, even if it is not needed for operation. This service is not configurable, exports anything in /exports and allows writing, the code have similar quality then qemu.

PV-GRUB and partitions

by Bastian Blank — last modified Sep 13, 2008 11:35 AM
Filed Under:

Xen 3.3 added a tool called PV-GRUB. It is a GRUB (legacy aka 0.97) built against MiniOS and bootable as a PV kernel. It works fine on a Xen 3.2.1.

It is easy to use, I just set this in my config:

kernel = "/usr/local/lib/xen/boot/pv-grub-x86_64.gz"
extra = "(hd0)/boot/grub/menu.lst"

However it decided to not load my config as defined in the config and simply show me that:

    GNU GRUB  version 0.97  (524288K lower / 0K upper memory)

       [ Minimal BASH-like line editing is supported.   For
         the   first   word,  TAB  lists  possible  command
         completions.  Anywhere else TAB lists the possible
         completions of a device/filename. ]

grubdom>

The reason is quite easy:

grubdom> root (hd0)
 Filesystem type unknown, using whole disk

Some debugging later, the reason is known and fixed.

grubdom> root (hd0)
 Filesystem type is ext2fs, using whole disk

grubdom> kernel /boot/vmlinuz-2.6.27-rc5-amd64

grubdom> initrd /boot/initrd.img-2.6.27-rc5-amd64

grubdom> boot
block error -1 for op 2
close blk: backend at /local/domain/0/backend/vbd/23/51712
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Linux version 2.6.27-rc5-amd64 [...]
[    0.000000] Command line:
[    0.000000] KERNEL supported cpus:
[    0.000000]   Intel GenuineIntel
[    0.000000]   AMD AuthenticAMD
[    0.000000]   Centaur CentaurHauls
[    0.000000] ACPI in unprivileged domain disabled
[...]
[    0.022093] Booting paravirtualized kernel on Xen
[    0.022101] Xen version: 3.2-1

Xen dropped support for non-PAE x86_32

by Bastian Blank — last modified Jun 10, 2008 12:47 PM
Filed Under:

For those who did not yet got it: Xen upstream decided to drop non-PAE x86_32 support from Xen.

linux-image-2.6.23-rc4-xen-686

by Bastian Blank — last modified Sep 02, 2007 12:40 PM
Filed Under:

Xen support finally landed in upstream Linux. Okay, it is rather limited yet, but usable.

It supports the following:

  • Unprivileged domain (domU).
  • x86_32 (i386 without PAE) and x86_32p (i386 with PAE).
  • Console.
  • netfront and blkfront.

Changes to the old Xen patch:

  • Block devices does not support takeover of hdXY and sdXY. Use xvcX (xvca, xvcb, ...) as device names.
  • Console is hvc0. You must supply console=hvc0 at the command line. (Use the extra definition in the Xen domain config file.)

Yet missing things:

  • Suspend, resume (also makes migration impossible).
  • Ballooning.
  • x86_64. Xen upstream currently waits for an unified x86 tree.
  • Privileged domain (dom0).
  • netback, blkback, pciback and pcifront.

Xen changes in 2.6.18-4

by Bastian Blank — last modified Jan 04, 2007 02:03 PM
Filed Under:

The upcomming linux-2.6 release will introduce some changes in the Xen support.

i386 gets PAE only

The i386 images gets PAE only. The main cause is a bug in this versions which makes non-PAE images crash on core dumps. The patch is from Fedora, which only ships PAE images; so it is unlikely that they will fix it.

Network breaks with older guests

There is a bug in it, which makes older kernels on the guests break on a host which uses the new version. The reason is for know unknown. The kernel logs many of the following errors:

kernel: xen_net: Memory squeeze in netback driver.

New XEN infrastructure

by Bastian Blank — last modified Sep 04, 2006 02:42 PM
Filed Under:

It is done. The new Xen infrastructure is finished, although it is not yet completely in unstable.

The main difference to the old one, the hypervisor and utils packages includes the complete version and an abi spec, just like our linux kernels. Also it is now possible to install more than one version of the utils at the same time. The userspace tries to find the correct tools for the running hypervisor.

The following packages are provided now:

  • xen-hypervisor-3.0.2-1-$flavour
  • xen-utils-3.0.2-1
  • xen-ioemu-3.0

and from the kernel

  • xen-linux-system-$kernelversion

The only missing thing is a selection of the correct hypervisor in update-grub.

Debian Linux 2.6.16-18 with XEN

by Bastian Blank — last modified Aug 22, 2006 09:30 PM
Filed Under:

Yes, the xen images from linux 2.6.16-18 in unstable does not work with the currect xen 3.0 in unstable and testing. The interface for the priviledged domain changed in an incompatible way. I'm working on that problem and 2.6.17-7 will contain a complete new infrastructure.

Linux 2.6.17 and XEN

by Bastian Blank — last modified Aug 15, 2006 07:07 PM
Filed Under:

XEN patch for 2.6.17 commited to linux-2.6

I commited a XEN patch to linux-2.6, so we will have XEN in 2.6.17. The patch is based on the Fedora sources.

The images will be available tomorrow via the Kernel snapshots and needs an updated xen-hypervisor-3.0-* package (>= 3.0.2+hg9697-2) with changes I commited today.