Libvirt create image in 'lxc' container throws UnboundLocalError

Bug #854009 reported by Rohit Karajgi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Invalid
Undecided
Unassigned

Bug Description

I ran a unit test to test the private method _create_image() in virt.libvir.connection with libvirt_type=lxc and unknown disk image format and got the following error:

Traceback (most recent call last):
  File "/home/rohit/nova/diablo/libtests/nova/tests/test_libvirt.py", line 2477, in test_create_image_lxc_unknown_disk_image_ipv6
    network_info=network_info)
  File "/home/rohit/nova/diablo/libtests/nova/virt/libvirt/connection.py", line 1007, in _create_image
  File "/home/rohit/nova/diablo/libtests/nova/virt/disk.py", line 181, in setup_container
UnboundLocalError: local variable 'device' referenced before assignment
-------------------- >> begin captured logging << --------------------
2011-09-19 09:39:43,535 DEBUG nova.utils [-] backend <module 'nova.db.sqlalchemy.api' from '/home/rohit/nova/diablo/libtests/nova/db/sqlalchemy/api.pyc'> from (pid=21143) __get_backend /home/rohit/nova/diablo/libtests/nova/utils.py:447
2011-09-19 09:39:43,669 DEBUG nova.utils [-] Attempting to grab semaphore "get_dhcp" for method "_get_dhcp_ip"... from (pid=21143) inner /home/rohit/nova/diablo/libtests/nova/utils.py:672
2011-09-19 09:39:43,669 DEBUG nova.utils [-] backend <module 'nova.ipv6.rfc2462' from '/home/rohit/nova/diablo/libtests/nova/ipv6/rfc2462.pyc'> from (pid=21143) __get_backend /home/rohit/nova/diablo/libtests/nova/utils.py:447
2011-09-19 09:39:43,672 INFO nova.virt.libvirt_conn [-] instance instance-00000001: Creating image
2011-09-19 09:39:43,673 INFO nova.virt.libvirt_conn [-] instance instance-00000001: injecting key into image 123456
2011-09-19 09:39:43,673 WARNING nova.virt.libvirt_conn [-] instance instance-00000001: ignoring error injecting data into image 123456 ()
2011-09-19 09:39:53,686 ERROR nova.compute.disk [-] Failed to mount filesystem: nbd device /dev/nbd15 did not show up
(nova.compute.disk): TRACE: Traceback (most recent call last):
(nova.compute.disk): TRACE: File "/home/rohit/nova/diablo/libtests/nova/virt/disk.py", line 177, in setup_container
(nova.compute.disk): TRACE: File "/home/rohit/nova/diablo/libtests/nova/virt/disk.py", line 217, in _link_device
(nova.compute.disk): TRACE: Error: nbd device /dev/nbd15 did not show up
(nova.compute.disk): TRACE:
--------------------- >> end captured logging << ---------------------

Revision history for this message
Thierry Carrez (ttx) wrote :

Could it be that you ran out of available NBDs ? Could you try again on a fresh system and see if you reproduce ?

Changed in nova:
status: New → Incomplete
Revision history for this message
Thierry Carrez (ttx) wrote :

We cannot solve the issue you reported without more information. Could you please provide the requested information ?

Revision history for this message
Thierry Carrez (ttx) wrote :

This bug lacks the necessary information to effectively reproduce and fix it, therefore it has been closed. Feel free to reopen the bug by providing the requested information and set the bug status back to ''New''.

Changed in nova:
status: Incomplete → 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.