John Griffith [Wed, 19 Jun 2013 05:22:48 +0000 (23:22 -0600)]
Replace glance_metadata check with bootable column.
This patch adds a column to indicate if a volume is bootable or not.
Cinder API V1 was using get.volume_glance_metadata to determine
if a volume was bootable for translate_view.
This is fine until you put a heavy load on the system and things
can fall apart, particularly the backref of the glance meta is no longer
available and the call blows up. Also this results in a bit of extra
unnecessary data being passed around with every create and get call.
This is especially an issue when creating hundreds or thousands of volumes.
Even better we can now reliably create thousands of volumes.
Haomai Wang [Mon, 24 Jun 2013 06:03:31 +0000 (14:03 +0800)]
Remove usage of locals() for formatting from cinder.tests.*
Using of locals() for formatting string is a nasty thing because:
1) It is not so clear as using explicit dicts
2) It could produce hidden errors during refactoring
3) Changing name of variable causes change in message
4) Creating a lot of unused variables
xiaoxi_chen [Thu, 20 Jun 2013 16:56:38 +0000 (00:56 +0800)]
Adds create_from_volume test cases
For tests.test_volumes,
added 3 test cases:
create_from_volume
create_from_volume_with_glance_metadata
create_from_volume_failed_on_cloning
refactored an internal api:
_create_volume_from_image
The reason not to test a non-exist volume as source_vol is
the uplayer(volume api) has already checked and ensured the
source_vol exists
Navneet Singh [Fri, 21 Jun 2013 13:16:36 +0000 (18:46 +0530)]
NetApp:iSCSI drivers reserved percent need to change to 0.
The iscsi drivers reserved percent is 100 as of now. This needs
to be changed to 0 for default values. It needs to be corrected
so that filter scheduler does not discard netapp backend.
Seif Lotfy [Fri, 21 Jun 2013 09:28:27 +0000 (09:28 +0000)]
Refactor the backup method of SwiftBackupService
Export functionalities of backup to 3 new methods:
prepare_backup backup_chunk and finalize_backup. The original
backup function calls those functions. This allows other
drivers to combine them in a different logic.
e.g for the RBDDriver
Navneet Singh [Fri, 17 May 2013 11:19:50 +0000 (04:19 -0700)]
NetApp unified driver implementation.
NetApp has growing number of multiple drivers depending on storage families
and technologies. NetApp unified driver simplifies configuration
and provides single entry point for all storage technologies/drivers.
It provides new mechanism to support multiple NetApp technologies
and block drivers related to them. Deprecated 7mode dfm and c mode
webservice based drivers.
John Griffith [Wed, 19 Jun 2013 23:33:59 +0000 (17:33 -0600)]
Modify check for volume-type-id to a get w/default
While implementing Fix for a previous bug to enable setting
volume type on a cloned volume and reading it's info we added
a vref['volume_type_id'], problem is that the _do_clone method
is shared for both clone and create from snapshot.
In the create from snapshot case however that key doesn't exist
in the vref (which is a snapshot object).
This change turns this into a key.get with a default return.
John Griffith [Tue, 18 Jun 2013 22:49:13 +0000 (16:49 -0600)]
Update attach status when instance id invalid.
In cinder.manager do_attach we have a check to make sure the
supplied instance id is a valid UUID which is great, but if it's
not we just raise and dump out, leaving the volume in an attaching
state.
We should update the status to error_attaching in this case and then
raise/return.
John Griffith [Tue, 4 Jun 2013 23:07:03 +0000 (17:07 -0600)]
Use common.processutils.execute
This patch replaces the cinder.utils.execute method
with a wrapper around openstack.common.processutils.execute.
With the wrapper I'm also converting the processutils exceptions
to maintain compatability with the existing exceptions that are
caught/raised in the code.
Haomai Wang [Sun, 16 Jun 2013 05:21:20 +0000 (13:21 +0800)]
Remove usage of locals() for formatting from cinder.volume.*
Using of locals() for formatting string is a nasty thing because:
1) It is not so clear as using explicit dicts
2) It could produce hidden errors during refactoring
3) Changing name of variable causes change in message
4) Creating a lot of unused variables
Jay S. Bryant [Fri, 14 Jun 2013 23:30:10 +0000 (18:30 -0500)]
Remove the 'migrate' option from cinder-manage
The 'migrate' option was only appropriate for use migrating
databases for volumes from Nova-Folsom-->Cinder-Folsom. The
code hasn't been tested since.
Given the above facts, this commit removes the migrate code from
cinder-manage. The man page for cinder-manage was already
updated to remove the option in a previous commit.
Michael Kerrin [Thu, 16 May 2013 08:10:27 +0000 (08:10 +0000)]
Fix up the test framework
When trying to test a bug the cinder test framework was
running all the tests when I just wanted one to run.
Instead of fixing this problem in nose I tried to move cinder to
testr. I copied a fair bit of code from nova to get this to work.
This way at least if some one makes an improvement to the nova
test framework cinder can improve here also.
Note that now all the tests a thread safe. Added a concurrency argument
to run_tests.sh that defaults to 1. You can specify your own level then
and take the risk of intermittent failures. Tell jenkins to use a
concurrency level of 1 to avoid failing gate jobs.
Note One of these tests is broken and I have disabled for now. There
is a bug for this here: https://bugs.launchpad.net/cinder/+bug/1173266
Note: cinder.api.openstack.FaultWrapper is deprecated and is causing
a circular import when I try and import cinder.tests.test_wsgi. This
is fixed by only importing the openstack.FaultWrapper during the
__init__ phase of the wsgi middleware.
Haomai Wang [Fri, 14 Jun 2013 07:11:29 +0000 (15:11 +0800)]
Remove usage of locals() for formatting from cinder.api.*
Using of locals() for formatting string is a nasty thing because:
1) It is not so clear as using explicit dicts
2) It could produce hidden errors during refactoring
3) Changing name of variable causes change in message
4) Creating a lot of unused variables
Viraj Hardikar [Wed, 12 Jun 2013 17:34:26 +0000 (10:34 -0700)]
Fixes 3PAR drivers terminate_connection issue.
3PAR drivers now default the third parameter when terminate_connection
is called after copying a volume to image. Fixes: bug #1190056
Change-Id: Icadacc9e083c6e97a919857d735ec16068d0f0c6
Jay Payne [Sun, 9 Jun 2013 15:20:12 +0000 (10:20 -0500)]
Added policy check for backup operations
This patch adds policy checks for operations in the backup extension
consisting of create, delete, restore, get and get_all. It also adds
policies into the policy.json files in the tests and etc directories.