Bug 1043572

Summary: don't perform arch/os/hvtype validation when reading configs from disk
Product: [Community] Virtualization Tools Reporter: Cole Robinson <crobinso>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: ingram.julian, lzap, rbalakri
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-10-06 19:40:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Cole Robinson 2013-12-16 16:38:13 UTC
Right now, if you try to define a guest with an architecture, os type, or domain type that isn't listed in the driver's capabilities XML, the XML parsing code will error:

error: unknown OS type hvm

Doing this check at define time has caused user confusion in the past: say qemu is accidentally uninstalled, and libvirtd is restarted. the qemu driver capabilities are now empty, and any pre-existing configs will fail to load. virsh list --all is now empty, and users are confused.

Some discussion here:

http://www.redhat.com/archives/libvir-list/2013-December/msg00877.html

We should move these checks to some generic startup error reporting function that can be shared across drivers.

While we are at it, we should clarify that particular error message to try and describe better what the root issue is. Maybe an explicit warning if capabilities has no guests found?

Comment 1 Cole Robinson 2013-12-16 16:38:25 UTC
*** Bug 971544 has been marked as a duplicate of this bug. ***

Comment 2 Lukas Zapletal 2014-11-04 13:15:13 UTC
Is there a workaround? I am hitting this on RHEL 7.0 after I do this:

  echo 'auth_unix_rw = "none"' >> /etc/libvirt/libvirtd.conf
  echo 'auth_tls = "none"' >> /etc/libvirt/libvirtd.conf
  service libvirtd restart && sleep 10

  # create network
  cat >/tmp/nested.xml <<'EON'
<network>
  <name>nested</name>
  <uuid>71e5409e-59d0-11e4-8c48-3ca9f45639f8</uuid>
  <forward mode='nat'/>
  <bridge name='virbr1' stp='on' delay='0' />
  <mac address='52:54:C4:9E:13:05'/>
  <ip address='192.168.222.1' netmask='255.255.255.0'>
  </ip>
</network>
EON
  virsh net-define /tmp/nested.xml
  virsh net-start nested
  virsh net-autostart nested

  # create pool
  mkdir -p /var/lib/libvirt/nested
  cat >/tmp/nested.xml <<'EOP'
<pool type='dir'>
  <name>nested</name>
  <uuid>1117824d-b2dc-441f-8543-f49308c77d2a</uuid>
  <source>
  </source>
  <target>
    <path>/var/lib/libvirt/nested</path>
    <permissions>
      <mode>0755</mode>
      <owner>-1</owner>
      <group>-1</group>
    </permissions>
  </target>
</pool>
EOP
  virsh pool-define /tmp/nested.xml
  virsh pool-autostart nested

Now when I try to create a VM -> BANG.

Comment 3 Cole Robinson 2014-11-04 15:51:15 UTC
Could be either: missing qemu, host doesn't have hardware virt support, or libvirtd needs a restart.

Comment 4 Cole Robinson 2015-04-18 01:50:49 UTC
patches posted here: https://www.redhat.com/archives/libvir-list/2015-April/thread.html

first patch improves the error message, second patch skips this validation check when reading configs from disk at daemon startup time.

Comment 5 Cole Robinson 2015-10-06 19:40:45 UTC
This all landed in v1.2.15