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

Re: [Xen-users] use existing lvm volume as root in hvm/pv guest



On Wed, Jun 05, 2013 at 11:55:44PM +0200, Daniël Boone wrote:
> I want to accomplish the following:
> 
> I want to have a xen guest that I can also boot physically.
> Some indepth explanation:
> 
> I want to virtualise my mediacenter with pci passthrough of my 2
> dvb-s cards.
> In case of problems with my motherboard I want to boot the guest
> physically on other hardware without xen.
> 
> Current hardware:
> Asrock Z77 pro 4
> intel core i7 3370
> 1x 2,5" sata xen disk on as media controller
> 4x 2 TB WD disks in lvm  raid10  on intel sata controller.
> 
> 
> I have tried the following scenario's without success.
> 
> Experiment 1
> Ubuntu 13.04 with xen 4.2.2
> create hvm guest with passthrough of intel sata controller: can see
> the disks, but cannot boot from it.
> I tried to complie xen myself but failed.
> raid and lvm managed by guest
> 
> Experiment 2
> Ubuntu 12.04 with xen 4.1.0
> create hvm guest with passthrough of intel sata controller: can see
> the disks, but cannot boot from it.
> raid and lvm  managed by guest
> 

What are the errors? If you can see (and presumably mount) the disks,
what's the issue? Also, is the root partition on the RAID? I would
suggest _not_ to do that, as assembling RAIDs from the ramdisk
is just throwing more variables into the equation.

> Experiment 3
> Ubuntu 12.04 with compiled xen 4.2.2  and qemu-upstream and seabios 1.7.2
> create hvm guest with passthrough of intel sata controller: can boot
> from the disks if  device_model_version = 'qemu-xen' and
> device_model_override = '/usr/lib/xen/bin/qemu-system-i386' is used
> in config. But raid is not stable.
> raid managed by guest
> 

What do you mean by "RAID is not stable"?  

> Experiment 4
> 
> Ubuntu 12.04 with compiled xen 4.2.2  and qemu-upstream and seabios 1.7.2
> create hvm guest with passthrough physical disks seperately : the
> raid is detected in dom0 so this also poses an issue. I tried
> booting raid=noautodetect as grub parameter  but without success,
> raid still starts.
> raid and lvm managed by guest
> 

This seems more like an Ubuntu issue. There is most definitely a way to
prevent the dom0 from assembling the array. I would suggest asking an
Ubuntu mailing list about that, as I have no experience with Ubuntu.

> Experiment 5:
> 
> This is where I'm lost
> Ubuntu 12.04 with compiled xen 4.2.2 and no qemu-upstream as I
> cannot boot from cdrom with qemu-upstream
> I was thinking of adding a small file based disk for /boot and grub
> and  using the previously installed lvm volume as root.
> When I boot the guest from a rescuecd no diskpartitions are detected
> which is logical as the lvm volume is used as a filesystem and not a
> raw lvm disk.
> 
> Is there a way to use the filebased lvm as root?
> If I use a lvm volume as a raw disk, would it be possible to boot
> from it with grub without virtualisation.
> 

LVM is always a tricky beast. To get the terminology straight, a Volume
Group is made up of a bunch of real partitions called Physical Volumes.
Logical Volumes are virtual partitions that belong to a Volume Group and
physically reside on the Physical Volumes. Since the hard drives that
the Physical Volumes reside on can only be "given" to either dom0 or
domU, the Volume Group can only be managed by one or the other, not
both. The domain that owns the Volume Group is the only domain that can
directly access its Logical Volumes. If (and only if) you have the PV
disk IO drivers running in the domU (either because it is PV or if you
load PVHVM drivers), you can pass a partition straight from dom0 to a
domU. It will show up to the domain as e.g. xvda1, as long as you have
PV drivers. This is very dependent on your domU OS. 

Also, if you're creating a special extra "file" disk to boot the machine
in Xen, there is no need to make it LVM. Make that a simple hard disk
with Grub installed on it, and it should be able to see the other hard
drives on the virtual system and boot them. Grub2 can boot to LVM root
partitions if I recall correctly.

Now, I'm still uncertain as to whether I've answered your questions.
Feel free to clarify if I've misunderstood.

--Sean

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxx
http://lists.xen.org/xen-users


 


Rackspace

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