However, importing an Oracle VM template into OVM and Xen are two different things (although they shouldn't be).
The first thing you will want to do is unarchive the template into the directory of your choice:
tar zxvf OVM_EL5U2_X86_64_PVM_10GB.tgz
This should give you the following directory structure:
Next, copy the vm.cfg file into your xen directory with a new name:
cp vm.cfg /etc/xen/OEL5U2.cfg
Now, edit the OEL5U2.cfg and change the disk= line to point to your System.img file. Just change the directory to the place where you unarchived it. You will also want to change the file: parameter to tap:aio:. On OVM, the file parameter has changes that make it very efficient. On Xen, tap:aio is far superior to file. Here is what my config looks like:
disk = [ 'tap:aio:/home/images/OVM_EL5U2_X86_64_PVM_10GB/System.img,xvda,w' ]
You will also want to verify that your bootloader line points to your pygrub binary. If it does not, change it. Mine looks like this:
Feel free to make other changes such as memory and vcpus based on your needs.
Here is where this gets fun.
You will need kpartx to mount partitions from the img file. If you do not have it installed, get it from your linux vendor.
First, set up the associations for the image file by running the following command:
kpartx -av /home/images/OVM_EL5U2_X86_64_PVM_10GB/System.img
Replace the location with your location of the System.img file.
Next, we need to let LVM know about these new partitions:
You should get something like the following back:
Found volume group "VolGroup00" using metadata type lvm2
Now, activate the logical volumes with the following:
vgchange -ay VolGroup00
running 'lvs' should show the new partitions. Now you can mount the logical volume partitions like you would any other partition:
mount /dev/VolGroup/LogVol00 /mnt
Change into the directory and make the following change to your kernel line.
1) Remove the 'quiet' parameter
2) Add console=xvc0 to it.
title Enterprise Linux Enterprise Linux Server (2.6.18-220.127.116.11.2.el5xen)
kernel /vmlinuz-2.6.18-18.104.22.168.2.el5xen ro root=/dev/VolGroup00/LogVol00 rhgb numa=off console=xvc0
Save the file.
Unmount the partition:
Deactivate the Volume Group
vchange -an VolGrou00
Remove the img associations:
kpartx -dv /home/images/OVM_EL5U2_X86_64_PVM_10GB/System.img
Now, you should be able to boot the image without issues:
xm create OEL5U2.cfg