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]
Fix proposed to branch: master /review. openstack. org/17821
Review: https:/