Open main menu

OpenVZ Virtuozzo Containers Wiki β

Changes

How to use OpenVZ as a XEN guest OS (for x86 platform)

63 bytes added, 09:21, 1 August 2007
wikification
1. == Intro==
Recently released RHEL5 kernel supports compatibility with XEN 3.0. It means that
</pre>
2. == Installing XEN itself, Dom0 and XEN tools.==
XEN 3.0 1 and XM tool can be installed in 2 ways: either from tarball containing prebuilt binaries or by building from sources.
- === Installing from tarball===
Download XEN 3.1 32 bit PAE SMP tarball from http://bits.xensource.com/ and unpack:
some drivers for your hardware, that are needed to be loaded by using initrd. In this case follow instructions below - "Building from sources".
- === Building from sources===
Download the package containing sources of Xen-3.1 and unpack it:
Check that kernel command line options are correct (after ro ...) and reboot the machine. In grub loader menu select "Xen Linux (2.6.16.33-xen)". In case of success - machine boots into Xen's Dom0 that is running vmlinuz-2.6.16.33-xen XenLinux. Now it is time to prepare OpenVZ XenLinux kernel for DomU.
3. == Installing OpenVZ XenLinux kernel.==
OpenVZ XenLinux kernel can be installed in 2 ways: either from rpm containing or by
building from sources.
- install === Install from rpm===
Change directory to openvz and download rpm package with OpenVZ XenLinux kernel for x86:
If something goes wrong during installation the prebuilt kernel - you can build the OpenVZ XenLinux kernel from sources as described below.
- === install from sources===
Download rpm with OpenVZ kernel sources:
OpenVZ XenLinux kernel prepared. Now OpenVZ tools are to be installed. In case you faced problem while building the kernel turn to article http://wiki.openvz.org/Kernel_build .
- === install OpenVZ tools:===
Now download and install latest versions of OpenVZ tools vzctl, vzquota that are necessary for starting/stopping VEs:
More information on installing OpenVZ tools can be found here: http://wiki.openvz.org/Quick_installation.
- === download OpenVZ guest template===
To make it possible to create VEs download one of the precreated OpenVZ templates and place it to /vz/template/cache:
</pre>
4. == Preparing guest partition and configuring XEN.==
Xen users manual http://www.xensource.com/products/xen/documentation.html describes a set of different ways of creating disk for DomU. Disk can be created using loopback or LVM or physical partition. Consider we have a standalone physical partition /dev/sda7 that will be used for creating DomU disk. Assume /dev/sda7 is empty and it contains ext3 filesystem.
Preparations completed. At this point we have everything that is necessary for cretaing DomU and starting OpenVZ XenLinux within DomU. Reboot into Xen: select Xen Linux (2.6.16.33-xen) item from grub menu. After reboot machine will be running vmlinuz-2.6.16.33-xen (see above) in Dom0 over hypervisor. Follow instructions below.
5. == Starting OpenVZ guest in DomU.==
- === starting===
Start xend daemon to make xm tool work:
It works.
- === next steps===
As OpenVZ works in DomU it is the best time for configuring network both in DomU and VEs. This process is described in http://www.xensource.com/products/xen/documentation.html (DomU) and http://wiki.openvz.org/Category:Networking (VEs). After this all of us will feel the full power of virtualization!
6. == RHEL5 based OpenVZ in Dom0. Known problems.==
OpenVZ XenLinux kernel is able to work also in Dom0. It can be tested just by updating /etc/grub.conf on the hardware node. But in this case it will be impossible to start DomUs. It is a known bug and it is related not to OpenVZ, but to RHEL5 kernel.
Hope it is fixed in next RHEL5 update.
7. == Appreciates==
Thanks to Sergey Ya. Korshunoff seyko@ for starting the topic and contribution.