KeyError of log message in virt/libvirt/utils.py/create_lvm_image()/check_size()

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

Bug Description

In function check_size() of nova/virt/libvirt/utils.py, when creating lvm image and the free space of volume group is not enough, it will raise RuntimeError exception. The exception information includes message about vg and lv, which can not be parsed by locals().

Following is the error log:
2012-12-08 20:03:51 TRACE nova.compute.manager [instance: 352e4eb6-8d5c-4170-ab4d-0ee4333bf34e] Traceback (most recent call last):
2012-12-08 20:03:51 TRACE nova.compute.manager [instance: 352e4eb6-8d5c-4170-ab4d-0ee4333bf34e] File "/usr/local/lib/python2.7/dist-packages/nova/compute/manager.py", line 1105, in _spawn
2012-12-08 20:03:51 TRACE nova.compute.manager [instance: 352e4eb6-8d5c-4170-ab4d-0ee4333bf34e] block_device_info)
2012-12-08 20:03:51 TRACE nova.compute.manager [instance: 352e4eb6-8d5c-4170-ab4d-0ee4333bf34e] File "/usr/local/lib/python2.7/dist-packages/nova/exception.py", line 117, in wrapped
2012-12-08 20:03:51 TRACE nova.compute.manager [instance: 352e4eb6-8d5c-4170-ab4d-0ee4333bf34e] temp_level, payload)
2012-12-08 20:03:51 TRACE nova.compute.manager [instance: 352e4eb6-8d5c-4170-ab4d-0ee4333bf34e] File "/usr/lib/python2.7/contextlib.py", line 24, in __exit__
2012-12-08 20:03:51 TRACE nova.compute.manager [instance: 352e4eb6-8d5c-4170-ab4d-0ee4333bf34e] self.gen.next()
2012-12-08 20:03:51 TRACE nova.compute.manager [instance: 352e4eb6-8d5c-4170-ab4d-0ee4333bf34e] File "/usr/local/lib/python2.7/dist-packages/nova/exception.py", line 92, in wrapped
2012-12-08 20:03:51 TRACE nova.compute.manager [instance: 352e4eb6-8d5c-4170-ab4d-0ee4333bf34e] return f(*args, **kw)
2012-12-08 20:03:51 TRACE nova.compute.manager [instance: 352e4eb6-8d5c-4170-ab4d-0ee4333bf34e] File "/usr/local/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py", line 1202, in spawn
2012-12-08 20:03:51 TRACE nova.compute.manager [instance: 352e4eb6-8d5c-4170-ab4d-0ee4333bf34e] admin_pass=admin_password)
2012-12-08 20:03:51 TRACE nova.compute.manager [instance: 352e4eb6-8d5c-4170-ab4d-0ee4333bf34e] File "/usr/local/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py", line 1667, in _create_image
2012-12-08 20:03:51 TRACE nova.compute.manager [instance: 352e4eb6-8d5c-4170-ab4d-0ee4333bf34e] ephemeral_size=ephemeral_gb)
2012-12-08 20:03:51 TRACE nova.compute.manager [instance: 352e4eb6-8d5c-4170-ab4d-0ee4333bf34e] File "/usr/local/lib/python2.7/dist-packages/nova/virt/libvirt/imagebackend.py", line 131, in cache
2012-12-08 20:03:51 TRACE nova.compute.manager [instance: 352e4eb6-8d5c-4170-ab4d-0ee4333bf34e] *args, **kwargs)
2012-12-08 20:03:51 TRACE nova.compute.manager [instance: 352e4eb6-8d5c-4170-ab4d-0ee4333bf34e] File "/usr/local/lib/python2.7/dist-packages/nova/virt/libvirt/imagebackend.py", line 219, in create_image
2012-12-08 20:03:51 TRACE nova.compute.manager [instance: 352e4eb6-8d5c-4170-ab4d-0ee4333bf34e] size, sparse=self.sparse)
2012-12-08 20:03:51 TRACE nova.compute.manager [instance: 352e4eb6-8d5c-4170-ab4d-0ee4333bf34e] File "/usr/local/lib/python2.7/dist-packages/nova/virt/libvirt/utils.py", line 131, in create_lvm_image
2012-12-08 20:03:51 TRACE nova.compute.manager [instance: 352e4eb6-8d5c-4170-ab4d-0ee4333bf34e] check_size(size)
2012-12-08 20:03:51 TRACE nova.compute.manager [instance: 352e4eb6-8d5c-4170-ab4d-0ee4333bf34e] File "/usr/local/lib/python2.7/dist-packages/nova/virt/libvirt/utils.py", line 116, in check_size
2012-12-08 20:03:51 TRACE nova.compute.manager [instance: 352e4eb6-8d5c-4170-ab4d-0ee4333bf34e] ' by volume %(lv)s.') % locals())
2012-12-08 20:03:51 TRACE nova.compute.manager [instance: 352e4eb6-8d5c-4170-ab4d-0ee4333bf34e] KeyError: u'vg'
2012-12-08 20:03:51 TRACE nova.compute.manager [instance: 352e4eb6-8d5c-4170-ab4d-0ee4333bf34e]

wangpan (hzwangpan)
Changed in nova:
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/17821

Changed in nova:
assignee: nobody → QiangGuan (hzguanqiang)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/17821
Committed: http://github.com/openstack/nova/commit/c6a30c4bbcdb99e1eb1b6f782c39a1ef18c4ad08
Submitter: Jenkins
Branch: master

commit c6a30c4bbcdb99e1eb1b6f782c39a1ef18c4ad08
Author: Qiang Guan <email address hidden>
Date: Tue Dec 11 10:55:35 2012 +0800

    Fix KeyError of log message in virt/libvirt/utils.py

    Add arguments vg and lv for function check_size() so that locals() can get
    them.

    Fixes: bug #1088434

    Change-Id: I6b5609fe1be7e0bf09a45e65eab91427059a89db

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → grizzly-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: grizzly-2 → 2013.1
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.