Volume discovery and local storage management lib
Go to file
Gorka Eguileor 8933503041 Fix FC scan too broad
After some changes to the FC connector we have introduced a regression
on the way we do the scans, and we end up scanning using wildcards even
though we shouldn't.

The targets in the "initiator_target_map" don't mean that they are all
connected, so we must take that into account.

With the current code, if we have the following connections:

HBA host7 ---- SWITCH ---- port W (channel 0, target 2)
          \--- SWITCH ---- port X (channel 0, target 3)

HBA host8 ---- SWITCH ---- port Y (channel 0, target 2)
          \--- SWITCH ---- port Z (channel 0, target 3)

We will end up with the following scans 8 scans for LUN L:

  - - L > host7
  - - L > host7
  0 2 L > host7
  0 3 L > host7

  0 2 L > host8
  0 3 L > host8
  - - L > host8
  - - L > host8

Which correspond to the responses from _get_hba_channel_scsi_target like
this:

               port Y          port Z          port W          port X
  host7 ... ['-','-',L]     ['-','-',L]     ['0','2',L]     ['0','3',L]
  host8 ... ['0','2',L]     ['0','3',L]     ['-','-',L]     ['-','-',L]

And we should only be doing 4 scans:

  0 2 L > host7
  0 3 L > host7
  0 2 L > host8
  0 3 L > host8

Most storage arrays get their target ports automatically detected by the
Linux FC initiator and sysfs gets populated with that information, but
there are some that don't.

We'll do a narrow scan using the channel, target, and LUN for the former
and a wider scan for the latter.

If all paths to a former type of array were down on the system boot the
array could look like it's of the latter type and make us bring us
unwanted volumes into the system by doing a broad scan.

To prevent this from happening Cinder drivers can use the
"enable_wildcard_scan" key in the connection information to let us know
they don't want us to do broad scans even if no target ports are found
(because they know the cause is there's no connection).

Close-Bug: #1849504
Related-Bug: #1765000
Related-Bug: #1828440
Change-Id: I5dbefaff43fb902b15117b443fc92f7b6a6ad8c9
(cherry picked from commit 708733e495)
(cherry picked from commit c76b6dc514)
2019-11-19 03:27:32 +01:00
doc/source doc: Restructure docs for doc-migration 2017-08-08 15:44:29 +01:00
etc/os-brick/rootwrap.d Trivial rootwrap -> privsep replacement 2016-04-15 15:29:25 +00:00
os_brick Fix FC scan too broad 2019-11-19 03:27:32 +01:00
releasenotes Fix FC scan too broad 2019-11-19 03:27:32 +01:00
tools Avoid tox_install.sh for constraints support 2017-12-02 16:51:51 +00:00
.coveragerc Fix coverage generation 2016-04-20 15:52:31 +00:00
.gitignore Add LIO barbican tests to .zuul.yaml 2018-10-01 10:19:36 -05:00
.gitreview OpenDev Migration Patch 2019-04-19 19:34:26 +00:00
.mailmap Created the Brick library from Cinder 2015-01-22 19:09:30 +00:00
.stestr.conf Add .stestr.conf configuration 2017-10-02 17:35:26 -05:00
.zuul.yaml Drop py35 jobs 2019-02-26 14:24:46 -06:00
CONTRIBUTING.rst Update and replace http with https for doc links 2017-07-26 02:18:44 +00:00
HACKING.rst Update hacking version 2019-01-18 21:30:00 -05:00
LICENSE Created the Brick library from Cinder 2015-01-22 19:09:30 +00:00
README.rst Add release note link in README 2018-06-27 23:02:38 +08:00
babel.cfg Created the Brick library from Cinder 2015-01-22 19:09:30 +00:00
bindep.txt Fix bindep for multipath 2018-04-02 14:40:35 -04:00
lower-constraints.txt Remove testrepository 2018-07-11 17:51:51 +07:00
pylintrc Add pylint tox env 2016-04-04 18:02:19 -04:00
requirements.txt uncap eventlet 2018-04-11 11:52:27 -04:00
setup.cfg Remove py35 from setup.cfg 2019-02-28 11:02:40 +05:30
setup.py Updated from global requirements 2017-03-10 19:12:09 +00:00
test-requirements.txt Update hacking version 2019-01-18 21:30:00 -05:00
tox.ini Update UPPER_CONSTRAINTS_FILE for stable/stein 2019-03-18 14:41:39 +00: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:

https://docs.openstack.org/os-brick/latest/

OR refer to the parent project, Cinder:

https://docs.openstack.org/cinder/latest/

Release notes for the project can be found at:

https://docs.openstack.org/releasenotes/os-brick