[Pkg-libvirt-maintainers] Bug#783901: Bug#783901: libvirt-daemon: libvirtd does not recognize Xen guests

Gerald Turner gturner at unzane.com
Fri May 1 19:51:37 UTC 2015


On Fri, May 01 2015, Guido Günther wrote:
> See:
>
>     https://libvirt.org/drvxen.html
>
> you might still have xend running, but

I read that before reporting.  xend is no longer included in jessie (was
in wheezy xen-utils-4.1 package, no longer in jessie xen-utils-4.4
package).  I rebooted after dom0 dist-upgrade.  Definitely no xend
running.

> ...this looks like xenlight indeed but you need to create xenlight
> configs as described at the above URL.

Interesting.  I had been running libvirt thru the lifetime of squeeze
and wheezy without customizing anything under /etc/libvirt, given my
use-case of minimally using libvirt to report stats.  AIUI libvirt was
able to communicate with xend (4.0 and 4.1) and enumerate the domU's
managed by xend, however under Xen 4.4 and the switch to libxl, libvirt
requires configuration.  If that is true then this bug should probably
be closed or at the very least changed to priority 'wishlist'.

The operations side of things seems a bit under-documented, so pardon me
for being verbose, as this may be helpful to someone.

Following the “Converting from XM config files to domain XML”, it's not
obvious where to store the converted config.

Running libvirtd with LIBVIRT_DEBUG=1, I see the following message:

  info : virDomainObjListLoadAllConfigs:19450 : Scanning for configs in /etc/libvirt/libxl

Looks like libvirtd expects configuration in this directory.

  # mkdir /etc/libvirt/libxl
  # virsh -c xen:/// domxml-from-native xen-xm /etc/xen/host1.cfg \
     > /etc/libvirt/libxl/host1.xml

Then restart libvirtd.  Nothing has changed.  More debug output:

  info : virDomainObjListLoadAllConfigs:19450 : Scanning for configs in /etc/libvirt/libxl
  info : virDomainObjListLoadAllConfigs:19474 : Loading config file 'host1.xml'
  error : virDomainDiskDefParseXML:5949 : internal error: Invalid harddisk device name: raw

Inspecting the converted domain XML, I see disk declarations like:

  <disk type='block' device='disk'>
    <driver name='phy'/>
    <source dev='/dev/vg-ssd/lv-host1-root'/>
    <target dev='raw' bus='xen'/>
  </disk>

… dev=raw should probably be dev=xvda, etc.  Otherwise everything else
looks okay.  The libvirt Xen driver documentation speaks of 'XM', while
Xen 4.4 has changed to 'XL' configiration files.  Looking at the libvirt
ChangeLog, I see upstream versions that probably fix this problem:

  * 1.2.12: Jan 27 2015
      libxl: Add support for parsing/formating Xen XL config (Kiarie Kahurani)
      Introduce support for parsing/formatting Xen xl config format (Jim Fehlig)

After correcting the domain XML, and restarting libvirtd once more,
things start progressing:

  # virsh -c xen:/// list --all
   Id    Name                           State
  ----------------------------------------------------
   -     host1                          shut off

… however “shut off” is incorrect.

Not sure how to proceed, other than abandon libvirt, for Xen anyway.
Maybe look at it again during 'stretch'.

-- 
Gerald Turner <gturner at unzane.com>        Encrypted mail preferred!
OpenPGP: 4096R / CA89 B27A 30FA 66C5 1B80  3858 EC94 2276 FDB8 716D
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 948 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-libvirt-maintainers/attachments/20150501/36a69920/attachment.sig>


More information about the Pkg-libvirt-maintainers mailing list