Linux HVM or Physical to Paravirtual Conversion

From The FluidVM Wiki

Jump to: navigation, search

You need to be logged on to the physical or HVM system that you want to convert to Paravirtual. Follow these steps and you'll hopefully end up with a template that will work. These steps are for CentOS/Redhat systems.

1. Create a file called /tmp/exclude and add the following lines to it:

.bash_history 
lost+found 
/dev/* 
/mnt/* 
/tmp/* 
/proc/* 
/sys/* 
/usr/src/* 

2. Tar the root file system

tar -czvf /tmp/centos-5.0-[ARCH].tar.gz –X /tmp/exclude /

[ARCH] can be either i386 or x86_64 depending on the system you are converting.

3. Copy the file system to the management server (not to the individual compute nodes!)

Copy the new tar file over to /xen-templates on the management server. The "scp" command is your friend.

4. Untar the file there in a temporary directory

mkdir temp
cd temp
tar xzf ../centos-5.0-[ARCH].tar.gz

5. Take care of a few configuration files - Be careful! Avoid the leading "/" or you'll make the management server conk.

etc/fstab - Remove all hard disk related entries and those that begin with "LABEL=". Add 2 entries: sda1 - root, ext3 and sda2, swap

/dev/sda1        /                etxt3    defaults  1 1
/dev/sda2        /                etxt3    defaults  0 0

You can let other entries like /dev/pts, /dev/shm, /proc, /sys in the fstab file be.

Physical NICs: etc/sysconfig/network-scripts/ifcfg-ethX You'll need to decide on how many virtual Ethernet cards you'll eventually use. FluidVM allows for a maximum of 4 VNICs. You can create up to 4 files named ifcfg-eth0 through ifcfg-eth3. The content of each file must be as follows:

TYPE=Ethernet
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes

Don't forget to change the DEVICE= specifier in each of these file if you create more than one.

6. Compress the file back, overwriting the file previously copied from the compute node.

tar czf ../centos-5.0-[ARCH].tar.gz *

7. In the Management Server UI, go to Virtual Cockpit -> Templates and click on the "Sync Templates" button. Your new template must appear in the list. You can use this template now to create Xen Paravirtual guests.