Bug 1518899

Summary: vagrant-libvirt creates invalid xml for libvirt-3.7.0-2
Product: [Fedora] Fedora Reporter: Andreas Bleischwitz <ableisch>
Component: vagrant-libvirtAssignee: Pavel Valena <pvalena>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 27CC: lmohanty, madam, pvalena, strzibny, thrcka, vondruch
Target Milestone: ---   
Target Release: ---   
Hardware: noarch   
OS: Linux   
Whiteboard:
Fixed In Version: vagrant-libvirt-0.0.40-3.fc27 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-12-21 19:02:33 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 Andreas Bleischwitz 2017-11-29 17:47:59 UTC
Description of problem:
Starting a new virtual machine throws an error about invalid XML:
Call to virDomainDefineXML failed: internal error: Unknown source mode '' when using "org.qemu.guest_agent.0"

Version-Release number of selected component (if applicable):
libvirt-3.7.0-2.fc27.x86_64
vagrant-libvirt-0.0.40.2.fc27.noarch
vagrant-1.9.8-1.fc27.noarch

How reproducible:
Install vagrant-libvirt, try to start a virtual machine using vagrant, see it failing during the creation of that virtual machine.

===== Vagrant-file ======
Vagrant.configure(2) do |config|
  config.vm.box = "centos/7"
  config.vm.provider :libvirt do |domain|
    domain.memory = 2048
    domain.cpu_mode = 'host-passthrough'
    domain.management_network_name = "private_network"
  end  
  config.vm.define 'centos' do |node|
    node.vm.hostname = 'centos.example.com'
  end
end

========


Steps to Reproduce:
1. yum install vagrant-libvirt
2. place $Vagrant-file in a folder as "Vagrantfile" 
3. try to bring up vm: vagrant up

Actual results:
==> centos:  -- INPUT:               type=mouse, bus=ps2
==> centos:  -- CHANNEL:             type=unix, mode=
==> centos:  -- CHANNEL:             target_type=virtio, target_name=org.qemu.guest_agent.0
==> centos:  -- CHANNEL:             type=spicevmc, mode=
==> centos:  -- CHANNEL:             target_type=virtio, target_name=com.redhat.spice.0
Error while creating domain: Error saving the server: Call to virDomainDefineXML failed: internal error: Unknown source mode ''

Expected results:
virtual machine starting up

Additional info:

See https://github.com/vagrant-libvirt/vagrant-libvirt/issues/831 for further details and fix.

Most recent version from the github source should already contain the fix.

Comment 1 Pavel Valena 2017-11-29 21:15:20 UTC
Hello Andreas,
thank you for your report.

I can confirm the issue occurs on Fedora Rawhide, with a Vagrantfile from corresponding upstream issue #831:

```
Vagrant.configure("2") do |config|

  config.vm.box = "centos/7"

  config.vm.provider :libvirt do |libvirt|
    libvirt.channel :type => 'unix',     :target_name => 'org.qemu.guest_agent.0', :target_type => 'virtio'
  end
end

```

Applying the upstream patch[1], solves the issue. Hopefully, there'll be a release soon(patch is 1d old).

[1] https://github.com/vagrant-libvirt/vagrant-libvirt/commit/a64c538f7fa6b95f4a4bc8cabfd598d2ada149a0.patch

Comment 2 Pavel Valena 2017-12-05 00:56:52 UTC
The release is planned [1], but `fog-libvirt` may complicate things [2].
I'll just backport the patch for now.

[1] https://github.com/vagrant-libvirt/vagrant-libvirt/issues/837
[2] https://github.com/fog/fog-libvirt/pull/29

Comment 3 Fedora Update System 2017-12-08 16:16:43 UTC
vagrant-libvirt-0.0.40-3.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2017-589585e42e

Comment 4 Fedora Update System 2017-12-10 00:33:36 UTC
vagrant-libvirt-0.0.40-3.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-589585e42e

Comment 5 Fedora Update System 2017-12-21 19:02:33 UTC
vagrant-libvirt-0.0.40-3.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.