Fix NetAppDirectCmodeNfsDriver._find_shares()

If more than one NFS share is defined, all volumes are allocated on the
same NFS share until it is not eligible anymore. Then a second NFS share
is filled. The code is supposed to split volumes between the different
NFS shares, not fill them one by one.

It is a bug in _find_shares(). If at least one NFS share is eligible,
the "size" parameter (size of the requested volume in gigabytes) is
replaced with the total size in bytes of the share. Because of that,
_find_shares() cannot find more one eligible NFS share.

_find_shares() sorts eligible volumes by available size. Because of this
bug, all volumes are allocated in the same NFS share, instead of being
splitted on different NFS shares.

The _find_shares() has been removed in Juno, see:

* commit 98aa91b0e271d6fbd9dfe43bf4152fb138a46a89
* change Ie6f155df7bc1ae2cd5f7fa39f1b1a0ad38075988

Change-Id: I7b72921a2a45d5dd0aa969c8c32f7d815175f3a8
Co-author: "Florent Flament" <florent.flament-ext@cloudwatt.com>
Closes-Bug: #1369426
Sync process utils from oslo

This patch backports the missing change to fix ssh_execute password leak

------------------------------------------------
The sync pulls in the following changes:

105169f8 - Mask passwords in exceptions and error messages (SSH)
-----------------------------------------------

Closes-Bug: 1377981
Change-Id: Ie0caf32469126dd9feb44867adf27acb6e383958
Fix possible race condition for accept transfer

Accept transfer API workflow is currently like this:

  call volume_api.accept_transfer()
    |
    --- RPC cast to volume manager
          |
          --- volume manager calls volume driver accept_transfer()

  update volume's DB record

Given the non-blocking nature of RPC cast, what happens in volume
manager and volume driver can happen in parallel with the DB update.
If volume driver relies on original DB record to do things, then
DB record shouldn't be updated until volume driver finishes its job.

So this patch change volume RPC API accept_transfer() from cast
to call to make sure the workflow is in serialized manner.  Also
elevated the context when volume manager tries to update the DB
record when driver has done accept_transfer().

Closes-bug: #1357432

Conflicts:
    cinder/volume/rpcapi.py

Change-Id: Ieae52e167aa02967338e0be5d78d570d682faa7a
(cherry picked from commit 7e95b05b937e632ae8aee82cfa8f6f31835e6316)
NetApp fix eseries concurrent vol map failure

This fixes the issue while mapping volume to host
when the requests are very close in time proximity.
The map operation has been synchronized.

Change-Id: I2e120d84d3b96faa4ab8d4324e70a089bcddeaa5
Closes-bug: #1312685
(cherry picked from commit 209c09a76f5e90aaa2899804686e6a513703d887)
NetApp fix for default host type in eseries

This fixes the issue where the default host type
provided in mapping should be high performing LnxALUA
type for eseries. It also makes it configurable in case
users want to configure a different host type.

Closes-Bug: #1365884

Change-Id: I30992ca69c25c3c02334470aae90c32731a5f3f4
(cherry picked from commit a120ede9ae3f18756db07d1d6696b9ac773b84bf)
Merge "Fix possible race condition for accept transfer" into stable/icehouse
Sync latest strutils from oslo-incubator for mask_password fix

This sync pulls in:
   1131b56 Enable mask_password to handle byte code strings

This is the only update since the last sync:
   beca4db Sync latest strutils from oslo-incubator

This is needed to fix a delete volume failure when processutils
calls mask_password with a byte code string.

Change-Id: Ie8a8c8e26abc0e387830bc9246e9a44913ae9b24
Closes-bug: #1368527
(cherry picked from commit cb5bcca025f9a34ecb9bc72b8fe570e6a63e442d)
Merge "Fix NetAppDirectCmodeNfsDriver._find_shares()" into stable/icehouse
Updated from global requirements

Change-Id: Iafef7591fff4aa1537a5b1ad8051a78c707bd56f
Merge "Sync latest strutils from oslo-incubator for mask_password fix" into stable/icehouse
Cinder api service doesn't handle SIGHUP properly

When SIGHUP signal is sent to cinder-api service, it doesn't complete
processing of all pending requests before terminating all the
processes.

This change is a copy of Abhishek Kekane's fix for nova api.

Change-Id: I049d2aa2f3ad1fe388e00213a71f374803ed409a
Closes-Bug: #1334647
(cherry picked from commit 6c3ad4cf55c5f4cb610fb2625aed1286857b6c67)
Merge "Updated from global requirements" into stable/icehouse
Merge "Cinder api service doesn't handle SIGHUP properly" into stable/icehouse
fixing the iSER transport protocol when using LVMISERDriver

ISER capabilities were broken in icehouse when trying to remove
duplication between ISCSIDriver and ISERDriver.

This fix does minimal changes in the code in order to fix
the capability.

The fix is basically re-adding the ISERTgtAdm and re-adding
the support in LVMISERDriver: change target_lun based on
iseradm.

Conflicts:
        cinder/volume/driver.py

Changes from the original fix in Juno:

Bug https://bugs.launchpad.net/cinder/+bug/1325799
caused the volumes to be created with iSCSI's prefix
parameter in any case. In order to solve the prefix mismatch,
iSER's prefix is updated to match iSCSI’s prefix.
The related changes:
  1. cinder/brick/iscsi/iscsi.py line 614
  2. Cinder/volume/driver.py line 118
  3. etc/cinder/cinder.conf.sample line 921

Closes-Bug: #1336648
Change-Id: Ic3c9da9577d09d9199218ea82bda56599527223c
(cherry picked from commit f66f9e5805070e5ad2ba4688c6c4571ef1ec395a)
NetApp fix for controller preferred path

This patch optimizes the data path by choosing
the preferred path to access the volume by selecting
the controller owning the volume.

Closes-Bug: #1365881

Change-Id: I7069111dfd22d4fca92615b5730854f6d696ec13
(cherry picked from commit e6ea26ea1272f9407879b822b3913b4308e3f2f8)
Merge "NetApp fix for default host type in eseries" into stable/icehouse
Merge "NetApp fix for controller preferred path" into stable/icehouse
NetApp fix attach fail for already mapped volume

This patch fixes the error raised during mapping of a volume
to the host during attach operation if the volume is already
mapped to the host.

Change-Id: I4f711e7ac18eea0dfddab65fd85a3601fe967a88
Closes-bug: #1310659
(cherry picked from commit dcec1b84f4d3462fc408f4152f4c89b8df79d629)
Merge "fixing the iSER transport protocol when using LVMISERDriver" into stable/icehouse
Merge "NetApp fix attach fail for already mapped volume" into stable/icehouse