Public bug reported:

Nova Version: Kilo; 1:2015.1.0-0ubuntu1~cloud0

Steps to reproduce:
1. Create volume from image
2. Boot new instance from this volume
3. Observe error in nova-compute.log

Expected result: Instance boots successfully
Actual result: Failed to prep block device error

----------------------------------------------------------------------------------------------------------
When booting an LXC instance from an existing volume, nova-compute fails with:

  File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py", line 
4290, in _lxc_disk_handler
    block_device_info, disk_info)
  File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py", line 
4226, in _create_domain_setup_lxc
    disk_path = root_disk['connection_info']['data']['device_path']
KeyError: 'device_path'


This happens directly before connecting the volume. Debugging shows that the 
device path is indeed not present at this stage - but rather it shows up 
directly after _connect_volume(). Moving the faulting line down seems to solve 
the issue:


--- a/nova/virt/libvirt/driver.py        2015-05-24 19:37:34.909039728 +0200
+++ b/nova/virt/libvirt/driver.py        2015-05-24 19:36:58.225923316 +0200
@@ -4221,10 +4221,10 @@

         if self._is_booted_from_volume(instance, disk_mapping):
             root_disk = block_device.get_root_bdm(block_device_mapping)
-            disk_path = root_disk['connection_info']['data']['device_path']
             disk_info = blockinfo.get_info_from_bdm(
                 CONF.libvirt.virt_type, image_meta, root_disk)
             self._connect_volume(root_disk['connection_info'], disk_info)
+            disk_path = root_disk['connection_info']['data']['device_path']

             # Get the system metadata from the instance
             use_cow = instance.system_metadata['image_disk_format'] == 'qcow2'

** Affects: nova
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1458354

Title:
  LXC instances cannot boot from volume

Status in OpenStack Compute (Nova):
  New

Bug description:
  Nova Version: Kilo; 1:2015.1.0-0ubuntu1~cloud0

  Steps to reproduce:
  1. Create volume from image
  2. Boot new instance from this volume
  3. Observe error in nova-compute.log

  Expected result: Instance boots successfully
  Actual result: Failed to prep block device error

  
----------------------------------------------------------------------------------------------------------
  When booting an LXC instance from an existing volume, nova-compute fails with:

    File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py", line 
4290, in _lxc_disk_handler
      block_device_info, disk_info)
    File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py", line 
4226, in _create_domain_setup_lxc
      disk_path = root_disk['connection_info']['data']['device_path']
  KeyError: 'device_path'

  
  This happens directly before connecting the volume. Debugging shows that the 
device path is indeed not present at this stage - but rather it shows up 
directly after _connect_volume(). Moving the faulting line down seems to solve 
the issue:


  --- a/nova/virt/libvirt/driver.py        2015-05-24 19:37:34.909039728 +0200
  +++ b/nova/virt/libvirt/driver.py        2015-05-24 19:36:58.225923316 +0200
  @@ -4221,10 +4221,10 @@

           if self._is_booted_from_volume(instance, disk_mapping):
               root_disk = block_device.get_root_bdm(block_device_mapping)
  -            disk_path = root_disk['connection_info']['data']['device_path']
               disk_info = blockinfo.get_info_from_bdm(
                   CONF.libvirt.virt_type, image_meta, root_disk)
               self._connect_volume(root_disk['connection_info'], disk_info)
  +            disk_path = root_disk['connection_info']['data']['device_path']

               # Get the system metadata from the instance
               use_cow = instance.system_metadata['image_disk_format'] == 
'qcow2'

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1458354/+subscriptions

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to     : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to