[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] pv-grub Solaris support



Hello Michael,

On Thu, Oct 13, 2011 at 03:48:59PM +0800, Michael Li wrote:
> Thank you! How can I test your utility in OVM3.0.2 platorm, I have
> Solaris latest  running as Guest OS, would like you activate the PV
> domU with your tool.

I haven't used Oracle VM myself, but hopefully the hypervisor is sufficiently
similar to vanilla Xen 4.0 that the instructions below will work.


=== Building pv-grub ===

To build a patched pv-grub, you'll need a Linux system with developer tools
installed; I used Debian Squeeze, but another distribution should be fine.
You should build pv-grub on the same arch (i386 or amd64) as the domU you
intend to run. Steps:

hg clone http://xenbits.xen.org/hg/xen-unstable.hg/
patch -p1 -d xen-unstable.hg < pv-grub_solaris.patch
cd xen-unstable.hg
# I also needed the following symlink:
ln -s . xen/include/xen/libelf
make -C stubdom pv-grub
# if the build succeeds, pv-grub will be in stubdom/mini-os-$ARCH-grub, e.g.:
cp stubdom/mini-os-x86_64-grub/mini-os.gz ../pv-grub.patched.gz


=== Converting an existing HVM domU to PV ===

There was a thread on xen-discuss about converting a HVM domU to PV:
  http://mail.opensolaris.org/pipermail/xen-discuss/2010-February/005768.html
The post above uses pygrub; with a patched pv-grub the process is similar.

The tricky part is that the root pool of the domU holds information about
the physical device paths of its vdevs, which is no longer correct when we
switch to a PV domain. This causes the domU kernel to panic when it tries
to mount the root pool. To prevent this, you must first boot the PV domain
from a Solaris installation cd (iso image), and import and export the root
pool: this writes the correct device paths to the pool.

First, download a Solaris iso image that is at least as recent your root
pool version (e.g. Solaris 11 Express).

Edit the vm.cfg file of your domU: 
# remove "builder=..." and "device_model=..." parameters 
# modify "kernel", "disk" and "extra" as follows:
kernel = '/path/to/pv-grub.patched.gz'
disk   = [ 'file:/path/to/domU/System.img,xvda,w',
           'file:/path/to/domU/sol-11-exp-201011-text-x86.iso,xvdc:cdrom,r'
         ]
# (initially, boot from the iso)
extra  ='(hd1)/boot/grub/menu.lst'

Start the domain and attach the console. Depending on how quick you are,
you should see either a countdown timer, or a "Selected disk does not
exist" error. Press "Esc" to enter the menu. Now you must edit the default
menu entry to add a "root" command (I have a separate patch to pv-grub that
fixes this, but that's not really Solaris-related).
Select edit > new line before > edit > enter "root (hd1)" > boot.

The Solaris iso should now boot. Run the following in a shell (option 3 in
the SX11 text installer):

zpool import -f rpool
# verify that the import succeeded
zpool status
zpool export rpool
# verify that the export succeeded
zpool status 

At this point you can destroy the VM. Now edit the vm.cfg to read:
  extra='(hd0,0,a)/boot/grub/menu.lst'
and optionally remove the Solaris iso from the "disk" parameter.
Start the vm again, and if all went correctly, you should see the grub
menu, and be able to boot your PV domain into the boot environment of your
choice.


=== Creating a new PV domU ===

Just follow the steps above, but instead of opening a shell for the zpool
import & export step, choose "Install Solaris".


I hope this works for you. Success/failure reports are welcome!

Best,

Kasper

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.