yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #86626
[Bug 1936439] [NEW] extend_volume for libvirt / iscsi volumes fails due to faulty debug code
Public bug reported:
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'].
** 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/1936439
Title:
extend_volume for libvirt / iscsi volumes fails due to faulty debug
code
Status in OpenStack Compute (nova):
New
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
Follow ups