John Griffith [Thu, 22 Jan 2015 17:35:31 +0000 (10:35 -0700)]
Add a generic retry decorator to cinder/utils
Retries are something that we use in a number of
places, and could probably use in a few more. Rather
than continue writing custom retry code or silly loops
let's add a generic retry decorator class that can be
initialized and used as needed.
This patch leverages the retrying library that's already
in OpenStack Requirements and used in other places. We
just add a wrapper around it for some logging and add
a bit of error handling incase somebody sets retries to 0
Zhiteng Huang [Wed, 14 Jan 2015 03:54:40 +0000 (11:54 +0800)]
Cleanup unused DB APIs, part I
There are unused DB APIs, some of them were leftovers of other features
removal, some are purely added without being used. This change removes
these unused DB APIs.
Note that there are some DB APIs only used by unit tests, in other words
they are used in unit tests where they are not the unit of code being
tested. Those will be cleaned up in follow-up patch(es).
John Griffith [Fri, 23 Jan 2015 00:21:27 +0000 (17:21 -0700)]
Add retrying lib from global requirements
Submitted a retry decorator and it was pointed out that
the retrying library was already in global-requirements,
it would probably be good to leverage this and use it rather
than roll our own, so let's add it to our version of requirements
and then we can look at whether using a decorator or just
leveraging the lib is the right way to go.
Joshua Harlow [Thu, 22 Jan 2015 19:22:21 +0000 (11:22 -0800)]
Remove usage of taskflow 'utils.misc' module
The failure type at its old location in an internal
utils directory of taskflow is deprecated (in general
usage of taskflow utils code should be restricted/not
done) and it has been moved to a public location of
taskflow.types (which is ok to use and is not
deprecated).
This change updates to use the better and more supported
module/code location instead.
Jay S. Bryant [Wed, 21 Jan 2015 07:43:00 +0000 (01:43 -0600)]
Move oslo.serialization to oslo_serialization namespace
This is the fifth in a series of changes to move to using
the new oslo_<library> namespace that is being used for
oslo libraries.
There is currently a shim in place that is allowing the old
oslo.<library> imports to work, but we need to be prepared for
when the shims go away. Thus, we need patches like this one to
move to the new namespace.
This patch also updates our hacking check to ensure that no instances
of oslo.utils sneak back in.
Sean McGinnis [Tue, 20 Jan 2015 22:50:19 +0000 (16:50 -0600)]
Improve debug logging of Dell Storage Center driver
Adding debug message and expanding some existing log statements
to make debugging and auditing easier. Some interesting calls
were not being logged while others had logging that was missing
some relevant arguments.
Creating vCenter inventory folder for grouping volumes will
fail with AttributeError if the vCenter's datacenter doesn't
have any child folder under vmFolder (inventory folder for
grouping virtual machines). This patch fixes it.
Joshua Harlow [Thu, 22 Jan 2015 00:32:28 +0000 (16:32 -0800)]
Shrink down customized logging listener
Most of the code for this has been moved into taskflow
upstream; so now we should be able to override a single
*cinder-specific* method and retain the same functionality
that previously existed but in a more shareable manner (for
example glance will be using similar code).
Mike Perez [Thu, 22 Jan 2015 00:06:49 +0000 (16:06 -0800)]
Prevent deleting volumes in a consistency group
Currently you have to destroy the consistency group if you want to
delete these volumes. In the Kilo release, we'll have the ability to
remove a volume from a consistency group, which then can be deleted.
wuyuting [Sun, 18 Jan 2015 22:32:34 +0000 (06:32 +0800)]
Fix bug in rbd driver: the cloned volume size is wrong
The cloned volume size is wrong when the size is different
from source volume. This is because rbd driver doesn't
resize the volume when clone has completed.
The error message shown when the parser finds a parser error
says, 'file not found' which causes confusion on the user when
he/she needs to debug the real cause of the problem. This patch fixes
this by testing first if the file exist and then throwing a proper error
message.
Also corrects an error when appending the config_file_name to the message on
the NFS driver and fixes LOG messages according to oslo.i18n guidelines.
Jay S. Bryant [Tue, 13 Jan 2015 04:55:45 +0000 (22:55 -0600)]
Ensure lazy translation is disabled properly
Commit 894f20d9cf57b36ccf9a675c6b2b070d56c9b297 changed the way that
enable_lazy() is being configured in cinder's test cases. The changes
were required to remove the use of _lazy from the oslo's i18n library.
_lazy was removed from i18n and the code that was accessing the internal
variable broke. The commit referenced above made changes to remove
the use of _lazy.
The commit, however, changed the behavior of the test cases to only
enable_lazy without disabling it, which diverges from the original
behavior.
This commit uses the new oslo.i18n ToggleLazy fixture (added in 1.3.0).
Jay S. Bryant [Fri, 16 Jan 2015 22:54:27 +0000 (16:54 -0600)]
Move oslo.utils to oslo_utils namespace
This is the fourth in a series of changes to move to using
the new oslo_<library> namespace that is being used for
oslo libraries.
There is currently a shim in place that is allowing the old
oslo.<library> imports to work, but we need to be prepared for
when the shims go away. Thus, we need patches like this one to
move to the new namespace.
This patch also updates our hacking check to ensure that no instances
of oslo.utils sneak back in.
Eric Harney [Mon, 19 Jan 2015 19:01:45 +0000 (14:01 -0500)]
Make test_create_delete_snapshot more robust
This patch does two things to improve this test, and
help debug issues with it failing.
- Add additional checks for contents of the first two
expected notifications.
- Assert the length of the notifications list after checking
its contents so that if it contains unexpected items, we can
see what they are. This should help with the current gate
failures.
Eric Harney [Mon, 19 Jan 2015 18:10:00 +0000 (13:10 -0500)]
Add policy_dirs conf fixture
Unit tests that call into the policy enforcer from openstack
common will try to load files from the default directory of
'policy.d'.
Set the policy_dirs option to [] for unit tests since tests
are not trying to use policy from a directory like this, and
this will prevent test failures.
Aviram Bar-Haim [Fri, 16 Jan 2015 00:45:30 +0000 (02:45 +0200)]
Fix the iSER legacy usage in the new targets flow
The iSER driver flow, after setting volume_driver to LVMISERDriver,
is broken in the new driver - target model in the master,
due to a mismatch in the target prefixes and a lack of iSER target
initialization, with the correct parameters.
In order to fix this:
1. The function initialize_connection, that sets the iSER required
parameters, was added to cinder/volume/targets/iser.py (and overrides the
new connection initialization in cinder/volume/targets/tgt.py).
2. The iSER and iSCSI prefixes equalized, due to the removal of brick/iscsi
with the different default prefix for ISERTgtAdm (and for stability).
Jay S. Bryant [Thu, 15 Jan 2015 20:03:49 +0000 (14:03 -0600)]
Move oslo.config to oslo_config namespace
This is the third in a series of changes to move to using
the new oslo_<library> namespace that is being used for
oslo libraries.
There is currently a shim in place that is allowing the old
oslo.<library> imports to work, but we need to be prepared for
when the shims go away. Thus, we need patches like this one to
move to the new namespace.
This patch also updates our hacking check to ensure that no instances
of oslo.config sneak back in.
Patrick East [Thu, 18 Dec 2014 23:21:02 +0000 (15:21 -0800)]
Add support for manage/unmanage volume commands to PureISCSIDriver
This change adds implementations of the required methods to make
manage and unmanage commands work with the PureISCSIDriver. You can now
call them and specify a volume name of an existing non-cinder volume on
the array and it will rename the volume accordingly to allow cinder to
manage it. When a volume is unmanaged it is renamed with a “-unmanaged”
suffix and left on the array.
Nilesh Bhosale [Fri, 16 Jan 2015 10:10:18 +0000 (15:40 +0530)]
Set 'driver_volume_type' to 'gpfs'
nova LibvirtGPFSVolumeDriver class implemented recently for GPFS volume
driver expects the 'driver_volume_type' as 'gpfs' from the Cinder GPFS
driver. Making the required change in the GPFS cinder driver to
complete the fix.
Xing Yang [Wed, 17 Dec 2014 05:53:01 +0000 (00:53 -0500)]
Verify the instance's existance in the VMAX driver
There are a few functions in the VMAX driver that are
referencing an instance that may have been already deleted.
This patch addressed this issue by verifying the instance's
existance.
Patrick East [Wed, 14 Jan 2015 23:07:16 +0000 (15:07 -0800)]
Switch the PureISCSIDriver over to using the purestorage pypi module.
All management api's will now go through the purestorage module, the
interface is extremely similar to the original FlashArray object
included in the cinder.volume.drivers.pure module. This allows for
updates to the REST API and python code that uses it to not disrupt the
cinder driver.
Jay S. Bryant [Thu, 15 Jan 2015 00:16:32 +0000 (18:16 -0600)]
Move oslo.db to oslo_db namespace
This is the second in a series of changes to move to using
the new oslo_<library> namespace that is being used for
oslo libraries.
There is currently a shim in place that is allowing the old
oslo.<library> imports to work, but we need to be prepared for
when the shims go away. Thus, we need patches like this one to
move to the new namespace.
This patch also updates our hacking check to ensure that no instances
of oslo.db sneak back in.
Dunrong Huang [Wed, 14 Jan 2015 05:56:43 +0000 (13:56 +0800)]
Fix eqlx endless loop when server closes the connection
The eqlx driver would identify one CLI command completion by looking
for the system name prompt in the output ("ARRAY_NAME>"). But some
cases where there is no "ARRAY_NAME>" in the output. The eqlx server
closes the ssh connection immediately after sends such message, which
lead to a infinite loop in _get_output() and 100% CPU utilization.
What the patch does is to check the return of chan.recv(), if the
length of returned string is zero, which means server has closed the
connection, the loop will be exited.
Curt Bruns [Thu, 15 Jan 2015 18:35:05 +0000 (11:35 -0700)]
Increase unit test coverage in hacking test
Added a few unit tests to increase the test coverage from
~60% up to 90%. Also modified the assertEqual of all tests
to be in the form of assertEqual(EXPECTED, ACTUAL) format.
Anthony Lee [Thu, 25 Sep 2014 12:10:05 +0000 (05:10 -0700)]
Fixed server name being retained after detach in LeftHand
There was an issue with the LeftHand driver where the
initiator names of servers were not being removed when the last
volume attached to that server was detached.
This fix will now remove the server from the LeftHand backend
when no more volumes are attached to it.
Mitsuhiro Tanino [Thu, 15 Jan 2015 00:59:54 +0000 (19:59 -0500)]
Add mock for cinder-rtstool call in tests.targets.test_lio_driver
Unit tests in tests.targets.test_lio_driver are calling out to
cinder-rtstool.
change-id Ic25828361d9c30c4e1aa37b630d8ad272a78977b skips this
unit test to avoid failure of tests.
This patch reverts this change and adds mock for calling of
cinder-rtstool to reenable the unit tests.
Tomoki Sekiyama [Wed, 7 Jan 2015 00:58:13 +0000 (19:58 -0500)]
TgtAdm: Don't change CHAP username/password on live migration
This fixes TgtAdm Target Objects not to regenerate random
username/password every time initialize_connection is called,
as TgtAdm doesn't accept the change while the initiator is
connected. This fixes the live-migration of nova instances which
have volumes attached.
Corey Bryant [Wed, 14 Jan 2015 18:11:30 +0000 (13:11 -0500)]
Deal with PEP-0476 certificate chaining checking
PEP-0476 introduced more thorough certificate chain verfication
for HTTPS connectivity; this was introduced in Python 2.7.9, and
breaks a number of unit tests in the cinder codebase.
Disable certificate chain verification for cinder SSL tests
using the backwards compatible SSLContext provided for this
purpose.
Jay S. Bryant [Tue, 13 Jan 2015 23:11:33 +0000 (17:11 -0600)]
Add hacking check for oslo namespace usage
We want to make sure that we don't have usage of the old
oslo.concurrency naming slipping in with new changes where
we should be using the oslo_concurrency namespace. This change
adds a hacking check to avoid use of the deprecated namespace.
As we convert more oslo libraries to the new namespace the check
will be updated to enforce use of the new namespace.
This hacking check is based upon the same N333 hacking check
in Cinder.
Anthony Lee [Fri, 12 Dec 2014 19:32:15 +0000 (11:32 -0800)]
Remove locks from LeftHand driver
By removing synchronization locks from the LeftHand driver,
support for many simultaneous volume create/deletes and
volume attach/detachs will be added. This is useful for high
availability environments where performance with locks in place
would be reduced.
Removing the locks requires the creation of a new LeftHand
client when a request is sent to the driver now. This
allows requests to no longer be blocked if a request is
already in process by the driver.
This results in a performance increase for the driver and
better stability in a high availability environment.
ChangBo Guo(gcb) [Tue, 23 Dec 2014 07:20:38 +0000 (15:20 +0800)]
Use is_valid_ipv6 from oslo.utils
Remove _is_valid_ipv6 from Cinder and replace it's usages
by usages of is_valid_ipv6 from netutils, because this methods
implements the same functionality.
Twelve of the the storwize_svc unit tests started failing with the
complaint that the required configuration option 'lock_path' was not set.
This change updates cinder/test.py to not only set up a temporary
lock_path location that will be automatically cleaned up, but to also
register that temporary lock_path location using lockutils.set_defaults()
to correct the problem.