Chris Morrell [Wed, 18 Nov 2015 22:14:15 +0000 (22:14 +0000)]
Additional VAG support for SolidFire
This patch removes volumes from volume access groups, and potentially volume
access groups, when a connection is terminated. When the previously added
'sf_enable_vag' option is enabled and a volume connection is terminated, if the
volume was part of a VAG then the volume is removed from the VAG. If the volume
is the only remaining volume in the VAG then the VAG is also removed.
Chris Morrell [Mon, 16 Nov 2015 21:45:48 +0000 (21:45 +0000)]
Added VAG support to SolidFire
This patch adds VAG support to the SolidFire driver.
This includes a new config option 'sf_enable_vag'.
The driver creates a new VAG based on initiator name during
connection initialization.
By default VAG support is disabled. When enabled, the driver uses both
CHAP and VAG authentication.
This patch removes the deprecated HP Lefthand
CLIQ/SSH based driver. It also refactors the proxy
class, which was nothing but a wrapper for the 2
drivers. The LeftHand driver is now entirely based
off of the REST client.
Kendall Nelson [Wed, 7 Oct 2015 13:53:38 +0000 (08:53 -0500)]
Downstream Fix for Genconfig
This patch adds the opts.py file to the tree as a fix for deployers
that package cinder. The opts.py file is no longer being deleted right
away by generate_sample.sh after the cinder.sample.conf is being
generated.
This patch also introduces a pep8 check to make sure that the opts.py
file is up to date, so that it will catch when new opts get added to
Cinder without the opts.py being updated.
To support the ability to keep and check the opts file a number
of changes were needed in the check_uptodate.sh script as well as
the generate_sample.sh script:
- check_uptodate now takes --checkopts instead of --checkonly
When checkopts is used the opts.py file is generated using the
current code and the generated file is compared to the existing
file. The check fails if there are differences.
- generate_sample now has the --nosamplefile option.
When this option is used, only the opts.py file is generated.
The oslo-config-generator code is skipped so no sample file
is created.
- generate_sample also has some coding style consistency changes.
- Added the 'genopts' option to tox so users can generate
a fresh opts.py without a sample file when necessary.
Closes-Bug: 1501820
Co-Author: Jay Bryant <jsbryant@us.ibm.com>
When 3PAR iSCSI driver is configured for multipath, with multiple
ip addresses in hp3par_iscsi_ips, find_existing_vluns fails to return
more than 1 vlun. The problem with this is that every time
initialize_connection is called, the driver will not find the vlun it expects
to be there, and then it will create a new one.
This patch removes the break inside of find_existing_vluns, so that it
returns the entire list, not just the first vlun.
Victor Stinner [Sun, 8 Nov 2015 20:49:09 +0000 (21:49 +0100)]
py3: Fix error handling in prophetstor driver
* Port prophetstor driver to Python 3
* Replace "except exception as e:" with "except Exception as e:"
to handle "Fexvisor failed to join the volume ..." and "Fexvisor
failed to remove the volume ..." errors. Here, lower case
"exception" is the cinder.exception module, not an exception class.
On Python 3, "except" requires exception classes.
* tests-py3.txt: add cinder.tests.unit.test_prophetstor_dpl
Michał Dulko [Thu, 12 Nov 2015 15:46:59 +0000 (16:46 +0100)]
add "unreleased" release notes page
We need a release notes page to show notes for unreleased versions by
scanning the "current" branch. This ensures that notes files cannot be
merged if they break the releasenotes job.
The following patch updates retype API to use volume
versionedobjects. Changes were made to be backwards
compatible with older RPC clients. It only includes
changes to the core cinder code. Changes in the
drivers are left to each driver maintainer to update.
Note that this patch DOES NOT try to use object dot
notation everywhere, since it would increase the
size of the patch. Instead, it will be done in
subsequent patches.
Thang Pham [Tue, 3 Nov 2015 14:15:37 +0000 (06:15 -0800)]
Update get/delete_volume API to use versionedobjects
The following patch updates get_volume and delete_volume
API to use volume versionedobjects. Changes were made to
be backwards compatible with older RPC clients. It only
includes changes to the core cinder code. Changes in the
drivers are left to each driver maintainer to update.
Note that this patch DOES NOT try to use
object dot notation everywhere, since it would
increase the size of the patch. Instead, it
will be done in subsequent patches.
Thang Pham [Tue, 27 Oct 2015 22:38:54 +0000 (15:38 -0700)]
Update create_volume API to use versionedobjects
The following patch updates create_volume API to use
volume versionedobjects. Changes were made to be
backwards compatible with older RPC clients. It
only includes changes to the core cinder code.
Changes in the drivers are left to each driver
maintainer to update.
Note that this patch DOES NOT try to use
object dot notation everywhere, since it would
increase the size of the patch. Instead, it
will be done in subsequent patches.
Co-Authored-By: Michal Dulko <michal.dulko@intel.com>
Change-Id: Ic1b0f09132f8fc500b29650abbd57f18ea8bd9dd
Partial-Implements: blueprint cinder-objects
Matt Riedemann [Tue, 10 Nov 2015 20:55:46 +0000 (12:55 -0800)]
Test for object version hash changes
Use the ObjectVersionChecker fixture from oslo.versionedobjects to check
when Cinder's registered objects have a change (new remotable method,
new field, etc) that require a version bump.
Fixes some registration problems along the way:
1. CinderObject doesn't need to be registered.
2. TestObject should be registered where it's used, not globally.
Removes deps=requirements.txt from tox.ini since it's not necessary and
prevents us from pip installing oslo.versionedobjects[fixtures].
Matt Riedemann [Tue, 10 Nov 2015 23:45:29 +0000 (15:45 -0800)]
Fix cinder objects unit test registration
The base test case was extending test code from oslo_versionedobjects
which is bad because (1) it was adding test objects from the o.vo
registry into the cinder object registry and (2) it was extending
internal private test classes from o.vo which are subject to change and
would break cinder.
This cleans up the base test case and object registration to basically
do it the same way that nova does.
It also moves the duplicate _compare() method into the base class and
fixes a bug where db obj fields that were lists were compared
incorrectly against object lists.
This will allow us to verify object version hashes using o.vo's
ObjectVersionChecker fixture in a follow on change without the
extraneous object registrations from o.vo messing with the results.
Xing Yang [Tue, 25 Aug 2015 04:46:53 +0000 (00:46 -0400)]
CG driver function should not access db
Currently the following CG driver interfaces don't pass in volumes
or snapshots to the driver. As a result, drivers have to retrieve info
from db. In this patch, these interfaces are changed so that drivers
don't have to access db.
Removing the access to db from driver CG functions will be handled by
separate patches.
chenying [Tue, 10 Nov 2015 07:17:57 +0000 (15:17 +0800)]
Use oslo_config new type PortOpt for port options
The oslo_config library provides new type PortOpt to validate the
range of port now.
ref: https://github.com/openstack/oslo.config/blob/2.6.0/oslo_config/cfg.py#L1114
Currently, cinder scheduler schedules the CG creation
on pool level, that means if there are multiple volume
types in one CG if each volume type is associated with a
different pool (those pools under same backend), you can't
create the CG successfully.
According to the design of CG's, it should be scheduled on
backend level to support the case mentioned above.
Kendall Nelson [Mon, 9 Nov 2015 16:52:43 +0000 (10:52 -0600)]
Removal of deprecated NPIV option in Storwize
The storwize_svc_npiv_compatibility_mode option was deprecated and
set to be removed during the M release. This patch removes the
option, the associated code, and the test cases for the associated
code. This patch also removes the unused import versionutils.
Victor Stinner [Sun, 8 Nov 2015 21:13:14 +0000 (22:13 +0100)]
Port zfssa driver to Python 3
* Replace base64.encodestring() with
oslo_serialization.base64.encode_as_text() to accept Unicode as
input (encoded to UTF-8). On Python 3, the function decodes base64
from ASCII to get Unicode.
* tests-py3.txt: add cinder.tests.unit.test_zfssa
Victor Stinner [Sun, 8 Nov 2015 21:04:45 +0000 (22:04 +0100)]
Port vzstorage to Python 3
* vzstorage: replace a/b with a//b to use integer division on
Python 3.
* fix os.path.exists mock: only override return for path /fake
(shares config)
* tests-py3.txt: add cinder.tests.unit.test_vzstorage
Note: remove also spaces in parameters in two functions calls to
respect the PEP 8.
Shay Halsband [Tue, 3 Nov 2015 14:33:03 +0000 (16:33 +0200)]
XtremIO fix create CG from src flow
Fix a bug during volume creation with CG,
that prevented the volume from being added to the CG on the array.
Query array snapshots names for CG snapshot before copying them
to a new volume.
Add unittest for create_cg_from_src.
Kurt Martin [Fri, 6 Nov 2015 16:42:50 +0000 (08:42 -0800)]
3PAR drivers volume size conversion is incorrect
The 3PAR drivers conversion of the volume size to gibibytes (GiBs) is
incorrect, resulting in slightly smaller volumes than expected. The
drivers were assuming the input was gigabytes (GBs) when in fact the
input was gibibytes (GiBs) as documented by the cinder API.
Michał Dulko [Fri, 6 Nov 2015 11:37:23 +0000 (12:37 +0100)]
Use Service object instead of DB API directly
In cmd.manage and volume.api we had code accessing DB API directly.
This should be done through Service versioned object instead and this
commit fixes that.
Michal Dulko [Tue, 25 Aug 2015 10:12:57 +0000 (12:12 +0200)]
Add LC_ALL=C to lvcreate, lvextend and pvresize
In various locales decimal mark is considered to be ',' instead of '.'.
This creates a problem when Cinder executes lvcreate, lvextend or
pvresize because it always passes numerals in 1.00g form and these
commands expect 1,00g when started with LC_NUMERIC set to one of such
locales. This commit adds LC_ALL=C env variable to all executions of
lvcreate, lvextends and pvresize and updates rootwrap's volume.filters
accordingly to make sure that parameters are interpreted in a correct
way.
Victor Stinner [Thu, 5 Nov 2015 16:20:41 +0000 (17:20 +0100)]
Port test_tintri to Python 3
* Set configuration.nfs_oversub_ratio, otherwise tests
fail with TypeError on comparison between mock.Mock and int.
* tox.ini: add test_tintri to Python 3.4.
After introducing the commit 93d26e40098c966e7d791a9fb6152244a9f9409d
unit test TestCinderAllCmd fails if a test environment has
/etc/cinder/cinder.conf with proper backend configuration.
We should mock out some variables not to depend on test environment.
Tom Patzig [Mon, 26 Oct 2015 19:28:05 +0000 (20:28 +0100)]
Execute mount.nfs check with absolute path
Currently the existence of mount.nfs is checked by executing
the relative binary 'mount.nfs' with a non-root user,
in this case cinder. This results, for example on SUSE, in the error:
NfsException: mount.nfs is not installed
Because mount.nfs is located under /sbin, unprivileged users
do not have /sbin in their PATH to search for executables.
The change runs the mount.nfs check by using the absolute binary
path /sbin/mount.nfs. This seems to be common for most distributions
(SUSE, RedHat, CentOS, Ubuntu, Debian). The check can still be executed
as non privileged user, by not relying on correctly set PATH variable
and using the absolute path.