749 Commits

Author SHA1 Message Date
Jenkins
3ebd0a2ae2 Merge "Updated from global requirements" 2015-06-11 22:56:10 +00:00
Tomoki Sekiyama
06b5167f4f optimize multipath call to identify IQN
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
2015-06-11 18:37:48 -04:00
OpenStack Proposal Bot
939f663f39 Updated from global requirements
Change-Id: I9bb67ac5071fc3022cf4c56f37c7dae22621c77a
2015-06-09 20:04:05 +00:00
Earle F. Philhower, III
ab162d166b Trivial exception parameter name fix for Huawei
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
2015-06-04 15:13:42 -07:00
Tomoki Sekiyama
a8386d5cbe Fix connecting unnecessary iSCSI sessions issue
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
2015-06-04 03:48:12 +00:00
Tomoki Sekiyama
531398504f Fix disconnecting necessary iSCSI sessions issue
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
2015-06-04 03:47:57 +00:00
John Griffith
fe925a27c5 Add retry to iSCSI delete
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
2015-06-04 03:25:26 +00:00
OpenStack Proposal Bot
3bc6fd2bbf Updated from global requirements
Change-Id: I2aa4a5e1a0ee7178ffc74e50d725941416562012
2015-06-03 17:38:07 +00:00
Jenkins
013c742564 Merge "Add missing connectors to factory test" 2015-06-02 17:59:22 +00:00
Jon Bernard
822613c473 Add missing connectors to factory test
Change-Id: Ic57a616b839305fabf4b8cf45c393d79d19b557b
2015-06-02 17:37:58 +00:00
Jon Bernard
fa6a250994 Fix local connector test case inheritance
Change-Id: I3f3fc36d9393b422ee9cd7f2fe8e1081b8a2030b
2015-05-29 13:12:59 -04:00
Jenkins
13b842ca4a Merge "Assign the platform after declaration" 2015-05-28 00:23:52 +00:00
Walter A. Boring IV
3433f5d583 Allow overriding the host field
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
2015-05-21 17:17:59 +00:00
Walter A. Boring IV
49c2bdf641 Assign the platform after declaration
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
2015-05-20 16:31:11 +00:00
Walter A. Boring IV
20b9a0e9e5 Added a unit test for masking iscsiadm passwords
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
2015-05-20 16:30:39 +00:00
Mike Perez
28f3d0950f Preparing for the 0.1.1 release
This is to resolve some conflict issues we're seeing in
global-requirements.

Change-Id: Ib523337c13c49e7fd63bab8ab8738a5b60c1cee2
2015-05-19 12:19:10 -07:00
Jenkins
ff27d3f6c3 Merge "ISCSI be careful parsing iscsiadm output" 2015-05-13 16:56:18 +00:00
Walter A. Boring IV
8e6e07e15e ISCSI be careful parsing iscsiadm output
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
2015-05-13 15:58:52 +00:00
OpenStack Proposal Bot
418a9655dd Updated from global requirements
Change-Id: Ica4c04b378d482945c3cde219cf9a5ade0151b9d
2015-05-13 15:58:23 +00:00
Doug Hellmann
9247aa4f42 Drop use of 'oslo' namespace package
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
2015-04-28 22:25:57 +00:00
Walter A. Boring IV
0b89d9b3e7 Update README to work with release tools
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
2015-04-21 08:28:50 -07:00
Walter A. Boring IV
f4ecdf0f60 Brick: Fix race in removing iSCSI device
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
2015-04-20 08:02:38 -07:00
Walter A. Boring IV
7d341f1543 Update os-brick requirements
This patch updates the requirements.txt and
test-requirements.txt to match that of Cinder
and Nova.

Change-Id: Ia666cf5cd94c72cbd469e5c3d7509f0c37894d4e
2015-04-17 17:11:34 +00:00
Walter A. Boring IV
7ee5a43a75 Mask passwords with iscsiadm commands
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
2015-04-16 10:42:47 -07:00
Jenkins
a1a4c7e644 Merge "Sync latest _i18n module for os_brick" 2015-04-16 15:44:36 +00:00
Jay S. Bryant
e7e615a06f Sync latest _i18n module for os_brick
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
2015-04-15 15:50:46 -05:00
Tomoki Sekiyama
84312f8f0b Use oslo_log instead of openstack.common.log
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
2015-04-15 14:09:55 -05:00
Jay S. Bryant
63ae359d03 Sync loopingcall from oslo-incubator for os-brick
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
2015-04-14 22:37:17 -05:00
Jenkins
9f30633097 Merge "Use six.text_type instead of unicode" 2015-04-13 16:21:18 +00:00
Hahyun
aa42ff9b70 Fix wrong command for _rescan_multipath
The _run_multipath command is wrong, it should be 'multipath -r'
not 'multipath - r'.

Change-Id: I2b642de057c11be71b4724c0c22f8bdc3ca86191
Closes-bug: 1438956
2015-04-09 16:45:48 +00:00
Lee Yarwood
7643a16588 Fix multipath device discovery when UFN is enabled.
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
2015-04-07 17:48:14 +01:00
Ivan Kolodyazhny
d86368c0be Use six.text_type instead of unicode
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
2015-04-03 10:22:45 +03:00
ankitagrawal
fa22662d2d Fix missing translations for log messages
Fixed log translations for error, info and warning messages with
appropriate marker function according to the standards [1].

As LOG.warn has deprecated [2] so I have changed LOG.warn to
LOG.warning.

[1] http://docs.openstack.org/developer/oslo.i18n/guidelines.html
[2] http://bugs.python.org/issue13235

Change-Id: I876c6f3636d511664a25508649e08ad95c40007a
Closes-Bug: 1431256
2015-04-01 22:11:49 +00:00
Jenkins
29739cd234 Merge "Remove error messages from multipath command output before parsing" 2015-03-31 22:22:41 +00:00
Jenkins
661c540dca Merge "Remove mocks after each unit test finished" 2015-03-31 22:21:01 +00:00
Tomoki Sekiyama
99d67bd77c Remove error messages from multipath command output before parsing
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
2015-03-19 21:47:22 +00:00
Tomoki Sekiyama
9a1913db07 Remove mocks after each unit test finished
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
2015-03-19 16:41:37 -04:00
Michal Dulko
f305f2a4a6 Correct project name in .gitreview
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
2015-03-18 13:00:51 +01:00
Stefan Amann
354ece84c5 Adjust os-brick to support FCP on System z systems
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
2015-03-10 13:48:48 +00:00
Jenkins
1ac33204d7 Merge "Use target_portals/iqns/luns for alternative target information" 2015-02-27 22:22:42 +00:00
Tomoki Sekiyama
2ee70a0f89 Use target_portals/iqns/luns for alternative target information
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
2015-02-26 19:29:33 -05:00
Walter A. Boring IV
58f4325559 Fix comments style according to Hacking rules
According to the PEP8(E265) there should be at least
one space before block comment.

Change-Id: I1c714c03c162446b00f1df279df6962ddd95c507
Partial-Bug: #1407162
2015-02-24 16:02:10 -08:00
Jenkins
312386616c Merge "Failover to alternative iSCSI portals on login failure" 2015-02-23 16:44:46 +00:00
Walter A. Boring IV
b3a392e5a2 Update the documentation for os-brick
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
2015-02-19 14:37:13 -08:00
Tomoki Sekiyama
04f14a3daa Failover to alternative iSCSI portals on login failure
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
2015-02-18 18:10:21 -05:00
Walter A. Boring IV
2dc39e83d0 Remove some unused exceptions from Cinder
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
2015-02-17 16:59:07 -08:00
Walter A. Boring IV
4f4ced7d8f Brick os-brick up to par with cinder brick
This brick's brick up to the same codebase as
cinder brick's patch
number: ca97a7461f0f56835a0f2dceb9afaebac756f7c3
"Enhance iSCSI multipath support"
2015-02-06 19:50:34 +00:00
Walter A. Boring IV
88afc6c17e renamed the project to os-brick
As per discussion in IRC, we have renamed brick to
os-brick, which creates the pacakge os_brick.  There was
a conflict in pypi for the 'brick' name.
2015-02-05 23:58:37 +00:00
Walter A. Boring IV
81b1dbebdf Created the Brick library from Cinder
This is the external Brick library that came from
Cinder's codebase.  It's intended to be used as a
standalone library and subproject of Cinder.
2015-01-22 19:09:30 +00:00