← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1936439] Re: extend_volume for libvirt / iscsi volumes fails due to faulty debug code

 

Reviewed:  https://review.opendev.org/c/openstack/nova/+/801003
Committed: https://opendev.org/openstack/nova/commit/ad60f23be3d562422b350aade04aa92ade39fb32
Submitter: "Zuul (22348)"
Branch:    master

commit ad60f23be3d562422b350aade04aa92ade39fb32
Author: Mark Mielke <mark.mielke@xxxxxxxxx>
Date:   Thu Jul 15 18:34:36 2021 -0400

    extend_volume of libvirt/volume/iscsi should not use device_path
    
    The connection_info['data']['device_path'] field is not always
    available. In cases that it was not available, it would cause
    the debug code to raise a KeyError instead of proceeding.
    
    Other similar debug messages in the same file do not include
    device_path. As a simple fix, just drop the device_path from
    the log.
    
    Closes-Bug: #1936439
    
    Change-Id: Id0539d2ee909d86ffef07ae566697db8ae0f83b4
    Signed-off-by: Mark Mielke <mark.mielke@xxxxxxxxx>


** Changed in: nova
       Status: In Progress => Fix Released

-- 
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/1936439

Title:
  extend_volume for libvirt / iscsi volumes fails due to faulty debug
  code

Status in OpenStack Compute (nova):
  Fix Released

Bug description:
  Python module nova/virt/libvirt/volume/iscsi.py has the following
  code:

      def extend_volume(self, connection_info, instance, requested_size):
          """Extend the volume."""
          LOG.debug("calling os-brick to extend iSCSI Volume", instance=instance)
          new_size = self.connector.extend_volume(connection_info['data'])
          LOG.debug("Extend iSCSI Volume %s; new_size=%s",
                    connection_info['data']['device_path'],
                    new_size, instance=instance)
          return new_size

  
  In cases where device_path is not available, the above code fails due to LOG.debug():

  2021-07-15 16:03:41.137 1546583 WARNING nova.compute.manager [req-9fee5153-b004-4606-800a-bb82cb87eeb9 2fbdb548b5444008b47cf373ae16aeeb 0d40f63055ab45c6975233bdbe8737ac - default default] [instance: 96e18906-3d4f-4f77-890c-53d8ea59e26b] Extend volume failed, volume_id=bd6cf322-da11-4f23-bb77-d92e83cda0fe, reason: 'device_path'
  2021-07-15 16:03:41.170 1546583 ERROR oslo_messaging.rpc.server [req-9fee5153-b004-4606-800a-bb82cb87eeb9 2fbdb548b5444008b47cf373ae16aeeb 0d40f63055ab45c6975233bdbe8737ac - default default] Exception during message handling: KeyError: 'device_path'
  ...
  2021-07-15 16:03:41.170 1546583 ERROR oslo_messaging.rpc.server   File "/usr/lib/python3.6/site-packages/nova/virt/libvirt/volume/iscsi.py", line 88, in extend_volume
  2021-07-15 16:03:41.170 1546583 ERROR oslo_messaging.rpc.server     connection_info['data']['device_path'],
  2021-07-15 16:03:41.170 1546583 ERROR oslo_messaging.rpc.server KeyError: 'device_path'

  If this code is commented out, the use case works correctly. Also,
  there is other code in Nova and os-brick that acknowledges that
  device_path may not be set, such as in nova/virt/libvirt/driver.py :

                  # NOTE(lyarwood): Find the path to provide to qemu-img
                  if 'device_path' in connection_info['data']:
                      path = connection_info['data']['device_path']

  It seems like this is a left over code path that does not handle the
  case that device_path must be derived at runtime, and is not captured
  in conneciton_info['data'].

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



References