wanghong [Thu, 20 Mar 2014 02:39:37 +0000 (10:39 +0800)]
init_host should be called before RPC consumer is created
Currently, the init_host method is called after RPC consumer is
created. This behavior will lead to a bug that when a rpc request
is received the manager can not handle it because the driver has not
been initialized!
Mike Perez [Mon, 17 Mar 2014 05:24:38 +0000 (22:24 -0700)]
Simplify test force delete snapshot unit test
Make this test simple in just verifying if we have a snapshot and we do
a force delete that we get back an ok response from the controller.
Removing out RPC call and verifying snapshot was deleted since that's
out of the scope here.
Xiao Chen [Thu, 6 Mar 2014 10:13:46 +0000 (18:13 +0800)]
resolve KeyError for IBM Storwize/SVC driver
When using iSCSI protocol to conenct IBM v7000, and compression
is not enabled for the system, KeyError may occur because of the response
item's lack of 'license_compression_enclosures'. So add a check to
resolve it.
Avishay Traeger [Wed, 26 Feb 2014 09:27:06 +0000 (11:27 +0200)]
Fix create_export/remove_export in driver.py
1. There was a call to rpcapi.create_export which does not have a
matching volume manager function, causing volume migration to crash.
This call was not necessary because there is already an
initialize_connection RPC call, which calls the driver's create_export
function. Removed the create_export RPC call and function. Added better
error handling to that code in _attach_volume in driver.py as well.
2. The manager called remove_export from detach_volume, which was not
being called by these functions. I believe it makes more sense to call
it from terminate_connection. Moved it there, and fixed up the
corresponding code in _detach_volume in driver.py.
3. Remove leftovers of export code from create_volume manager flow.
Joshua Harlow [Thu, 13 Mar 2014 00:31:29 +0000 (17:31 -0700)]
Use the error_out_volume from flow common instead
Instead of a custom piece of logic that errors out
a volume due to the driver not initialized issue
just use the same one that is used in other flows
to accomplish the same update.
Jay S. Bryant [Wed, 12 Mar 2014 22:39:18 +0000 (17:39 -0500)]
Don't send untextified exc to webob
As part of commit cbe1d5f5e22e5f792128643e4cdd6afb2ff2b5bf I
accidentally removed the str() from exceptions that were being
passed out of OpenStack to webob. This broke the contract with
webob which was expecting strings (text) to be sent. This
resulted in webob doing bad things if we encountered an exception,
like trying to create a duplicate volume type.
This commit replaces the str()'s that shouldn't have been removed
with six.text_type() which should be used in place of str() to
resolve this issue. There was one instance where a message was
instead being unicoded, this also was changed to use six.text_type.
This commit also fixes one message that should have been translated
but was not.
Joe Gordon [Mon, 10 Mar 2014 18:02:13 +0000 (11:02 -0700)]
Use debug level logging during unit tests
When unit tests fail we need to debug, so we should have debug level logging on.
We use fixtures FakeLogger during testing, to enable debug logging pass
in log level as a parameter.
john-griffith [Wed, 12 Mar 2014 16:59:45 +0000 (10:59 -0600)]
Sync log.py from oslo-incubator
This pulls in the latest version of log.py from oslo-incubator
which elminates the constant user_identity key error.
Note that this sync does a full sync, in other words it uses
the oslo update script and pulls in the log.py file and all
of the associated dependendencies for that module.
Current HEAD in OSLO:
--------------------
Merge: d9ea4f0fd33d1e
Date: Wed Mar 12 17:00:13 2014 +0000
Merge "Fix gettextutil.Message handling of deep copy failures"
--------------------
This patch is a follow up to a review that merged
included and had some issues raised after it was merged.
This patch includes some hacking cleanup and some
unit test cleanup for the Fibre Channel Zone Manager.
Steven Kaufer [Fri, 7 Mar 2014 23:01:51 +0000 (23:01 +0000)]
get volumes with limit and filters does not work
The /volumes and /volumes/detail REST APIs support filtering. Currently,
all filtering is done after the volumes are retrieved from the database
in the API.get_all function in /cinder/volume/api.py. Therefore, the usage
combination of filters and limit will only work if all volumes matching
the filters are in the page of data being retrieved from the database.
For example, assume that all of the volumes with a name of "foo" would be
retrieved from the database starting at index 100 and that you query for
all volumes with a name of "foo" while specifying a limit of 50. In this
case, the query would yield 0 results since the filter did not match any of
the first 50 entries retrieved from the database.
This patch removes all filtering from the volume API layer and moves it
into the DB layer.
Test cases were added to verify filtering at the DB level.
Lucian Petrut [Fri, 7 Mar 2014 15:09:33 +0000 (17:09 +0200)]
Fixes cinder-volume service startup on Windows
The Windows service fails due to missing non-blocking IO features
in eventlet. This fix adds a conditional path on Windows to execute
the service accordingly.
This bug had already been fixed by this this commit:
https://review.openstack.org/#/c/44744/ but it had been reverted
here, causing the Windows service to fail again
https://review.openstack.org/67031
Nova bypasses the cinder checks for a volume
being available, when it tries to attach a volume
to a new host during live migration. The assumption
in cinder to this point has been that volumes can only
be attached to one host. The 3PAR driver worked under
that assumption. This assumption fell apart during detach
time as the driver was only looking for a VLUN on the
entire 3PAR, since it assumed it could only exist on one host.
This patch ensures that the driver looks for the VLUN on the
hostname it expects.
Luis A. Garcia [Tue, 11 Mar 2014 15:34:02 +0000 (09:34 -0600)]
Adding domain to context
Add support for upcoming "domain" concept in Keystone V3 API in
the context.
This fix ensures there is a user_identity in the context for the
corresponding new attribute in the log format string added in oslo. The
oslo change has the same change-id as this one.
Vincent Hou [Wed, 4 Dec 2013 08:51:20 +0000 (03:51 -0500)]
VMware: Take the volume size from the user input
When we create a volume from an image or a snapshot, we need to
take the size of the volume from the user input and validate whether
the size is appropriate instead of taking the image size as the
volume size directly.
The VMware ESX driver in Nova is now marked as deprecated and will be
removed in Juno release. This change marks the VMware ESX vmdk driver
as deprecated since it is intended for use with the ESX driver in Nova.
The plan is to remove the ESX vmdk driver in Juno release.
Flavio Percoco [Tue, 11 Mar 2014 09:33:45 +0000 (10:33 +0100)]
Generate config samples for oslo.messaging
This patch adds oslo.messaging to the
CINDER_CONFIG_GENERATOR_EXTRA_LIBRARIES env variable, which adds
oslo.messaging config options to cinder.conf.sample
Flavio Percoco [Fri, 7 Feb 2014 11:20:44 +0000 (12:20 +0100)]
Port to oslo.messaging
The oslo.messaging library takes the existing RPC code from oslo and
wraps it in a sane API with well defined semantics around which we can
make a commitment to retain compatibility in future.
The patch is large, but the changes can be summarized as:
* oslo.messaging>=1.3.0a4 is required; a proper 1.3.0 release will be
pushed before the icehouse release candidates.
* The new rpc module has init() and cleanup() methods which manage the
global oslo.messaging transport state. The TRANSPORT and NOTIFIER
globals are conceptually similar to the current RPCIMPL global,
except we're free to create and use alternate Transport objects
in e.g. the cells code.
* The rpc.get_{client,server,notifier}() methods are just helpers
which wrap the global messaging state, specifiy serializers and
specify the use of the eventlet executor.
* In oslo.messaging, a request context is expected to be a dict so
we add a RequestContextSerializer which can serialize to and from
dicts using RequestContext.{to,from}_dict()
* The allowed_rpc_exception_modules configuration option is replaced
by an allowed_remote_exmods get_transport() parameter. This is not
something that users ever need to configure, but it is something
each project using oslo.messaging needs to be able to customize.
* We maintain a global NOTIFIER object and create specializations of
it with specific publisher IDs in order to avoid notification driver
loading overhead.
* rpc.py contains transport aliases for backwards compatibility
purposes. setup.cfg also contains notification driver aliases for
backwards compat.
* The messaging options are moved about in cinder.conf.sample because
the options are advertised via a oslo.config.opts entry point and
picked up by the generator.
* We use messaging.ConfFixture in tests to override oslo.messaging
config options, rather than making assumptions about the options
registered by the library.
Steven Kaufer [Fri, 7 Mar 2014 04:54:50 +0000 (04:54 +0000)]
get volumes API does not handle limit=0
This bug fixes a regression from bug 1288429, where the "next"
link is added when the number of volumes returned is the
maximum limit (even if the "limit" param is not specified).
The regression is hit when a "limit" of 0 is specified; in this
case the logic to create the "next" link is still executed and an
exception is thrown. The fix is to add back in the "if" check that
implictly checks if the max_items is non-0.
Test code was also created to verify that a limit of 0 is handled
correctly.
Xing Yang [Fri, 7 Mar 2014 18:43:22 +0000 (13:43 -0500)]
EMC SMI-S delete snapshot unit test takes too long
EMC SMI-S unit test for deleting snapshot takes too long.
This patch sets Timout to 0 in cinder_emc_config.xml
so that it will return immediately. Without this fix,
it will wait for 10 seconds by default.
Steven Kaufer [Thu, 6 Mar 2014 17:20:50 +0000 (17:20 +0000)]
Include next link when default limit is reached
The /volumes and /volumes/details APIs support pagination and a
"next" link should be included when more data is available. When
the default "osapi_max" limit is reached then the "next" link is
not included in the API reply. In this case, the caller cannot
determine if there are any more volumes and has no marker value
such that they can retrieve the rest of the volumes.
The fix for this is to include the "next" link when the number of
volumes being returned is the maximum limit, even if the "limit"
parameter is not supplied.
Jay S. Bryant [Fri, 31 Jan 2014 22:46:29 +0000 (16:46 -0600)]
Re-enable lazy translation
This patch re-enables lazy translation to enable REST API
responses to be translated to the requested locale (I.E. setting
'Accept-Language: zh-CN'.)
This patch also removes the unnecessary manual import of
'cinder.openstack.common.gettextutils _' in Cinder code. Since _ is
still being imported in the cinder.openstack.common files from Oslo
we still need to set gettexttutils.enable_lazy(). enable_lazy will
be able to be removed once the manual imports of _ have been removed
from Oslo.
Jay S. Bryant [Mon, 24 Feb 2014 01:51:41 +0000 (19:51 -0600)]
Sync latest Oslo config code for i18n
This sync pulls the latest Oslo config code over
to Cinder. This sync is needed to include a fix
to config generator which is needed as part of
the work to enabled i18n messages. Config generator
was failing when lazy message translation was enabled.
The following changes are included with this patch. Each
patch includes the file(s) the patch touches:
-> c178e56 Add basic Python 3 tests
--> cinder/openstack/common/__init__.py
-> 12bcdb7 Remove vim header
--> cinder/openstack/common/__init__.py
-> 547ab34 Fix Copyright Headers - Rename LLC to Foundation
--> cinder/openstack/common/__init__.py
-> 44b6ea3 Import oslo.config configuration file generator
--> cinder/openstack/common/config/__init__.py
-> dd9aa2b Remove unused variables
--> cinder/openstack/common/config/generator.py
-> 5dce17b Use entry points to discover options in libraries
--> tools/config/generate_sample.sh
--> cinder/openstack/common/config/generator.py
-> e8e636c generator: add an EXTRA_LIBRARIES env variable
--> cinder/openstack/common/config/generator.py
-> e3dddd7 generator: use EXTRA_* env vars in the bash script
--> tools/config/generate_sample.sh
--> cinder/openstack/common/config/generator.py
-> 6da13e8 generator: rename EXTRA_MODULES_FILE to RC_FILE
--> tools/config/generate_sample.sh
-> 763eedf Fix DictOpt support in config sample generator
--> cinder/openstack/common/config/generator.py
-> e839886 Config generator fails with lazy messages
--> cinder/openstack/common/config/generator.py
-> 343686b Add check_uptodate to tools/config
--> tools/config/check_uptodate.sh
Oslo version:
-> 0f24d82 Fix migration.db_version when no tables
-> Date: Sat, 22 Feb 2014 00:32:18 +0000
Jim Branen [Wed, 5 Mar 2014 00:38:41 +0000 (16:38 -0800)]
Fix HP LeftHand Performance issue with AO
Setting AdaptiveOptimization (AO) to ‘true’, the default value,
at volume create time significantly slows down the operation on
the LeftHand array. If at create time, AO is set to ‘true’, it
will result in an update operation following the create operation
to set this value. Therefore, it is best to not specify the value,
when ‘true’, and let it default to ‘true’.
Navneet Singh [Wed, 12 Feb 2014 21:02:08 +0000 (02:32 +0530)]
NetApp implementation for copy offload in clustered nfs driver
The Copy offload binary is a special RPC implemented in Ontap that
allows NFS clients to ask the server to copy data between
volumes in the same cluster efficiently. The special
binary will be developed by NetApp and distributed to its customers.
It will address two copy cases after efficient image clone failed.
First when image cache file is present in a different share than
the one holding volume. Second when glance is backed by nfs share
which is on the same cluster as nfs driver backend. Instead
of regular http download the copy offload workflow will be used to copy
image to share and volume. Resubmitting it as there was a problem
with build in previous submission.