71a1e22418b35ced5b8af1e5a1f0c5f234f40f41
We introduced "shared_targets" and "service_uuid" fields in volumes to allow volume consumers to protect themselves from unintended leftover devices when handling iSCSI connections with shared targets. The way they protect themselves from the automatic scans that happen on detach/map race conditions is by locking and only allowing one attach or one detach operation for each server to happen at a given time. When using an up to date Open iSCSI initiator we don't need to use locks, as it has the possibility to disable automatic LUN scans (which are the real cause of the leftover devices), and OS-Brick already supports this feature. This is currently not the case, since Nova is blindly locking whenever "shared_targets" is set to True. Thanks to the context manager introduced in this patch we can improve our separation of concerns (Nova doesn't have to care when we have to lock), and we can fine tune the locking to only lock when the iSCSI initiator doesn't support disabling automatic scans. The context manager "guard_connection" lives in "os_brick.initiator.utils" and needs a cinder volume. The volume can be passed as a dictionary or OVO instance. Change-Id: I4970363301d5d1f4e7d0f07e09b34d15ee6884c3 Related-Bug: #1800515
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-gdbm (for Debian derived distributions), Python 2.7 and Python 3.4. A recent tox is required, as is a recent virtualenv (13.1.0 or newer).
If "tox -e py34" fails with the error "db type could not be determined", remove the .testrepository/ directory and then run "tox -e py34".
- 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://git.openstack.org/cgit/openstack/os-brick
- Bugs: https://bugs.launchpad.net/os-brick
Languages
Python
99.6%
Shell
0.4%