Adopt the nova idiom of internal exceptions mapped to their
corresponding HTTP reponse code in the FaultWrapper middleware,
and also inclusion of their detail message if declared safe for
external exposure.
Josh Durgin [Tue, 14 Aug 2012 19:26:19 +0000 (12:26 -0700)]
add get_location method for images
This is useful for determining whether the backend storage for the
image in Glance is the same as the storage used in a volume driver.
The direct_url is only available in the v2 images API, so add a
version parameter to each request. As more parts of the v2 API are
used, this parameter will become more useful.
Josh Durgin [Mon, 13 Aug 2012 22:13:06 +0000 (15:13 -0700)]
rbd: implement create_volume_from_snapshot
In an upcoming release, rbd will support creating volumes from
snapshots ('cloning'). To clone a snapshot, it must first be
'protected', which means it cannot be deleted until it is unprotected.
A snapshot can only be unprotected if no clones depend on it. Thus,
translate a failure to unprotect into a SnapshotIsBusy exception.
Also check for remaining snapshots before deleting a volume,
and raise VolumeIsBusy if any exist. While we're here, tidy up
the shell arguments to be more readable.
This is backwards compatible since it does not use the new features
unless they are available in the installed version of rbd.
Josh Durgin [Mon, 13 Aug 2012 17:42:27 +0000 (10:42 -0700)]
Fix check_for_export() in non-exporting drivers
This overrides the default check_for_export so that drivers that don't
need to export block devices on the host like Sheepdog and RBD don't
raise a NotImplemented exception when this is called.
Reported-by: Mark Moseley <moseleymark@gmail.com> Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Change-Id: Icf72f51904e7bdc368bfaf0a91dd0433ce3b1cf6
Avishay Traeger [Sun, 12 Aug 2012 11:55:04 +0000 (14:55 +0300)]
Driver for IBM XIV storage.
Volume driver for IBM XIV storage systems, along with unit tests. The
driver imports the xiv_openstack_box class, which is a closed-source
proxy available separately to IBM XIV customers.
Avishay Traeger [Sun, 12 Aug 2012 08:31:26 +0000 (11:31 +0300)]
storwize-svc: improved test coverage and fixes.
Added test cases to cover more error paths, now providing 97% test
coverage of the storwize-svc driver. Some tests uncovered bugs in the
driver, which are fixed by this patch. In addition, there are some
fixes to the code included which address comments from the submission
of this driver to nova-volume and sync the two versions.
Dan Prince [Tue, 7 Aug 2012 20:25:52 +0000 (16:25 -0400)]
Create unique volumes_dir for testing.
Updates test_volume.py so that we create a uniq volumes_dir for testing.
This avoids polluting the source tree with fake volume UUID's when running
tests.
There are two availability_zone related config options now:
node_availability_zone and storage_availability_zone
While volume API uses node_availability_zone, the scheduler uses
the other, which causes failure in scheduler when these two options
have different values.
This patch removes 'node_availability_zone' so that end user
can specify 'availability zone' when create volumes using
Simple scheduler.
Ronen Kat [Mon, 6 Aug 2012 07:11:10 +0000 (10:11 +0300)]
Use volume driver specific execeptions.
Change generic use of exception.Error in the cinder/volume directory
to specific exceptions. The exceptions used in this patch are:
exception.VolumeBackendAPIException
exception.InvalidInput
exception.InvalidVolume
exceptio.VolumeAtatched
Patch includes updates to the appropriate tests as well.
jakedahn [Sun, 5 Aug 2012 21:32:07 +0000 (14:32 -0700)]
Admin users should be restricted from seeing all
snapshots by default.
* Now to view all snapshots across all tenants you need
to include the all_tenants=1 GET param in your api request.
* Fixes remaining issues blocking bug #967882
- Update openstack.common.log to use it (and fixes #1030078 for cinder as
well so we can get review I9d4251b4292188c0174ebac1dcd98318df44c0e3
working).
- Don't use openstack.common.context but our own just yet.
Admin users should be restricted from seeing all
volumes by default.
* Now to view all volumes across all tenants you need
to include the all_tenants=1 GET param in your api request.
* Fixes remaining issues blocking bug #967882
Thierry Carrez [Fri, 3 Aug 2012 13:35:03 +0000 (15:35 +0200)]
Deprecate root_helper in favor of rootwrap_config
Align with recent changes in nova-rootwrap by marking the
root_helper option deprecated and introduce usage of the
rootwrap_config option instead. The root_helper option will still
fully be supported in Folsom, but will be removed in Grizzly.
Transition notes: you should replace:
root_helper=sudo cinder-rootwrap /etc/cinder/rootwrap.conf
Send 'create volume from snapshot' to the proper host
A simple solution for bug 1008866. When creating volume from snapshot on
multicluster, in volume it will check if snapshot_id is set. If snapshot_id
is set, make the call create volume directly to the volume host where the
snapshot resides instead of passing it through the scheduler. So snapshot can
be copy to new volume.
Chuck Short [Fri, 27 Jul 2012 17:05:55 +0000 (12:05 -0500)]
Add persistent volumes for tgtd.
Currently if you restart the server running nova-volume
or restart tgt, you will loose your iscsi targets that
have been created. This is not good.
In order for iscsi targets to be persistent across
reboots or restarts, one has to have the target's configuration
information in /etc/tgt/targets.conf or /etc/tgt/conf.d.
So when tgtd is restarted then the iscsi targets will be there
as expected.
This patch will add a configuration file to $state_path/volumes
when the volume is created. The configuration file is identified by
the volume uuid. It creates a logicalunit when the volume is created
as well. The iscsi target and configuration file
will be removed once the volume has been removed as well.
In order to use this, you have to include the following in
your /etc/tgt/targets.conf
include $state_path/volumes/*
For upgrades, it will just re-create the volumes
already in the volumes table.
Volume driver for IBM Storwize and SVC storage systems, along with unit
tests and updated sample config file. The unit tests include a
Storwize/SVC management simulator to allow for testing without
controller hardware. Also added a new exception for volume drivers.
The symptom of this bug is that the response data of an
OSAPI create call always shows and empty dict for volume_metadata
regardless of what was passed in to created and actually used.
Upon the db create_volume call a reference to the volume
object is all that was being returned. Since metadata is
specified and set, it should also be returned with the
create reference object.
This will result in the the osapi create call returning
a body with correct metdata info rather than always showing
and empty dict as it was previously.
Port recent nova-rootwrap changes to cinder-rootwrap, including:
* Move filter definition from Python module to configuration files
* Fix tests execution on Fedora (bug 1027814)
* Remove executable bit on cinder/rootwrap files
This certainly needs a matching change to devstack to pass gating.
Pep8 test reports issue on openstack-common modules, which would
fail CI test. Pep8 test should skip openstack-common and assuming
they are problem-free code. Even it's not, bug/fix should go to
openstack-common first, then resync back to Cinder. Therefore,
Cinder should skip pep8 test for openstack-common code.
Russell Bryant [Tue, 1 May 2012 21:31:26 +0000 (17:31 -0400)]
Use save_and_reraise_exception() from common.
This patch common.excutils from openstack-common, which includes
save_and_reraise_exception(). The patch also converts the code
base to use it from there instead of cinder.utils and then removes
it from cinder.utils.
The initial motivation for this was removing another cinder dependency
from cinder.rpc so that it can eventually be moved to openstack-common.
Russell Bryant [Fri, 1 Jun 2012 18:42:32 +0000 (14:42 -0400)]
Use openstack.common.cfg.CONF.
Part of blueprint common-rpc.
This patch makes the rpc code use the global config object from
openstack-common. Based on some recent discussions on the mailing list,
this may not be the final way configuration handling is done here, but
it is certainly better than the register_opts() hack that is removed by
this patch.
Russell Bryant [Sun, 27 May 2012 00:42:09 +0000 (20:42 -0400)]
Remove cinder.log usage from cinder.rpc.
Part of blueprint common-rpc.
This patch removes the usage of cinder.log from cinder.rpc. This is
necessary before cinder.rpc can be moved to openstack-common. The rpc
logging was not using any of the extra features provided in cinder.log as
far as I can tell, so the changes are very simple.
This is the final dependency. After this change, the rpc code
can be moved to openstack-common without any changes.
Russell Bryant [Wed, 16 May 2012 20:40:05 +0000 (16:40 -0400)]
Add version to scheduler rpc API.
Part of blueprint versioned-rpc-apis.
One side effect of this change was that cinder.scheduler.api was removed
in favor of cinder.scheduler.rpcapi. In this case, the api was just a
direct wrapper around rpc usage. For other APIs, I've been following
the pattern that the rpcapi module provides the rpc client wrapper, and
if any other client-side logic is needed, that's where an api module is
used.
This change pulls in the latest version of the cfg module from
openstack-common includes some formatting changes, spelling fixes,
support for bol/eol spaces in values and support for deprecated
options.
Russell Bryant [Tue, 17 Jul 2012 04:10:29 +0000 (05:10 +0100)]
Make use of openstack.common.jsonutils.
This patch imports jsonutils from openstack-common. It removes the
equivalent code from cinder.utils and then converts the code base to use
jsonutils. The primary motivator for this change was to remove the rest
of the dependencies from cinder.rpc on cinder.utils.
- Alphabetize imports in openstack/common/cfg.py
- make reset() clear defaults and overrides
- automatically create option groups
- allow options to be marked as required
- use a list comprehension instead of map()
Change-Id: Ie17fe855a75b5021b031902aa86031d8ddc06dfd
Reviewed-on: https://review.openstack.org/9867
Approved: James E. Blair <corvus@inaugust.com> Reviewed-by: James E. Blair <corvus@inaugust.com> Tested-by: James E. Blair <corvus@inaugust.com>
Johannes Erdfelt pointed out that impl_qpid wasn't acking messages that
it received. This turned out to be a nasty oversight, resulting in
unbounded message queue growth inside of the python-qpid library. This
fixes it.
Russell Bryant [Tue, 29 May 2012 20:35:35 +0000 (16:35 -0400)]
Move queue_get_for() from db to rpc.
Part of blueprint common-rpc.
The function queue_get_for() is a utility function used by various
consumers of the rpc API. This function lived in the db API, but never
ended up using anything from the database. This patch moves it into the
rpc API so that it can be used by other users of rpc once it moves into
openstack-common.
Russell Bryant [Mon, 7 May 2012 18:10:29 +0000 (14:10 -0400)]
Add base support for rpc API versioning.
Part of blueprint versioned-rpc-apis.
This commit includes the base support for versioned RPC APIs. It
introduces the RpcProxy and RpcDispatcher classes that have common code
for handling versioning on the client and server sides, respectively.
RPC APIs will be converted one at a time using this infrastructure.
Russell Bryant [Wed, 2 May 2012 16:14:56 +0000 (12:14 -0400)]
Make kombu support optional for running unit tests.
Fix bug 838386.
Previously, the unit tests required kombu to be installed to run. This
patch makes it so the unit tests will still complete successfully, even
if kombu is not installed.
Russell Bryant [Tue, 15 May 2012 18:43:18 +0000 (14:43 -0400)]
Stop using cinder.exception from cinder.rpc.
This patch is a part of continuing to remove dependencies from cinder.rpc
on the rest of cinder. One RPC related exception was defined in
cinder.exception, so that was moved to cinder.rpc.common where the rest of
them live. These exceptions were changed to no longer use CinderException
as their base. Instead, there is a new RPCException base.
One other change that should be reviewed closely is the removal of using
cinder.exception.wrap_exception() in cinder.rpc.amqp. As far as I can tell,
this didn't actually do anything since nothing was being passed in to
wrap_exception().
Mark McLoughlin [Mon, 16 Jul 2012 20:30:15 +0000 (21:30 +0100)]
Remove 'cinder-manage config convert'
This convers the old flagfile style config files into the the
new .ini style config files. Since Cinder is new and it's first
release will only support .ini style files there's no need for
such a command.