While disconnecting the volume, we flush the multipath device, execute ``multipath del path`` and remove the individual devices before finishing the operation. There is an issue with the said order as removing individual devices already triggers the uevent for multipathd to remove the paths but it doesn't happen immediately. With change[1], we tried to mitigate the issue by executing ``multipath del path`` manually but this also generates another uevent for multipathd and doesn't guarantee that the devices are removed synchronously from multipathd monitoring. Overall, we are just increasing the number of uevents and not guaranteeing that the paths are removed before we return the call to caller (nova or cinder or glance). This patch addresses the issue by waiting for the paths to be removed from multipathd monitoring by introducing a call to ``multipathd show paths raw format "%d" `` with an exponential backoff. This ensures that the paths are not monitored anymore before os-brick claims the removal of devices and returns the call. As a last mechanism, if the devices are still monitored by multipathd, we execute the ``multipath del path`` command manually to make sure we tried our best to remove the devices from multipathd monitoring. [1] https://review.opendev.org/c/openstack/os-brick/+/785818 Closes-Bug: #2136842 Change-Id: Ie08f9bcbaf31390c33f74d95dde2798e9287a582 Signed-off-by: Rajat Dhasmana <rajatdhasmana@gmail.com>
Team and repository tags
brick
OpenStack Cinder brick library for managing local volume attaches
Features
- Discovery of volumes being attached to a host for many transport protocols.
- Removal of volumes from a host.
Hacking
Hacking on brick requires Python 3.8+. A recent tox is required, as is a recent virtualenv (20.2.2 or newer).
- For any other information, refer to the developer documents:
- OR refer to the parent project, Cinder:
- Release notes for the project can be found at:
- License: Apache License, Version 2.0
- Source: https://opendev.org/openstack/os-brick
- Bugs: https://bugs.launchpad.net/os-brick
Description
Languages
Python
99.6%
Shell
0.4%