Hello everyone, On gio, 2014-06-12 at 08:20 +0100, Richard W.M. Jones wrote:> On Wed, Jun 11, 2014 at 10:02:22PM +0100, George Dunlap wrote: > > On Wed, Jun 11, 2014 at 8:34 PM, Richard W.M. Jones <rjones@redhat.com> wrote: > > > Do you know what extra packages have to be installed or commands need > > > to be run to enable Xen drivers in Fedora? > > > > The kernel already has a lot of the Xen stuff enabled. AFAICT from > > looking at the boot output it's just missing those two modules in the > > initrd. (Although it's possible you'll need more.) I'm pretty sure > > they should just come in the normal kernel rpm; there aren't really > > any user-space components necessary for basic functionality of a Xen > > guest. (There are a few tools which someone might want to install for > > one purpose or another -- tools for querying Xen state or acting as a > > "driver domain" -- but they're something that should be added as > > needed, not in the core.) > > I suspect we may need to run a dracut command in %post. Something > like: > > dracut --add-drivers "some list of xen kmods ..." > > I'm not sure which Xen drivers are required. The Fedora 21 kernel has > 13 files named 'xen*.ko.xz'. >So, first of all, forgive my libguestfs / virt-builder ignorance. :-) About the modules, what I know is that if I point virt-install to this location: http://mirror.euserv.net/linux/fedora/linux/releases/20/Fedora/x86_64/os/ it just works, i.e., the installer is able to see the virtual disk and network interface while running in a Xen (PV) guest. Looking inside the initrd.img that the above uses, here's what I find: $ find lib/modules/3.11.10-301.fc20.x86_64/ -iname xen* lib/modules/3.11.10-301.fc20.x86_64/kernel/drivers/block/xen-blkfront.ko lib/modules/3.11.10-301.fc20.x86_64/kernel/drivers/net/xen-netback lib/modules/3.11.10-301.fc20.x86_64/kernel/drivers/net/xen-netback/xen-netback.ko lib/modules/3.11.10-301.fc20.x86_64/kernel/drivers/net/xen-netfront.ko So, if we're talking about an initrd, or an initrd-like thing, the above is probably all we need. Is that what we're talking about? :-) Regards, Dario -- <<This happens because I choose it to happen!>> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
On Thu, Jun 12, 2014 at 1:20 PM, Dario Faggioli <dario.faggioli@citrix.com> wrote:> Hello everyone, > > On gio, 2014-06-12 at 08:20 +0100, Richard W.M. Jones wrote: >> On Wed, Jun 11, 2014 at 10:02:22PM +0100, George Dunlap wrote: >> > On Wed, Jun 11, 2014 at 8:34 PM, Richard W.M. Jones <rjones@redhat.com> wrote: >> > > Do you know what extra packages have to be installed or commands need >> > > to be run to enable Xen drivers in Fedora? >> > >> > The kernel already has a lot of the Xen stuff enabled. AFAICT from >> > looking at the boot output it's just missing those two modules in the >> > initrd. (Although it's possible you'll need more.) I'm pretty sure >> > they should just come in the normal kernel rpm; there aren't really >> > any user-space components necessary for basic functionality of a Xen >> > guest. (There are a few tools which someone might want to install for >> > one purpose or another -- tools for querying Xen state or acting as a >> > "driver domain" -- but they're something that should be added as >> > needed, not in the core.) >> >> I suspect we may need to run a dracut command in %post. Something >> like: >> >> dracut --add-drivers "some list of xen kmods ..." >> >> I'm not sure which Xen drivers are required. The Fedora 21 kernel has >> 13 files named 'xen*.ko.xz'. >> > So, first of all, forgive my libguestfs / virt-builder ignorance. :-) > > About the modules, what I know is that if I point virt-install to this > location: > http://mirror.euserv.net/linux/fedora/linux/releases/20/Fedora/x86_64/os/ > > it just works, i.e., the installer is able to see the virtual disk and > network interface while running in a Xen (PV) guest. > > Looking inside the initrd.img that the above uses, here's what I find: > > $ find lib/modules/3.11.10-301.fc20.x86_64/ -iname xen* > lib/modules/3.11.10-301.fc20.x86_64/kernel/drivers/block/xen-blkfront.ko > lib/modules/3.11.10-301.fc20.x86_64/kernel/drivers/net/xen-netback > lib/modules/3.11.10-301.fc20.x86_64/kernel/drivers/net/xen-netback/xen-netback.ko > lib/modules/3.11.10-301.fc20.x86_64/kernel/drivers/net/xen-netfront.koI'm not sure why they have xen-netback in there -- that's a network *provider*, not a network *consumer*. It certainly shouldn't be necessary for booting! xen-blkfront and xen-netfront were the two that I mentioned in my original e-mail; I'm pretty sure just adding those two should work. For the KVM folks: unlike virtio, which is provided to the guest by qemu, the traditional Xen PV devices are provided by another VM on the system. This is typically domain 0, but can actually be any VM. The code providing the virtual device is called the "back-end", and the code consuming the virtual device is called the "front-end". All you need in the initrd are front-ends for disk and network -- xen-blkfront and xen-netfront. -George
Richard W.M. Jones
2014-Jun-12 12:42 UTC
Re: [Libguestfs] Xen drivers for virt-builder images
On Thu, Jun 12, 2014 at 02:20:49PM +0200, Dario Faggioli wrote:> So, first of all, forgive my libguestfs / virt-builder ignorance. :-) > > About the modules, what I know is that if I point virt-install to this > location: > http://mirror.euserv.net/linux/fedora/linux/releases/20/Fedora/x86_64/os/ > > it just works, i.e., the installer is able to see the virtual disk and > network interface while running in a Xen (PV) guest. > > Looking inside the initrd.img that the above uses, here's what I find: > > $ find lib/modules/3.11.10-301.fc20.x86_64/ -iname xen* > lib/modules/3.11.10-301.fc20.x86_64/kernel/drivers/block/xen-blkfront.ko > lib/modules/3.11.10-301.fc20.x86_64/kernel/drivers/net/xen-netback > lib/modules/3.11.10-301.fc20.x86_64/kernel/drivers/net/xen-netback/xen-netback.ko > lib/modules/3.11.10-301.fc20.x86_64/kernel/drivers/net/xen-netfront.ko > > So, if we're talking about an initrd, or an initrd-like thing, the above > is probably all we need. Is that what we're talking about? :-)I believe the problem is that we use KVM to build the virt-builder guest images. When the kernel package is installed by kickstart, since the hypervisor at build time != Xen, dracut decides not to include the Xen drivers. I think we can fix this by running dracut again in %post, and I propose that running dracut as follows should fix this: %post dracut --add-drivers "xen:vbd xen:vif" (assuming what Olaf says works), or: %post dracut --add-drivers "xen-blkfront xen-netback xen-netfront" I will try it shortly. Rich. PS. Why would a Xen domU need the netback driver? -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/
Richard W.M. Jones
2014-Jun-12 14:12 UTC
Re: [Libguestfs] Xen drivers for virt-builder images
Not quite as easy as I imagined. However by using the attached patch I have managed to add the two Xen drivers to the initramfs. (I haven't been able to test that it boots in Xen however) I'm just building an updated Fedora 20 image which I'll upload later today. Are there other guests that need to be updated in the same way? The RHEL 7 RC guest probably no longer works, since it looks like we've got and deleted the binary packages from ftp.redhat.com. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://people.redhat.com/~rjones/virt-top