When detaching a multipath volume in an environment where there
are many attached volumes, excessive multipath calls are
generated and it takes too much time. This issue is due to the
fact that a multipath -ll call against many multipath devices
takes a few seconds.
When detaching a volume, _disconnect_volume_multipath_iscsi()
calls 'multipath -ll <each iscsi device>' against every iscsi
devices. This behavior is to identify the IQNs used by multipath
device, however the IQNs are extracted from one 'multipath -ll'
call without massive 'multipath -ll <each iscsi device>' calls.
This patch changes the behavior of identifying IQNs used by
multipath device:
1. add an utility to identify IQNs by using multipath device map
(/dev/sdX => /dev/mapper/XXX) generated by 'multipath -ll'.
2. replace the current nested for loop to identify the IQNs with
the utility.
(Ported from I77e6eda950726d7ee9a0d92882d4501e70a0d8f8)
Change-Id: I1e5e9eba58a349509e80654ab3058c4ff5d00c0d
Co-Authored-By: Keiichi KII <k-keiichi@bx.jp.nec.com>
Closes-Bug: #1456480
Trivially fix the Exception parameter name from "msg=x" to the
proper "message=" to ensure generated errors are reported properly.
Change-Id: Ifdbe0c7cc7824763f5ed3a1ccef374a8bd0dce4b
Closes-Bug: 1462091
With "iscsi_use_multipath=true", attaching a multipath
iSCSI volume may create unnecessary iSCSI sessions.
The iscsiadm discovery command in connect_volume() returns all of
the targets in the Cinder node, not just the ones related to
the multipath volume which is specified by iqn. If the storage
has many targets, connecting to all these volumes will also
result in many unnecessary connections.
There are two types of iSCSI multipath devices.
One which shares the same iqn between multiple portals,
and the other which use different iqns on different portals.
connect_volume() needs to identify the type by checking iscsiadm
the output if the iqn is used by multiple portals.
This patch changes the behavior of attaching volume:
1. Identify the type by checking the iscsiadm output.
2. Connect to the correct targets by connect_to_iscsi_portal().
(Ported from I488ad0c09bf26a609e27d67b9ef60b65bb45e0ad)
Co-Authored-By: Hiroyuki Eguchi <h-eguchi@az.jp.nec.com>
Related-Bug: #1382440
Change-Id: I4c9b173cfab387a55772709242eed69c10168c0f
With "iscsi_use_multipath=true", detaching a multipath iSCSI
volume kills all iSCSI volumes visible from the attached node.
When we use different targets(IQNs) associated with same portal
for each different multipath device, all of the targets will
be deleted via disconnect_volume().
This patch fixes the behavior of detaching volume:
1. Extract the targets for the detached multipath device.
2. Delete/disconnect the targets for the detached multipath
device.
(Ported from I38eafdaee03d136282cfde1fd013e322a4256cc4)
Co-Authored-By: Hiroyuki Eguchi <h-eguchi@az.jp.nec.com>
Closes-Bug: #1382440
Change-Id: I5fdbb5765642bac7263ff616ae4b006d9504547a
Looks like there might be a race in trying to delete
a target immediately after a logout. I've seen this
a couple times in my CI system this week, but it
certainly doesn't seem at all prevalent.
This patch just adds a simple retry with delay that should
take care of any race issues here.
Also addressed some pep8 violations while touching the file.
Change-Id: I7a57687cac311c5e53361ccbceb1addb419f1e9f
Closes-Bug: 1324670
This patch adds the ability to override the host
that is populated into the connector when collecting
information about the initiator. Nova sometimes overrides
the host depending on it's CONF.host value, so we need to
support that instead of always using the socket.gethostname()
Change-Id: I63ec4f291d9990e8911b696a4030d3ffe377bd6e
This simple patch changes when the arch value is
assigned in the connector factory until after the
function defintion. kwarg values assigned in
function declarations are assigned at file import
time and not at call time.
Change-Id: I08b6560a5f4dfd221c4211ab35a784c4605150dc
This patch adds a unit test to make sure that
the ISCSIConnector is masking passwords in the
LOG output for _run_iscsiadm
Change-Id: Ia859a4c4661995af21ede8ea75cd772eba35978d
Sometimes iscsiadm can output debugging text.
This patch does the same thing that the old
nova libvirt volume code does in being safe
with reading the command line output. We want
to ensure that we are reading the iqns and ips.
Change-Id: I092a56e52bcea6adb6cb018cd059e6126a1dc07d
Closes-Bug: #1453992
The Oslo libraries have moved all of their code out of the 'oslo'
namespace package into per-library packages. The namespace package was
retained during kilo for backwards compatibility, but will be removed by
the liberty-2 milestone. This change removes the use of the namespace
package, replacing it with the new package names.
The patches in the libraries will be put on hold until application
patches have landed, or L2, whichever comes first. At that point, new
versions of the libraries without namespace packages will be released as
a major version update.
Please merge this patch, or an equivalent, before L2 to avoid problems
with those library releases.
Blueprint: remove-namespace-packages
https://blueprints.launchpad.net/oslo-incubator/+spec/remove-namespace-packages
Change-Id: I9891564317aa3cf84874debdc966e48fb270455e
The README file needs to have links to the project documentation
and bug tracker in a parseable format in order for some of the
release tools scripts to work (particularly the on that prints the release
note email).
Change-Id: I9200a1cc2147b12a617762d0dabaa72464a9d70f
Some folks are seeing race conditions on overloaded
or slow machines, where the time between issuing the
remove volume command, and the volume being from
/dev/disk/by-path by the kernel isn't long enough.
This patch adds the Cinder retry decorator mechanism.
This patch uses the new retry decorator to try 3 times
to wait for the volume to disappear from the system,
before moving on.
Change-Id: I24cc18d188b8eeb3b7a1392b2bd8b520dc2a0e03
Closes-Bug: 1437441
This patch updates the requirements.txt and
test-requirements.txt to match that of Cinder
and Nova.
Change-Id: Ia666cf5cd94c72cbd469e5c3d7509f0c37894d4e
This patch adds the fix that exists in the nova
libvirt volume code to use oslo_utils strutils
to mask passwords that might show up in debug log
messages.
Change-Id: I632eb4d71588736ab21327824d0506c13f3933ae
Closes-Bug: 1445137
The _i18n module in os_brick is out of date.
It is still using the old oslo.i18n namespace
for the i18n library instead of oslo_i18n.
This patch syncs in the latest incubator code to
correct that.
Current HEAD in OSLO:
---------------------
commit: 9117130d7e73a18f0720ecb264a0a85aa26d3816
Date: Fri Apr 10 11:39:29 2015 +0200
Test loopingcall and threadgroup on Python 3
Changes merged with this patch:
--------------------------------
0cc741a9 - switch to oslo_i18n
Change-Id: I76d1b2449c75fbd7a4a38bffdbdf492c98f639b1
oslo_log should be used instead of oslo-incubator.
This fixes an error "oslo_config.cfg.DuplicateOptError:
duplicate option: default_log_levels" when os-brick is imported
to projects using oslo_config and oslo_log.
Change-Id: Ic38c548bd39bc8ce68bd70d2b0693f6d0c0c5399
Closes-Bug: #1443681
In order for os-brick to be able to be updated to
use the oslo.log library this updated needs to be made
to update loopingcall to no longer use the old incubator
version of oslo log.
Current HEAD in OSLO:
---------------------
commit: 9117130d7e73a18f0720ecb264a0a85aa26d3816
Date: Fri Apr 10 11:39:29 2015 +0200
Test loopingcall and threadgroup on Python 3
Changes merged with this patch:
--------------------------------
2fbf5065 - Remove oslo.log code and clean up versionutils API
Change-Id: I2a26dd6464f9bcb95898b29a1a2e45aee250899f
The _run_multipath command is wrong, it should be 'multipath -r'
not 'multipath - r'.
Change-Id: I2b642de057c11be71b4724c0c22f8bdc3ca86191
Closes-bug: 1438956
This currently returns an invalid path of `/dev/mapper/${WWID}`
when UFN is enabled leading to failures later on when we attempt to
use the device.
The output of `multipath -l ${path}` or `multipath -l ${wwid}`
should always list the correct device identifier to use with this
path as the first word on the first line.
The same change has been suggested for both Cinder [1] and Nova [2]
as they are also susceptible to this issue.
[1] https://review.openstack.org/#/c/170157/
[2] https://review.openstack.org/#/c/169873/
Change-Id: I4a2d0e6ba4522ebfa0c50be49f7039f6e4617ae8
Closes-Bug: 1401799
unicode type renamed in Python 3.x. We need to use
six.text_type to get code works with both Python 2.7 and 3.x
Related-Bug: #1380806
Change-Id: Ia26a29fab377b61ce4abf81f3eb778988eb8b893
This fixes an issue in _get_multipath_device_name() that fails to
parse the output from 'multipath -ll <device>' command when the
stdout contains error messages in addition to the expected output.
Change-Id: I59bf37a932acd97cf915d086b4072b71e8214936
Related-Bug: #1380742
Partial-Bug: #1433204
Currently, unit tests for initiator overrides the original functions
and never cleans up, that may confuse the following tests.
This change refines them to clean up mocks after each test.
Change-Id: I3d50da087be66876de8d8ebd8b6ceb0387d10446
Closes-Bug: #1433363
Project name variable in .gitreview is set to an old value
("openstack/brick.git") which causes it impossible to configure git
review by user. This commit fixes the problem changing the variable
to "openstack/os-brick.git".
Change-Id: Icff5ba943c1c4f52705fbfd1f4047eacbbac690f
Closes-Bug: 1433558
There are some platform specific changes needed to allow os-brick to
support FCP on System z: the System z specific format of the device
file paths, adding and removing devices explicitly, and ignoring vHBAs
which are offline.
Based on Cinder: https://review.openstack.org/#/c/149256/
Partial-Implements blueprint linux-systemz
Change-Id: Ie75454da974939e03dfc77e760ba5215324b7fdc
This makes brick to use target_portals, target_iqns, target_luns
to get alternative iSCSI targets list on fail-over.
Change-Id: I672497e819c3bffd71a0b7c6074c7a946eb74c91
Implements: blueprint iscsi-alternative-portal
According to the PEP8(E265) there should be at least
one space before block comment.
Change-Id: I1c714c03c162446b00f1df279df6962ddd95c507
Partial-Bug: #1407162
This patch intends to update the base documenation that is built
for the os-brick library. It includes the API documentation,
changelog, tutorial.
You can generate the documentation by running:
tox -edocs
DocImpact
Change-Id: Ia0fe0118207bbdc3cf698dfe09c0b71ebddd57f3
Some Cinder iSCSI backend drivers may return alternative
portals/tragets/luns information in the response from
initialize_connection API, for the case the main portal
is unreachable by network failure. This patch enables
brick to fail-over to alternative portals when it fails
to establish a session to the main portal.
Change-Id: Ic08d018d3b5f282ece823971576043f76bad1b2d
Implements: blueprint iscsi-alternative-portal
This patch removes some unused exceptions that came along
with the export from Cinder. Since os-brick doesn't include
target side code, we remove the target associated exceptions.
Change-Id: I0096e76f958e04829b98d5c4c47f49c82b58d8aa