Volume discovery and local storage management lib
Go to file
Gorka Eguileor 400ca5d6db Refactor iSCSI disconnect
This patch refactors iSCSI disconnect code changing the approach to one
that just uses `iscsiadm -m session` and sysfs to get all the required
information: devices from the connection, multipath system device name,
multipath name, the WWN for the block devices...

By doing so, not only do we fix a good number of bugs, but we also
improve the reliability and speed of the mechanism.

A good example of improvements and benefits achieved by this patch are:

- Common code for multipath and single path disconnects.

- No more querying iSCSI devices for their WWN (page 0x83) removing
  delays and issue on flaky connections.

- All devices are properly cleaned even if they are not part of the
  multipath.

- We wait for device removal and do it in parallel if there are
  multiple.

- Removed usage of `multipath -l` to find devices which is really slow
  with flaky connections and didn't work when called with a device from
  a path that is down.

- Prevent losing data when detaching, currently if the multipath flush
  fails for any other reason than "in use" we silently continue with the
  removal.  That is the case when all paths are momentarily down.

- Adds a new mechanism for the caller of the disconnect to specify that
  it's acceptable to lose data and that it's more important to leave a
  clean system.  That is the case if we are creating a volume from an
  image, since the volume will just be set to error, but we don't want
  leftovers.  Optionally we can tell os-brick to ignore errors and don't
  raise an exception if the flush fails.

- Add a warning when we could be leaving leftovers behind due to
  disconnect issues.

- Action retries (like multipath flush) will now only log the final
  exception instead of logging all the exceptions.

- Flushes of individual paths now use exponential backoff retries
  instead of random retries between 0.2 and 2 seconds (from oslo
  library).

- We no longer use symlinks from `/dev/disk/by-path`, `/dev/disk/by-id`,
  or `/dev/mapper` to find devices or multipaths, as they could be
  leftovers from previous runs.

- With high failure rates (above 30%) some CLI calls will enter into a
  weird state where they wait forever, so we add a timeout mechanism in
  our `execute` method and add it to those specific calls.

Closes-Bug: #1502534
Change-Id: I058ff0a0e5ad517507dc3cda39087c913558561d
2017-05-31 15:31:20 +02:00
doc/source Retire ISERConnector from documentation 2016-04-27 05:48:08 -04:00
etc/os-brick/rootwrap.d Trivial rootwrap -> privsep replacement 2016-04-15 15:29:25 +00:00
os_brick Refactor iSCSI disconnect 2017-05-31 15:31:20 +02:00
releasenotes Refactor iSCSI disconnect 2017-05-31 15:31:20 +02:00
tools Stop ignoring H405 hacking rule in tox 2017-05-24 00:44:57 +02:00
.coveragerc Fix coverage generation 2016-04-20 15:52:31 +00:00
.gitignore Add ignore for . directories 2016-07-22 17:02:41 +00:00
.gitreview Correct project name in .gitreview 2015-03-18 13:00:51 +01:00
.mailmap Created the Brick library from Cinder 2015-01-22 19:09:30 +00:00
.testr.conf Created the Brick library from Cinder 2015-01-22 19:09:30 +00:00
CONTRIBUTING.rst Update the documentation for os-brick 2015-02-19 14:37:13 -08:00
HACKING.rst Created the Brick library from Cinder 2015-01-22 19:09:30 +00:00
LICENSE Created the Brick library from Cinder 2015-01-22 19:09:30 +00:00
README.rst Show team and repo badges on README 2016-11-25 13:40:47 +01:00
babel.cfg Created the Brick library from Cinder 2015-01-22 19:09:30 +00:00
bindep.txt Add curl to bindep 2016-12-22 10:53:42 -05:00
pylintrc Add pylint tox env 2016-04-04 18:02:19 -04:00
requirements.txt Updated from global requirements 2017-05-26 17:26:52 +00:00
setup.cfg Add Python 3.5 classifier and venv 2017-01-23 08:21:39 +07:00
setup.py Updated from global requirements 2017-03-10 19:12:09 +00:00
test-requirements.txt Update hacking version to align with Cinder 2017-05-24 00:08:24 +02:00
tox.ini Removed invalid comments in tox.ini [flake8] 2017-05-24 00:44:57 +02:00

README.rst

Team and repository tags

image

brick

Latest Version

Downloads

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:

http://docs.openstack.org/developer/os-brick/index.html

OR refer to the parent project, Cinder:

http://docs.openstack.org/developer/cinder/