Don't see any reason to construct a list for request_spec['volume_id'].
And it indeed causes problems when the scheduler receives a reschedule
request with such a request_spec.
Stephen Mulcahy [Thu, 4 Apr 2013 16:10:16 +0000 (16:10 +0000)]
Allow deletion of backups where the service is None
If a backup is created while both cinder-backup and rabbitmq
are not running, backup records are created in the database with a
service entry of None.
There is no actual backup data created on the service, since the service
isn't running. This fix allows removal of these records without an error
when a delete backup request is received.
This fix also ensures backup status is set to error in the event of
an exception during a delete.
zhangchao010 [Tue, 26 Mar 2013 14:10:19 +0000 (22:10 +0800)]
Change format of some judgments
Because "not volume" will be True if volume id is 0.It can not
distinguish 0 from None.The same to some other judgments where
variable value may be 0.
This patch also does the following changes:
Deletes check storagepool in function _check_conf_file and adds
check default iscsi target IP in function initialize_connection.
Moves create host group from do_setup to initialize_connection.
Changes _get_login_info to be _update_login_info.
Removing this enables use with sqlalchemy 0.8.0
The deprecation is described upstream at:
http://docs.sqlalchemy.org/en/latest/changelog/changelog_08.html#change-ad44af79c886d1bb283042deb64f9cbe
Larry Matter [Thu, 28 Mar 2013 23:29:38 +0000 (16:29 -0700)]
REST session validity not checked in get_volume_info
The fix for bug 1157242 introduced a new bug in Coraid cinder driver
_get_volume_info that the login session is not checked for
validity/timeout. This change addressesthat issue for all
methods in the CoraidRESTClient class.
Cory Stone [Mon, 25 Mar 2013 20:09:37 +0000 (15:09 -0500)]
Add the volume and snapshot gigabytes together.
The quota sync functions were not working correctly for both
snapshots and volumes regarding gigabytes. Each would report
their own count as the total gigabytes.
Now the gigabytes sync is separate from the volume and snapshot
count syncs.
John Griffith [Sun, 24 Mar 2013 20:49:46 +0000 (20:49 +0000)]
Fixed shared gigabytes quota resource.
The shared gigabytes resource between volumes and snapshots wasn't
working properly. The issue was that on update/sync the action item
(volumes or snapshots) would update the resource usages based only on
it's own particular item.
This patch fixes that, and makes the total gigabytes truly shared
between volumesa and snapshots.
Add support to the CoraidDriver to specify a subgroup (with admin
privileges).
Coraid storage orchestration allows you to allocate portions of your
SAN to specific users/groups.
The driver should support this and not assume logging in
as "admin" (equiv to "root").
Will add another parameter to cinder.conf, "coraid_group",
and if present, the driver will authenticate using the specified group
as well as the already available coraid_user parameter.
Yug Suo [Mon, 11 Mar 2013 08:30:07 +0000 (16:30 +0800)]
Fix quota updating when admin deletes common user's volume
Add 'project_id=None' optional argument in QUOTAS related methods.
There are two problems when admin deletes volumes of common user
before fixing this bug:
Firstly, It will get tenant quotas using context.project_id which
results in getting admin's quotas not common user's.
Secondly, It will also get wrong quota usages using context.project_id
when updating common user's quota_usages.
So we could pass into QUOTAS related methods an optional argument to
specify the tenant ID to be affected. And if it's not set, then we
default to drawing the tenant ID from the context.
john-griffith [Sat, 23 Mar 2013 00:01:02 +0000 (18:01 -0600)]
Last driver sync for Folsom and Grizzly
This is the last of the updates that I've been putting
off while trying to handle the core items in Cinder.
This change fixes the ctxt ordering error in volume_types
and also fixes and also changes the internal SolidFire
metadata storage to a single dict instead of a dict of dicts.
This patch exposes a more acurate exception message
when a user has created a manual host entry on a
3PAR system that is in an incorrect 3PAR domain than
the domain that is configured for the 3PAR driver.
The bug complained that it couldn't find a VLUN, when the
actual problem was the host existed in the wrong 3PAR domain.
john-griffith [Thu, 21 Mar 2013 15:48:03 +0000 (09:48 -0600)]
Snapshot reservation sync calls wrong resource.
The snapshot reservations code isn't calling the
correct resource on sync (it's calling volumes). There's
also some problems with the logic being used on the delete/clean up
that are fixed here as well.
Xing Yang [Thu, 21 Mar 2013 04:36:03 +0000 (00:36 -0400)]
Fixed attach volume for EMC SMI-S iSCSI driver
This problem was encountered during Grizzly RC1 testing. The driver
didn't find the correct target IQN. As a result, Nova couldn't find
the matching path in /dev/disk/by-path and therefore detached the volume.
Avishay Traeger [Thu, 21 Mar 2013 13:08:04 +0000 (15:08 +0200)]
Clean up started volume services in tests.
The test_preattach_status_volume test was failing due to state left by
another test. The interim solution was to skip the aforementioned test.
I tracked down the problem to 4 tests in test_admin_actions.py that
call self.start_service('volume', host='test'), and don't stop the
service. Stopping it in all 4 tests solves the problem.
HOWEVER, I don't know why these started services caused this particular
test to fail. I am still working to figure that out, but maybe someone
has an idea.
In cinder/volume/drivers/coraid.py, _login method, if login is
unsuccessful, we try to get the message from an undefined
object "response". Instead we should be getting it from "reply".
Fei Long Wang [Thu, 14 Mar 2013 06:35:10 +0000 (14:35 +0800)]
Fixes Cinder REST API /volumes issue
Issue #1
Once GET variable 'offset' is specified, the API /volume will get an empty
output.
Issue #2
Should validate the GET variable 'limit' before query database to get a
consistent message with Cinder REST API v1.
By current implement, error message is as below if the variable 'limit'
is invalid:
--------------------------------------------------------------------------
{"computeFault": {"message": "The server has either erred or is incapable
of performing the requested operation.", "code": 500}}
After this change, the new message is as below:
--------------------------------------------------------------------------
{"badRequest": {"message": "limit param must be an integer", "code": 400}}
Update Cinder's latest copy of OSLO grizzly stable
This patch updates all the files from oslo under
stable/grizzly but policy.py. policy.py is a high risk
change at this date and it has lots of changes since the
last time we updated it.
john-griffith [Wed, 20 Mar 2013 18:24:36 +0000 (12:24 -0600)]
Speedup solidfire unit tests
The SolidFire driver has a sleep that's used in a retry loop. This
sleep was being called every iteration of the loop though
(instead of just when the call failed).
This made SolidFire the slowest test in the unit tests, and obviously
it's just stupid anyway. So this change fixes that and only performs
the sleep if the call actually failed.
Dan Prince [Tue, 19 Mar 2013 23:37:47 +0000 (19:37 -0400)]
Updates to OSAPI sizelimit middleware.
Updates the OSAPI sizelimit middleware so that we use avoid calling
len on a request body which could cause a really large request
to get buffered into memory.
Also updates the middleware to return HTTP 413 which is a more
correct error code in this case (previously it returned just 400).
Christoph Kassen [Tue, 19 Mar 2013 20:50:51 +0000 (21:50 +0100)]
Make dd block size user configurable
This patch introduces a new configuration option volume_dd_blocksize
to change the bs parameter passed to the dd command when creating or
deleting volumes. In certain scenarios changing the block size might
result in better performance.
The default value is still 1M, which was used before.
Michael Kerrin [Tue, 19 Mar 2013 18:04:39 +0000 (18:04 +0000)]
Add snapshots to the volume usage audit report
* Added tests for db api call volume_get_active_by_window called by the volume
usage audit report.
* Added new db api called snapshot_get_active_by_window & test it. This is
similar to the volume_get_active_by_window method but returns the snapshots
active the supplied time window.
* Integrate the above into the cinder-volume-usage-audit script to report on
all the active snapshots as well as volumes in the specified time frame.
Eric Harney [Mon, 18 Mar 2013 16:21:40 +0000 (12:21 -0400)]
Allow snapshot_delete for NFS/GlusterFS drivers
RemoteFsDriver should allow snapshot_delete, since snapshot_create
for NFS and GlusterFS volumes will create a snapshot in the error
state which cannot be deleted afterward.
snapshot_delete() should allow this to be removed rather than
throwing NotImplementedError.