John Griffith [Fri, 15 Aug 2014 23:26:15 +0000 (17:26 -0600)]
Catch vol not found in SolidFire transfer
The accept_transfer call in SolidFire wasn't catching
the volume_not found exception like it should be (and
like other methods do).
This patch just adds a check for volume is None on the
get_volume call during accept_transfer and raises an
appropriate exception if we run into that case.
While we're at it, add some more detail to the "NotFound"
error messages to include the driver operation as per
request of reviewers.
John Griffith [Sat, 16 Aug 2014 15:11:54 +0000 (15:11 +0000)]
Fix LOG string formatting in image_utils
My recent change to report stats on image fetch and
conversion used an incorrectly formatted log message.
The result is Trace messages with Key errors in the c-vol
log files.
This change fixes those messages and gets rid of the key error
exception messages in the Logs.
Rick Chen [Sat, 16 Aug 2014 03:56:01 +0000 (11:56 +0800)]
Change the froce delete volume flage to True
The ProphetStor storage volume unable to remove if this has
assignee on other service or application. We make sure the volume
created by the cinder, and the cinder has the privileges to delete
volume.
John Griffith [Tue, 29 Jul 2014 13:37:07 +0000 (07:37 -0600)]
Update ref used for notifications
When we update a volume status in the db, we need to
use the newly updated volume-ref object in the following
notification method call. Otherwise we're sending a
notification message with the old/outdated status
information.
John Griffith [Thu, 10 Jul 2014 00:00:31 +0000 (00:00 +0000)]
Add iSCSI Target objects as independent objects
This patch is a step in decoupling the target
methods and the Volume Driver's Control methods.
This adds the targets directory and the new target objects
that we use with the exception of IET (follow up for that later).
TgtAdm and LIO drivers have been tested with the new LVM object.
All existing drivers are still able to be specified and use the
same objects and code-path they were using previously. New
connector objects are only used when specifying the new driver.
Next step will be mapping current ref LVM driver to the new
LVM object and target model and working on the unit-tests.
After that mark the "old" methods and objects as deprecated
and we can then begin working on some other improvements.
Marc Koderer [Tue, 22 Jul 2014 11:53:45 +0000 (13:53 +0200)]
Use abstract class for the backup driver interface
Instead of using NotImplementedError exceptions to define the interface
it's better to use python abc class [1]. The advantage that it fails
faster if a class doesn't implement the needed interface.
See also [2].
Joshua Harlow [Fri, 15 Aug 2014 00:02:32 +0000 (17:02 -0700)]
Put result in quotes
When a result is the empty string is is hard/confusing
to look at the logs and determine what the task result
was, to avoid this put the result in quotes so that it
is clear in the log message what is the result and what
is not.
Victor A. Ying [Thu, 14 Aug 2014 22:03:58 +0000 (15:03 -0700)]
Fix exception handling in PureISCSIDriver
PureISCSIDriver had some error logging messages that make use of empty
replacement fields "{}" in strings on which the .format() method is
called, as allowed in Python 2.7+. Python 2.6 requires explicitly
naming or enumerating fields, i.e., "{}" must be replaced with "{0}".
This change fixes this so PureISCSIDriver is Python 2.6 compatible.
PureISCSIDriver.terminate_connection() also changed to catch
errors raised by _get_host_name(). Exception handling generally changed
to be more correct.
This change also adds testing of these code path to the unit tests,
to make sure it's actually correct.
'iscsi_target_create_safe' method didn't catch DB exceptions
correct.
Need to catch both db_exc.DBError and db_exc.DBDuplicateEntry
due to current oslo.db limitations: it doesn't handle correct
DBDuplicateEntry with different SQLite versions
John Griffith [Wed, 13 Aug 2014 21:25:49 +0000 (15:25 -0600)]
Actually encode the SolidFire json dump result
The SolidFire driver intends to do a encode on the json data to utf-8,
unfortunatly it's not really doing anything because the syntax of the
calls is wrong.
This patch changes things to actually perform the encoding.
Jay S. Bryant [Wed, 13 Aug 2014 17:16:49 +0000 (12:16 -0500)]
Sync latest oslo-incubator log for debug fixes
This patch pulls in the changes in openstack/common/log.py that
fix the problems that popped up after we removed _() from
around LOG.debug messages. The change in log ensures that any
text that is not of six.text_type is converted to six.text_type.
Merge "Set keystonemiddleware and routes.middleware to log on WARN level"
---------------------
Additional changes being merged (newest to oldest):
--------------------- 759bd879 -
Merge "Set keystonemiddleware and routes.middleware to log on WARN level 71d072f1 -
Merge "Except socket.error if syslog isn't running" 37c00918 -
Add unicode coercion of logged messages to ContextFormatter 66144135 -
Correct coercion of logged message to unicode 1188d88a -
Except socket.error if syslog isn't running ac995bec -
Fix E126 pep8 errors
Note that this change required an update to config.sample due to change 759bd879 - Merge "Set keystonemiddleware and routes.middleware to log
on WARN level"
Angus Lees [Wed, 13 Aug 2014 02:13:48 +0000 (12:13 +1000)]
Ignore HTTP_PROXY during test requests
urllib2 follows http_proxy/HTTP_PROXY by default. If a (non-local)
proxy is set and a test tries to connect to localhost:$port, it will
instead attempt to connect to $port on the proxy and (presumably) fail.
This change forces the two tests that failed in the presence of
HTTP_PROXY to connect directly.
Angus Lees [Wed, 13 Aug 2014 01:59:18 +0000 (11:59 +1000)]
Issue one SQL statement per execute() call
Some sqlalchemy drivers don't support multiple SQL statements in a
single execute() call. The sqlalchemy author has confirmed that one
statement per execute() is the intended API.
Rick Chen [Mon, 11 Aug 2014 02:55:28 +0000 (10:55 +0800)]
Add ProphetStor DPL Storage server volume driver for Cinder
ProphetStor DPL Storage server enables x86 commodity hardware as
enterprise-grade storage systems.
*[2014/07/14] Remove roll-back function.
*[2014/07/16] Add decorate fiber zone manage utils in initialize_connection and
terminate_connection.
Use mock instead of mox in tests.
*[2014/07/21] Update cinder volume certification report.
*[2014/07/29] Openstack continuous integration platform test.
Retry: 27
*[2014/07/31] Rebase
*[2014/08/06] Refine code
*[2014/08/11] Rebase and enhance to support thin/thick volume
Implements: blueprint prophetstor-dpl-driver
cinder-cert-results: https://bugs.launchpad.net/cinder/+bug/1354066
Change-Id: Iced5e45362aef4286bb7f1c848ab7cb3573b5c02
This change enables hacking check H104 and F841, and fixes all
violations.
[H104] Files with no code shouldn’t contain any license header nor
comments, and must be left completely empty.
[F841] local variable name is assigned to but never used
Jay S. Bryant [Fri, 1 Aug 2014 20:43:51 +0000 (15:43 -0500)]
Add hacking check for use of LOG.audit
Commit 4dc37abc removes the few instances of LOG.audit that
were in Cinder. Given that the plan is to remove LOG.audit messages
from OpenStack, I am adding this hacking check to ensure that such
messages do not sneak their way back into Cinder.
Anthony Lee [Tue, 22 Jul 2014 18:40:21 +0000 (11:40 -0700)]
Add CHAP support for 3PAR ISCSI
Adds CHAP support to 3PAR ISCSI. Volume metadata will store
CHAP credentials to allow volumes to be attached to hosts on
a 3PAR backend. Credentials are generated when the first volume
is attached. Subsequent volumes lookup the CHAP credentials
from an existing volume already attached to the host.
Jeegn Chen [Fri, 8 Aug 2014 08:27:38 +0000 (16:27 +0800)]
EMC: Fix minor issue in VNX driver and unit tests
There were some minor issues in initial commit of VNX Direct Driver
Juno Update (https://review.openstack.org/#/c/104413/), such as typo,
unclear config option help message and missing period.
Thang Pham [Thu, 7 Aug 2014 21:41:11 +0000 (17:41 -0400)]
Do not translate debug messages
LOG.debug messages do not need to be translated. The rdb driver
has a couple of debug messages that are translated. This patch
removes those debug translations.
Also, logging exception.ImageUnacceptable can contain non-ascii
characters. This patch fixes this by using six.text_type to
properly translate the exception.
Anthony Lee [Thu, 7 Aug 2014 20:58:34 +0000 (13:58 -0700)]
Fixing LeftHand live migration error
Fixed a bug in the LeftHand driver that was causing an error to occur during
live migration of an instance that is attached to a volume. The solution was
to make sure server access is only requested for a volume if the iSCSI
session doesn't already have access enabled on the LeftHand backend.
Jay S. Bryant [Sat, 2 Aug 2014 23:06:38 +0000 (18:06 -0500)]
Improve regex for _ import hacking check
Commit 3e2b1117 added a check to make sure that the _
function was being explicitly imported so that translation would
work properly.
I have discovered that those regexes/code would not work in some cases.
Particularly if the import line imported multiple things from
gettextutils or i18n. Also the check being used to find lines using
the _ function was not right.
This commit fixes the issues and adds appropriate tests. It also
adds the hacking check to HACKING.rst which should have been done the
first time around.
Wu Wenxiang [Sun, 2 Mar 2014 14:20:49 +0000 (22:20 +0800)]
General cleanup of unused objects
* Remove unused function fake_get_remote_image_service
* Remove unused local function fake_execute2
* stub_out_key_pair_funcs() does nothing, remove it.
* Removed usage of enumerate()
All *Command classes are instantiating for each cinder-manage command
execution. RPC client should be initialized for VolumeCommands usage.
Some custom RPC clients (oslo.messaging backends) could init RPC
connection after client initialization so it is no need to create RPC
client for every cinder-manage command invoke.
When doing backup-restore operation, it needs volume's size is not less
than backup's size.
But in backup-restore routine, when volume's size is bigger than backup's
size, it logs the the info of volume's size and backup's size to warn
level, which I think it should log the info to info level.
This bug fix it.
John Griffith [Fri, 1 Aug 2014 23:10:55 +0000 (17:10 -0600)]
Add retry_on_deadlock to db update methods
There's some known races that have been addressed in
Nova via a retry_on_deadlock deocrator. Some known
cases in Cinder exist as well when dealing with updates
to quotas and reservations_expire.
This patch introduces the decorator to Cinder and hits
the methods known to be susceptible to deadlock as well
as some others that seem as though they'd fall into the
same category.
Marc Koderer [Thu, 31 Jul 2014 08:10:17 +0000 (10:10 +0200)]
Fix unit test test_import_record_with_verify
The test case test_import_record_with_verify is intended to call a
backup service class with a defined verify function. This verify
function wasn't overloaded by the fake service.
Li Min Liu [Tue, 5 Aug 2014 03:39:09 +0000 (11:39 +0800)]
Change the exception type for Storwize/SVC driver
When create a volume from snapshot or clone a volume,
Storwize/SVC require the same size for the source volume
and target, if not, will raise VolumeDriverException.
The task_poll_interval option is used as the polling interval of vCenter/ESX
task status. This patch updates the default value to 0.5s in order to reduce
the wait time for task completion. Similar change has been done in nova and
this change is needed to keep the driver config values consistent.
DocImpact
Updated default value of task_poll_interval to 0.5 seconds.