fail to create vm since upgrade to raring

Bug #1157272 reported by Vincent Ladeuil
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libvirt (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Since I upgraded to raring, creating a vm is failing with:
$ sudo virt-install --noautoconsole --serial file,path=/caviar3/libvirt/images/precise-server-pristine.console --network bridge=br0 --graphics spice --name precise-server-pristine --ram 2048 --vcpus 2 --disk path=/caviar3/libvirt/images/precise-server-pristine.qcow2,format=qcow2 --disk path=/caviar3/libvirt/images/precise-server-pristine.seed --boot hd --hvm
ERROR An error occurred, but the cause is unknown

~/.virtinst/virt-install.log contains a slightly more helpful traceback:

[Tue, 19 Mar 2013 16:48:26 virt-install 15392] DEBUG (cli:226) Launched with command line:
/usr/bin/virt-install --noautoconsole --serial file,path=/caviar3/libvirt/images/precise-server-pristine.console --network bridge=br0 --graphics spice --name precise-server-pristine --ram 2048 --vcpus 2 --disk path=/caviar3/libvirt/images/precise-server-pristine.qcow2,format=qcow2 --disk path=/caviar3/libvirt/images/precise-server-pristine.seed --boot hd --hvm
[Tue, 19 Mar 2013 16:48:26 virt-install 15392] DEBUG (cli:331) Requesting libvirt URI default
[Tue, 19 Mar 2013 16:48:26 virt-install 15392] DEBUG (cli:333) Received libvirt URI vbox:///system
[Tue, 19 Mar 2013 16:48:26 virt-install 15392] DEBUG (virt-install:261) Requesting virt method 'hvm', hv type 'default'.
[Tue, 19 Mar 2013 16:48:26 virt-install 15392] DEBUG (virt-install:471) Received virt method 'hvm'
[Tue, 19 Mar 2013 16:48:26 virt-install 15392] DEBUG (virt-install:472) Hypervisor name is 'vbox'
[Tue, 19 Mar 2013 16:48:26 virt-install 15392] ERROR (cli:444) An error occurred, but the cause is unknown
[Tue, 19 Mar 2013 16:48:26 virt-install 15392] DEBUG (cli:447)
Traceback (most recent call last):
  File "/usr/bin/virt-install", line 1017, in <module>
    sys.exit(main())
  File "/usr/bin/virt-install", line 1002, in main
    guest = build_guest_instance(conn, options)
  File "/usr/bin/virt-install", line 531, in build_guest_instance
    options.disksize, options.sparse, need_storage)
  File "/usr/bin/virt-install", line 166, in get_disks
    get_disk(disklist[idx], sizelist[idx], sparse, guest, is_file_path)
  File "/usr/bin/virt-install", line 139, in get_disk
    collidelist=collidelist)
  File "/usr/lib/python2.7/dist-packages/virtinst/cli.py", line 1618, in parse_disk
    format=fmt)
  File "/usr/lib/python2.7/dist-packages/virtinst/VirtualDisk.py", line 659, in __init__
    self.vol_install)
  File "/usr/lib/python2.7/dist-packages/virtinst/VirtualDisk.py", line 974, in __change_storage
    path)
  File "/usr/lib/python2.7/dist-packages/virtinst/VirtualDisk.py", line 182, in _check_if_path_managed
    vol = lookup_vol_by_path()[0]
  File "/usr/lib/python2.7/dist-packages/virtinst/VirtualDisk.py", line 164, in lookup_vol_by_path
    vol = conn.storageVolLookupByPath(path)
  File "/usr/lib/python2.7/dist-packages/libvirt.py", line 3408, in storageVolLookupByPath
    if ret is None:raise libvirtError('virStorageVolLookupByPath() failed', conn=self)
libvirtError: An error occurred, but the cause is unknown

By instrumenting /usr/lib/python2.7/dist-packages/libvirt.py I confirmed that the path received by storageVolLookupByPath is: /caviar3/libvirt/images/precise-server-pristine.qcow2

Also, the "DEBUG (virt-install:472) Hypervisor name is 'vbox'" part is weird, I do have vbox installed but I migrated to kvm... a year and a day ago according to my notes ;)

Revision history for this message
Vincent Ladeuil (vila) wrote :

Uninstalling vbox solved the problem...

Pretty weird, I don't run any vbox vm anymore...

I couldn't simply uninstall vbox 4.1 (yeah, I was out of date since 4.2 is the new stable for months), there were two processes from vbox still running (probably started at boot). I had to kill them first and then 'sudo service libvirt-bin restart' to successfully create the vm.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

The getDefaultURI function in libvirt first checks

LIBVIRT_DEFAULT_URI

in your environment, then checks

uri_default

in /etc/libvirt/libvirt.conf (which we have commented out by default).

If neither of those is set, then get_default_uri will simply return (I assume) the first one to have been registered.

I'm not sure whether we want to uncomment the default in libvirt.conf (probably not, as lbivirt doesn't depend on qemu), or change the order so that libvirt makes sure to register kvm over vbox if available (and if no other preference is marked).

Or if we want to accept it as it is.

Revision history for this message
Vincent Ladeuil (vila) wrote :

So, neither LIBVIRT_DEFAULT_URI or uri_default is set in my config.

But in order to confirm the bug I installed vbox 4.2 (instead of 4.1 when I first reported the bug) from deb http://download.virtualbox.org/virtualbox/debian precise non-free contrib

I don't encounter the issue anymore. And I didn't even specify '-connect qemu:///system' to virt-install.

To triple check, I even started an old vm with vbox before attempting a virt-install. Still no way to reproduce anymore.

Given that if the issue ever comes back, using either -connect qemu:///system, LIBVIRT_DEFAULT_URI or uri_default should work around it, I think it's safe to close this bug on the premise that the outdated vbox-4.1 was the culprit.

Thanks for the help.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote : Re: [Bug 1157272] Re: fail to create vm since upgrade to raring

Thanks for the info, Vincent. Please do reopen if you see this again.

 status: invalid

Changed in libvirt (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.