Id507109df80391699074773f4787f74507c4b882 introduced the showmapped
command when attempting to disconnect locally attached rbd volumes.
Unfortunately at the time the test changes incorrectly attempted to
assert the commands made by using has_calls instead of the valid
assert_has_calls method.
This change now corrects this, ensures _get_rbd_args is called to
populate all of the required arguments for the showmapped command and
finally corrects the name stored within the fake showmapped output in
the test.
Change-Id: I7e761828b3799cef720e15ca7896e8e8d6f98182
(cherry picked from commit 71331b0e06)
flake8 new release 3.8.0 added new checks and gate pep8
job start failing. hacking 3.0.1 fix the pinning of flake8 to
avoid bringing in a new version with new checks.
Though it is fixed in latest hacking but 2.0 and 3.0 has cap for
flake8 as <4.0.0 which mean flake8 new version 3.9.0 can also
break the pep8 job if new check are added.
To avoid similar gate break in future, we need to bump the hacking min
version.
Also removing the hacking and other related dep from lower-constraints file
as theose are blacklisted requirements and does not need to be present
there.
- http://lists.openstack.org/pipermail/openstack-discuss/2020-May/014828.html
Change-Id: Icbbd8370dd24882b34e3616030ad4dedd1d565a0
(cherry picked from commit b63a85aa5b)
Update the URL to the upper-constraints file to point to the redirect
rule on releases.openstack.org so that anyone working on this branch
will switch to the correct upper-constraints list automatically when
the requirements repository branches.
Until the requirements repository has as stable/ussuri branch, tests will
continue to use the upper-constraints list on master.
Change-Id: I220563d4d84fec1fba501cd80887b03e43b4c020
The original method of unmapping the higher level RBD device found under
/dev/rbd/{pool}/{volume} fails when an encryptor has been attached to
the volume locally. This is due to a symlink being created that points
to the the decrypted dm-crypt device, breaking any attempt to unmap the
RBD volume.
To avoid this we can simply find and unmap the lower level RBD device of
/dev/rbd*.
Change-Id: Id507109df80391699074773f4787f74507c4b882
When using nvme connect NNMe device
does not show up immediately in kernel.
Change-Id: I5f34793e29bd91f3312aaf6f42866c2f2c0b2494
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
LUKS password quality checking is not useful
since we only use long hex strings for passwords.
Not skipping this means that we have to install
cracklib-dicts for cryptsetup to work, which is
unnecessary weight.
Closes-Bug: #1861120
Change-Id: Idc281be7cf88eeeeefe260877a1fc275d94f2bed
We stopped testing against py2 with commit df2a396, so remove
unsupported python versions from the requirements files.
Change-Id: I2aca65d734d7b6089f0e3ad7836f509f4b968098
We've kept hacking capped for a long time now. This raises the hacking
package version to the latest release and fixes the issues that it
found.
Change-Id: Ib13a3fe3f1a103b5e24a7c5bb7838ffdae2bf198
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
When creating multiple concurrent volumes, there's a lock
that prevents mount from returning quickly. Reading /proc/mounts
is way faster.
Change-Id: If31d120955eb216823a55005fdd3d24870aa6b9a
Closes-Bug: #1856889
The Sheepdog project is no longer active and the driver has been removed
from Cinder. This cleans up os-brick related code for the driver.
Change-Id: I9684db3ab134aeccce9f2ca47c29cdccaa8c5697
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
All existing jobs are converted to native Zuul v3 versions.
os-brick-cinder-tempest-dsvm-lvm-lio-barbican has been removed
because it is a duplicate of cinder-tempest-plugin-lvm-lio-barbican
which does not test against the current os-brick.
os-brick-src-tempest-lvm-lio-barbican is in fact the same job,
but it tests against the os-brick codebase being tested.
Partial-Bug: #1853372
Depends-On: https://review.opendev.org/672804
Change-Id: I3e6b8f7fffff8aa2e9d4a3009374c74baa131405
Makes Python 3 the base python for all tox venvs and removes
py2 jobs from zuul.yaml.
Remaining:
- move the legacy gate jobs from openstack-zuul-jobs to the os-brick
repo and make them py3 jobs
- adjust setup.cfg to require py3 and remove py2 requirements from
test-requirements.txt and doc/requirements.txt
Partial-bug: #1853372
Change-Id: Ib447656aa213914bafd50380b3821090f93776f8
Bug #1820007 documents failures to find /dev/disk/by-id/ symlinks
associated with encrypted volumes both in real world and CI
environments. These failures appear to be due to udev on these slow or
overloaded hosts failing to populate the required /dev/disk/by-id/
symlinks in time after the iSCSI volume has been connected.
This change seeks to avoid such failures by simply decorating
_get_device_link with the @utils.retry to hopefully allow udev time to
create the required symlinks under /dev/disk/by-id/.
Closes-Bug: #1820007
Change-Id: Ib9c8ebae7a6051e18538920139fecd123682a474
tox.ini is hard-coded to always use the 'test' profile for bindep;
instead, let tox get the profile from the posargs
Closes-bug: #1841836
Change-Id: I24bfb313cf28b20037f5f9aea9417bc8371bfd91
We'll keep separate lists of connectors for each of the supported
operating systems so that we don't end up trying to use unsupported
connectors.
Since Cinder is explicitly trying to use the iSCSI/FC connectors,
we'll have to include those as well, for now.
Change-Id: Ibec2b798e8c5c3457cebea12cfd2f5813e62fb9e
Closes-Bug: #1850109
This patch improves logging for the FC connector and simplifies a couple
of list and dict creations using generators.
The logging is around the modification that os-brick does of the
connection dictionary that Cinder sent. It displays what the contents
were on entry and on exit, and it also warns if we are dropping some
targets because the Cinder driver returned inconsistent data.
Change-Id: I44bfd4939a850e8e080c4f8760244146a75f7218
This patch updates the FC examples that we have in the code in the
connect_volume method docstring to reflect the support of different
target luns and the new enable_wildcard_scan key.
TrivialFix
Change-Id: I21950f0f0f3b30dfd2c3baa156af8dda1633b8ea
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
This patch fixes broken nvmeof UTs. A few tests
called 'asert_called_once_with' method on mock object,
instead of calling 'assert_called_once_with'.
The mistake went undetected, because mock objects
were not configured to use auto-speccing.
To avoid the same problem in the future, configure all
mocks to use autospec.
Additionally, replace 'assert_not_called' method which
is not available on older versions of Python and caused
lower-constraints testenv to fail.
Change-Id: I54a91dfcfae774b1051662291afe1586e59901ac
Signed-off-by: Szczerbik, Przemyslaw <przemyslawx.szczerbik@intel.com>
The OpenStack os-brick library uses hardcoded paths to binary files to
interact with the VxFlexOS SDC. This leads to problems when using
containerized OpenStack (Kolla & Red Hat). Due to the fact that VxFlexOS
SDC binary files has to be used inside containers (nova, cinder, etc.)
the overcloud deployment must be performed in 3 stages:
1) deploy overcloud without additional volume mounts
2) install the VxFlexOS client on the controller and compute nodes
3) update overcloud with additional volume mounts
Using these changes overcloud can be deployed without update step after
initial deployment since os-brick does not have external dependencies
and uses python built-in libraries. The scini device through which the
VxFlexOS client interacts is presented in the containers by default
because /dev directory from the host is mounted in all containers.
Change-Id: Ifc4dee0a51bafd6aa9865ec66c46c10087daa667
Closes-Bug: #1846483
nvme-cli no longer allows to use a path to nvme block device
(e.g. /dev/nvme0n1) as an argument to nvme disconnect command.
For more details, please see:
https://github.com/linux-nvme/nvme-cli/issues/563
To address this issue, change the command that is executed to
disconnect a volume from:
$ nvme disconnect -d <device>
to:
$ nvme disconnect -n <subnqn>
Change-Id: I51a30825da5e7378ebc1d6f4a12645d73d7feb19
Closes-Bug: #1843431
Signed-off-by: Szczerbik, Przemyslaw <przemyslawx.szczerbik@intel.com>