Bug 907324

Summary: libvirt: unsupported configuration: native I/O needs either no disk cache or directsync cache mode, QEMU will fallback to aio=threads
Product: [openSUSE] openSUSE Tumbleweed Reporter: Martin Pluskal <mpluskal>
Component: BasesystemAssignee: Charles Arnold <carnold>
Status: RESOLVED FIXED QA Contact: Jason Douglas <jdouglas>
Severity: Normal    
Priority: P5 - None CC: brogers, jfehlig
Version: 201411*   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: virt-manager --debug

Description Martin Pluskal 2014-11-26 13:53:03 UTC
Created attachment 615104 [details]
virt-manager --debug

Instalation via virt-manager, when lvm is used as default storage fails:
summary=Unable to complete install: 'unsupported configuration: native I/O needs either no disk cache or directsync cache mode, QEMU will fallback to aio=threads'
details=Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 89, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/create.py", line 1958, in do_install
    guest.start_install(meter=meter)
  File "/usr/share/virt-manager/virtinst/guest.py", line 428, in start_install
    noboot)
  File "/usr/share/virt-manager/virtinst/guest.py", line 492, in _create_guest
    dom = self.conn.createLinux(start_xml or final_xml, 0)
  File "/usr/lib64/python2.7/site-packages/libvirt.py", line 3464, in createLinux
    if ret is None:raise libvirtError('virDomainCreateLinux() failed', conn=self)
libvirtError: unsupported configuration: native I/O needs either no disk cache or directsync cache mode, QEMU will fallback to aio=threads



# systemctl status libvirtd
libvirtd.service - Virtualization daemon
   Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled)
   Active: active (running) since Wed 2014-11-26 14:30:16 CET; 20min ago
     Docs: man:libvirtd(8)
           http://libvirt.org
 Main PID: 1345 (libvirtd)
   CGroup: /system.slice/libvirtd.service
           ├─1345 /usr/sbin/libvirtd --listen
           ├─1680 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/vnet0.conf --dhcp-script=/usr/lib64/libvirt/libvirt_leaseshelper
           └─1681 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/vnet0.conf --dhcp-script=/usr/lib64/libvirt/libvirt_leaseshelper

Nov 26 14:30:17 medusa dnsmasq[1680]: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth DNSSEC
Nov 26 14:30:17 medusa dnsmasq-dhcp[1680]: DHCP, IP range 192.168.100.128 -- 192.168.100.254, lease time 1h
Nov 26 14:30:17 medusa dnsmasq-dhcp[1680]: DHCP, sockets bound exclusively to interface virbr0
Nov 26 14:30:17 medusa dnsmasq[1680]: reading /etc/resolv.conf
Nov 26 14:30:17 medusa dnsmasq[1680]: using nameserver 10.100.2.10#53
Nov 26 14:30:17 medusa dnsmasq[1680]: using nameserver 10.100.2.8#53
Nov 26 14:30:17 medusa dnsmasq[1680]: read /etc/hosts - 7 addresses
Nov 26 14:30:17 medusa dnsmasq[1680]: read /var/lib/libvirt/dnsmasq/vnet0.addnhosts - 0 addresses
Nov 26 14:30:17 medusa dnsmasq-dhcp[1680]: read /var/lib/libvirt/dnsmasq/vnet0.hostsfile
Nov 26 14:47:48 medusa libvirtd[1345]: End of file while reading data: Input/output error
Comment 1 James Fehlig 2014-11-27 10:54:01 UTC
Looks like virtinst-set-cache-mode-unsafe-for-install.patch is not quite smart enough to handle block devices.  From set_defaults() in virtinst/devicedisk.py

  # Enable cache=none and io=native for block devices. Would
  # be nice if qemu did this for us but that time has long passed.
  if not self.driver_cache:
      self.driver_cache = self.CACHE_MODE_NONE
  if not self.driver_io:
      self.driver_io = self.IO_MODE_NATIVE

And if I understand the code correctly, virtinst-set-cache-mode-unsafe-for-install.patch will change the cache mode to 'unsafe' during install phase, which seems to be the cased based on the disk config in the install XML from the virt-manager log file

    <disk type="block" device="disk">
      <driver name="qemu" type="raw" cache="unsafe" io="native"/>
      <source dev="/dev/storage/openSUSE-Factory"/>
      <target dev="vda" bus="virtio"/>
    </disk>

Unfortunately, as noted in the error, io='native' is only compatible with cache='none' or cache='directsync'.

Passing to Charles to take a look...
Comment 2 Charles Arnold 2014-12-01 20:25:04 UTC
Virt-manager will now skip setting 'unsafe' for any install target that is
a block device. Thanks Jim for tracking this down. This change is pushed
out to the Virtualization repo and will be in a future SLE12 maintenance
release.
Marking Fixed.
Comment 3 Charles Arnold 2014-12-02 01:03:45 UTC
Fixed.
Comment 4 Swamp Workflow Management 2014-12-24 13:05:52 UTC
openSUSE-RU-2014:1705-1: An update that has 5 recommended fixes can now be installed.

Category: recommended (low)
Bug References: 900320,907319,907324,907958,909225
CVE References: 
Sources used:
openSUSE 13.2 (src):    virt-manager-1.0.1-14.11.1
Comment 5 Swamp Workflow Management 2015-08-18 17:10:30 UTC
SUSE-RU-2015:1405-1: An update that has 10 recommended fixes can now be installed.

Category: recommended (moderate)
Bug References: 900320,901869,907319,907324,907958,909225,909602,910929,934270,937386
CVE References: 
Sources used:
SUSE Linux Enterprise Server 12 (src):    virt-manager-1.0.1-17.3.1
SUSE Linux Enterprise Desktop 12 (src):    virt-manager-1.0.1-17.3.1