Vous êtes sur la page 1sur 3

2/21/2011 My Oracle Support | Knowledge Brows…

How to Convert a HVM Guest to a PVM Guest for RHEL/EL5 [ID 1137824.1]

Modified 30-DEC-2010 Type HOWTO Status PUBLISHED

In this Document
Goal
Solution
References

Applies to:
Oracle VM - Version: 2.2.1 and later [Release: OVM221 and later ]
Information in this document applies to any platform.

Goal
The goal of this document is to explain how to convert a hardware virtualized RHEL/EL5 guest to a para-virtualized guest.
This document only applies for RHEL/EL5 Update 3 or later.

Solution

1.

Please backup the virtual machine and configuration files first !

2. Install the xen kernel,


# up2date kernel-xen

3. Check your /etc/grub.conf in order to make sure it will boot from the new kernel correctly

By default, installing the kernel-xen will create the following entry in /etc/grub.conf

title Enterprise Linux Server (2.6.18-194.11.4.0.1.el5xen)


root (hd0,0)
kernel /xen.gz-2.6.18-194.11.4.0.1.el5
module /vmlinuz-2.6.18-194.11.4.0.1.el5xen ro root=/dev/VolGroup00/LogVol00 rhgb quiet
module /initrd-2.6.18-194.11.4.0.1.el5xen.img

This will make your virtual machine a xen-server ( xen.gz is loaded as kernel ).

Please correct the entry that it looks like:


title Enterprise Linux Server (2.6.18-194.11.4.0.1.el5xen)
root (hd0,0)
kernel /vmlinuz-2.6.18-194.11.4.0.1.el5xen ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.18-194.11.4.0.1.el5xen.img

4. Check if the default parameter is referring to the newly installed kernel


Update /etc/sysconfig/kernel in order to use the new kernel as the default
DEFAULTKERNEL=kernel-xen

5. Modify your /etc/modprobe.conf to use the xen drivers


alias eth0 xennet
alias scsi_hostadapter xenblk

Xen will need these drivers to get network and block devices access. For more info on the xen pv drivers please have a look at Note.757719.1.

6. Create a new initrd


# cd /boot
# mv initrd-2.6.18-194.11.4.0.1.el5xen.img initrd-2.6.18-194.11.4.0.1.el5xen.img.bak
# mkinitrd -v --omit-scsi-modules --with=xennet --with=xenblk --preload=xenblk /boot/initrd-2.6.18-
194.11.4.0.1.el5xen.img 2.6.18-194.11.4.0.1.el5xen

support.oracle.com/CSP/ui/flash.html 1/3
2/21/2011 My Oracle Support | Knowledge Brows…

7. Add xen console to /etc/inittab and /etc/securetty

/etc/inittab:
xvc:2345:respawn:/sbin/agetty xvc0 9600 vt100-nav

add "xvc0" at the end of /etc/securetty

8. Shutdown your guest

9. Change the vm.cfg in order to reflect the new virtualization mode:

The following entries have to be removed from your HVM config file,
kernel = '/usr/lib/xen/boot/hvmloader'
builder = 'hvm'
vnc = 1
vncconsole = 1
vnclisten = '0.0.0.0'
vncpasswd = 'ovsroot'
vncunused = 1

The following entries have to be added:


# in order to be able to
bootloader = '/usr/bin/pygrub'

# the virtual frame buffer is used for vnc


vfb = ['type=vnc,vncunused=1,vnclisten=0.0.0.0']

# if you have ioemu as the network type, change it to netfront


vif = [ 'type=netfront, mac=00:16:3e:52:ad:be, bridge=xenbr0', ]

Minimal example xen configuration file:


bootloader = '/usr/bin/pygrup'
memory = '1024'
name = 'testvm'
vcpus = '1'
disk = ['file:/OVS/running_pool/pv_test/system.img,hda,w',]
on_crash = 'preserve'
on_reboot = 'restart'
serial = 'pty'
vif = ['type=netfront,mac=00:16:3e:52:ad:be,bridge=xenbr0',]
vfb = ['type=vnc,vncunused=1,vnclisten=0.0.0.0']

If you are using LVM, you can make changes to the disk device easily, for example using xvda instead of hda. If you are using a standard filesystem you have to
adjust the fstab and make sure that /etc/grub.conf as well as the initrd containing the correct devices names before changing the disk type.

Now you can start your guest with 'xm create vm.cfg'.

You have to adjust all kernel versions in the above description to the kernel version you have installed.

In case you experience the following error:

Error: (2 'Invalid kernel' "elf_xen_note_check: ERROR: Not a Xen-ELF image: No ELF notes or '__xen_guest'

There are two options,

- you did not change the default grub entries ( see above )
- you hit RH Bug 509568 and you should upgrade module-init-tools to version 3.3-0.pre3.1.60.el5 or later

References

support.oracle.com/CSP/ui/flash.html 2/3
2/21/2011 My Oracle Support | Knowledge Brows…
UPDATE:&LT
UPDATE:<A
http://download.oracle.com/docs/cd/E15458_01/doc.22/e15444/createvm.htm#insertedID7

Related

Products

Unbreakable Linux and Virtualization > Oracle VM > Oracle VM > Oracle VM

Keywords

CONVERT; HVM; ORACLE VM; DOMU

Back to top

support.oracle.com/CSP/ui/flash.html 3/3

Vous aimerez peut-être aussi