On Wed, Jun 11, 2014 at 8:34 PM, Richard W.M. Jones <rjones@redhat.com> wrote:> On Wed, Jun 11, 2014 at 06:15:33PM +0100, George Dunlap wrote: >> I've just been playing around with virt-builder, and it seems like a >> pretty useful tool. However, it seems that in a number of the images, >> the initrd file is missing drivers for Xen virtual block and network >> devices. This results in a VM that can't find its root device. >> >> The files needed are drivers/block/xen-blkfront.ko and >> drivers/net/xen-netfront.ko. They seem to be present in centos-6 and >> ubuntu-14.04, but not in rhel-7rc or fedora-20. >> >> Whom would I contact to get these added? > > That would likely be me or Pino Toscano, but read on :-) > > Firstly I'd like to say that the current images shipped in > http://libguestfs.org/download/builder/ are a temporary solution that > has turned out to be more permanent than we wished for. Eventually we > want to simply use the cloud images shipped by the Linux distros, and > just provide simple metadata and the virt-builder front end. When we > do that (and it's not a huge change) then the issue of drivers for > Xen, VMware, virtio, etc will be up to the distros to solve.Right -- that makes sense. I'm helping out with the CentOS Virt SIG at the moment, so I can try to make that happen for CentOS when the time comes. :-)> However at the moment we could add Xen drivers to our current scripts, > located here: > > https://github.com/libguestfs/libguestfs/tree/master/builder/website (*.sh) > > For Fedora and RHEL, it would require a modest change to the kickstart > embedded in those scripts, plus rebuilding the images and reuploading > them. > > 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.) Dario has more familiarity with Fedora and Xen -- Dario, any comments? Thanks for your help, -George
Richard W.M. Jones
2014-Jun-12 07:20 UTC
Re: [Libguestfs] Xen drivers for virt-builder images
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'. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
On Thu, Jun 12, Richard W.M. Jones wrote:> dracut --add-drivers "some list of xen kmods ..."Whatever you do: please use modaliases like 'xen:vbd xen:vif' or whatever the actual name is. Olaf
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)