missing code after patch in nova/tests/virt/libvirt/test_imagebackend.py

Bug #1314269 reported by Hauke Bruno
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Unassigned

Bug Description

nova-compute.log on kvm:

2014-04-28 14:51:57.294 14659 ERROR nova.compute.manager [req-e9768eff-116d-4681-9ff6-3ab51dbbdee0 c460eaefef634e4bab938915224a6201 e159f0e56ea545bd84529fc38063
ceee] [instance: 61a3e08f-b22f-47a8-a815-f586422860ef] Instance failed to spawn
2014-04-28 14:51:57.294 14659 TRACE nova.compute.manager [instance: 61a3e08f-b22f-47a8-a815-f586422860ef] Traceback (most recent call last):
2014-04-28 14:51:57.294 14659 TRACE nova.compute.manager [instance: 61a3e08f-b22f-47a8-a815-f586422860ef] File "/usr/lib/python2.7/dist-packages/nova/compute/
manager.py", line 1423, in _spawn
2014-04-28 14:51:57.294 14659 TRACE nova.compute.manager [instance: 61a3e08f-b22f-47a8-a815-f586422860ef] block_device_info)
2014-04-28 14:51:57.294 14659 TRACE nova.compute.manager [instance: 61a3e08f-b22f-47a8-a815-f586422860ef] File "/usr/lib/python2.7/dist-packages/nova/virt/lib
virt/driver.py", line 2088, in spawn
2014-04-28 14:51:57.294 14659 TRACE nova.compute.manager [instance: 61a3e08f-b22f-47a8-a815-f586422860ef] write_to_disk=True)
2014-04-28 14:51:57.294 14659 TRACE nova.compute.manager [instance: 61a3e08f-b22f-47a8-a815-f586422860ef] File "/usr/lib/python2.7/dist-packages/nova/virt/lib
virt/driver.py", line 3084, in to_xml
2014-04-28 14:51:57.294 14659 TRACE nova.compute.manager [instance: 61a3e08f-b22f-47a8-a815-f586422860ef] disk_info, rescue, block_device_info)
2014-04-28 14:51:57.294 14659 TRACE nova.compute.manager [instance: 61a3e08f-b22f-47a8-a815-f586422860ef] File "/usr/lib/python2.7/dist-packages/nova/virt/lib
virt/driver.py", line 2960, in get_guest_config
2014-04-28 14:51:57.294 14659 TRACE nova.compute.manager [instance: 61a3e08f-b22f-47a8-a815-f586422860ef] inst_type):
2014-04-28 14:51:57.294 14659 TRACE nova.compute.manager [instance: 61a3e08f-b22f-47a8-a815-f586422860ef] File "/usr/lib/python2.7/dist-packages/nova/virt/lib
virt/driver.py", line 2737, in get_guest_storage_config
2014-04-28 14:51:57.294 14659 TRACE nova.compute.manager [instance: 61a3e08f-b22f-47a8-a815-f586422860ef] inst_type)
2014-04-28 14:51:57.294 14659 TRACE nova.compute.manager [instance: 61a3e08f-b22f-47a8-a815-f586422860ef] File "/usr/lib/python2.7/dist-packages/nova/virt/lib
virt/driver.py", line 2700, in get_guest_disk_config
2014-04-28 14:51:57.294 14659 TRACE nova.compute.manager [instance: 61a3e08f-b22f-47a8-a815-f586422860ef] self.get_hypervisor_version())
2014-04-28 14:51:57.294 14659 TRACE nova.compute.manager [instance: 61a3e08f-b22f-47a8-a815-f586422860ef] TypeError: libvirt_info() takes exactly 6 arguments (7
 given)

I found this bug https://bugs.launchpad.net/nova/+bug/1233188 and a patch that should fix this issue (https://review.openstack.org/#/c/72575/1//COMMIT_MSG).

But on Ubuntu 12.04.4 LTS with Openstack Havana installed from Ubuntu Cloud Archive this issue is still available because one of the two patched files from this commit isn't present. The changes from https://review.openstack.org/#/c/72575/1/nova/tests/virt/libvirt/test_imagebackend.py are missing. I manually added those lines in test_imagebackend.py and Openstack is working fine.

My nova version:

ii nova-common 1:2013.2.2-0ubuntu1~cloud0 OpenStack Compute - common files
ii nova-compute 1:2013.2.2-0ubuntu1~cloud0 OpenStack Compute - compute node
ii nova-compute-kvm 1:2013.2.2-0ubuntu1~cloud0 OpenStack Compute - compute node (KVM)
ii python-nova 1:2013.2.2-0ubuntu1~cloud0 OpenStack Compute Python libraries
ii python-novaclient 1:2.15.0-0ubuntu1~cloud0 client library for OpenStack Compute API

Let me know if you need further information, poorly I am not a developer so my this report might seem a bit plain.

Hauke Bruno (haukebruno)
description: updated
Revision history for this message
Tiago Mello (timello) wrote :

Hi,

The changes in unit tests shouldn't take effect in the services themselves... So I didn't get how your manual change fixed the problem... Could you provide more information... which changes have you added and where?

Thanks,

Tiago

Changed in nova:
status: New → Incomplete
Revision history for this message
Hauke Bruno (haukebruno) wrote :

Hi Tiago,

honestly I just added the missing 4 lines from this patch ( https://review.openstack.org/#/c/72575/1/nova/tests/virt/libvirt/test_imagebackend.py ) and restarted nova-compute. This solves the "TypeError: libvirt_info() takes exactly 6 arguments (7
 given)" error and I were able to deploy VMs.

If it is relevant: we use the default stack explained in the official Openstack (Havana) docs + Ceph for Cinder and Glance.

Revision history for this message
Justin Shepherd (jshepher) wrote :

@haukebruno: The code in tests/virt/libvirt/test_imagebackend.py would only affect the unit tests. It should not affect an actual running system.

Are you saying, that on your system (with the patch applied to nova/virt/libvirt/imagebackend.py, you are still seeing errors on the running system, and that adding the patch to the tests causes the error to go away?

Revision history for this message
Hauke Bruno (haukebruno) wrote :

@jshepher: I just see the errors while creating a virtual maschine. The creation could not be finished because of this error. After _patching_ the above I was able to create maschines.

Revision history for this message
Hauke Bruno (haukebruno) wrote :

this _problem_ exists for LVM as the image storage too. I just switched from RBD to LVM for some testing stuff and got the same error like above.

I needed to change the LVM counterpart config in nova/virt/libvirt/imagebackend.py as described above to getting things work:

    def libvirt_info(self, disk_bus, disk_dev, device_type, cache_mode,
            extra_specs, hypervisor_version):

Sean Dague (sdague)
Changed in nova:
status: Incomplete → Fix Released
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.