Dan Prince [Fri, 7 Sep 2012 02:52:35 +0000 (22:52 -0400)]
Handle missing 'provider_location' in rm_export.
Updates the remove_export function in the ISCSIDriver so that
it handles the case where provider_location isn't set on
a volume. This can occur if a volume is created but not exported.
Dan Prince [Tue, 4 Sep 2012 02:11:59 +0000 (22:11 -0400)]
Remove dependencies for netaddr.
Updates cinder utils.py to remove the parse_server_string and
is_valid_cidr functions. These functions aren't in use
and are the only reason we need the netaddr dependency.
Updates pip-requires to drop the netaddr dependency.
Also removes the unit tests for removed functions.
Change-Id: I521ae60b758324069fb1ffa1701b1f9deb780f65
Mark McLoughlin [Wed, 5 Sep 2012 11:04:16 +0000 (12:04 +0100)]
Sync cfg changes from openstack-common
Syncs the following from stable/folsom:
4dc2043 cfg: clean up None value handling 513bd3a Allow set_default and set_override to use None 0a36c92 Tilde expansion for --config-file and --config-dir 038d597 Add import_opt() method to ConfigOpts
Clay Gerrard [Mon, 27 Aug 2012 07:48:32 +0000 (07:48 +0000)]
Add admin actions extension
The optional os-admin-actions extension adds new wsgi_actions to the
volumes/action resource and a new snapshots/action endpoint.
With this extension both controllers will support an os-reset_status
action to force a database update of a volume or snapshot that is stuck
in a failed/incorrect status. The os-reset_status action works
similarly to the compute api's os-reset_state action for instances.
The os-force_delete action behaves similarly to the "cinder-manage
volume delete" command and allows operators/admins to retry the delete
operation after it has gone into an error_deleting status with an admin
api call.
The os-admin-actions extension is enabled by default, but limited to the
admin api by the default policy.json rules. Individual admin actions
can be disabled with policy rules as well.
The new admin only api can assist deployers who encounter bugs or
operational issues that result in failed actions.
It can also be used by future storage backends to support async callback
style status updates from long running actions or operations which have
encountered an error will be retried.
Also updates the api.openstack.wsgi.ControllerMetaclass to support
sub-classing wsgi.Controllers that define wsgi_actions.
Dan Prince [Fri, 31 Aug 2012 13:56:50 +0000 (09:56 -0400)]
Add cinder- prefix to all binaries.
Renames clear_rabbit_queues and volume-usuage-audit binaries
so that they are prefixed with 'cinder-'.
As part of this change the clear_rabbit_queues binary was changed
to use dashes instead of underscores for consistency with the rest
of the cinder binaries.
Chuck Short [Tue, 28 Aug 2012 20:06:25 +0000 (15:06 -0500)]
Fix creation of iscsi targets
Previously when creating iscsi volumes, we were using
tgt-admin -e -c <config file> --update volume-id
Unfortunately the side affect of this is that tgt-admin
removed other volumes that weren't connected to an iscsi
connector. Which is obvlously not what we want.
In order to fix this we create the targets.conf for the
volume but we call tgt-admin --update icssi qualified name.
We're dropping the use of iscsi_targets table when using TgtAdm.
Compatability for other target admin types is maintained.
John Griffith [Thu, 16 Aug 2012 21:52:52 +0000 (15:52 -0600)]
Implement volume quota support in Cinder
parital fix for bug 1023311
* To use needs cinderclient https://review.openstack.org/#/c/11509/
* Updates quota classes with changes in Nova
* Adds needed quota related DB tables
* Updates test_quota to reflect changes in Nova
* Adds absolute limits and empty rate limit functions
* Updates test/integration/test_volume to make it work w/ above changes
When attach a volume , the volume status is "available -> attaching ->
in-use", But when detaching a volume , the volume status is "in-use ->
available". So We need 'detaching' volume status, it make the change of
state of the volume more clearly.
Rongze Zhu [Thu, 23 Aug 2012 03:00:08 +0000 (03:00 +0000)]
Typo fix in cinder: existant => existent
Impact:
* locale message in cinder/locale/*/LC_MESSAGES/nova.po
* locale message in cinder/locale/nova.po
* Test function names
* Test strings and comments
glanceclient can raise HTTPNotFound (as well as NotFound) it appears,
but glance image service is only converting NotFound ->
InstanceNotFound. Same applies to 'Forbidden' and other exceptions.
This patch converts 'exc_type is NotFound'-like checks to use
'isinstance' instead, which will cover HTTPNotFound, etc.
Also add missing glance/image tests that weren't in Cinder
Clark Boylan [Tue, 21 Aug 2012 21:08:57 +0000 (14:08 -0700)]
Add nosehtmloutput as a test dependency.
Adding nosehtmloutput as a test dependency allows nose to output its
results to an html file. This will be used by Jenkins to save logs
on a different server.
John Griffith [Tue, 21 Aug 2012 20:00:18 +0000 (14:00 -0600)]
Migrate volume related quota info in db migration
* Fixes bug 1039615
* Now that quotas are back we need to handle migration
of volume related quota data in the cinder-manage migrate helper
* Only resource types transferred are volumes and gigabytes
The listeners kwarg is deprecated in SQLAlchemy 0.7.0. Since 0.7.3 is
the minimum required version of SQLAlchemy, use the new event.listen()
API instead.
RongzeZhu [Fri, 17 Aug 2012 14:24:43 +0000 (22:24 +0800)]
Remove logging in volume tests
Fixes bug #932137
Usage of logging seems to be limited to the check_for_export() tests and
should be to cleanup. check_for_export() raises an exception if there's
a problem and it does nothing if it succeeds. The tests should just
check whether an exception was raised.
Cory Stone [Fri, 17 Aug 2012 14:18:52 +0000 (09:18 -0500)]
Call driver for attach/detach_volume.
The volume driver may want to know which guest is going to be
attached to a volume. The manager now calls down into the driver
on attach_volume and detach_volume.
Josh Durgin [Tue, 14 Aug 2012 19:27:48 +0000 (12:27 -0700)]
add ability to clone images
Given the backend location from Glance, drivers can determine
whether they can clone or otherwise efficiently create a volume
from the image without downloading all the data from Glance.
For now implement cloning for the RBD driver. There's already a
Glance backend that stores images as RBD snapshots, so they're
ready to be cloned into volumes. Fall back to copying all the
data if cloning is not possible.
John Griffith [Tue, 14 Aug 2012 00:35:35 +0000 (18:35 -0600)]
Update SolidFire volume driver
Implements blueprint update-solidfire-driver
* Updates driver to reflect changes in the release version of SF API
* Modify SF naming scheme
* Implement snapshot functionality
* Implement setting qos on create via metadata
* Update/Add tests
Thierry Carrez [Wed, 8 Aug 2012 15:49:44 +0000 (17:49 +0200)]
Add proper support for deprecation messages
Add support for warning once about deprecated options. Use that in
the rootwrap options deprecation message, and move it to run_as_root
so that the deprecated message is emitted once and only if used.
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