Dirk Mueller [Fri, 14 Jun 2013 21:37:11 +0000 (23:37 +0200)]
Run flake8 also on cinder/*/openstack
exclude=openstack also matches cinder/api/openstack,
which is however not merged from oslo-incubator.
Exclude=common instead, and explicitely include
cinder/common
Vincent Hou [Thu, 27 Jun 2013 07:43:00 +0000 (15:43 +0800)]
Save some more image attributes to volume_glance_metadata.
Current issue: When copying an image to a volume, attributes like size, disk_format, container_format,
checksum, min_disk and min_ram have not been copied so far. When booting a VM from a volume, we are
not able to check these atrributes without giving the image id. Furthermore, if the original
image is deleted, we will lose all the information.
This patch saves these attributes into volume_glance_metadata. We can still check these attributes
without giving the image id when booting a VM from a volume.
Kai Zhang [Thu, 27 Jun 2013 07:31:36 +0000 (00:31 -0700)]
Fix check_for_setup_error for sheepdog driver
Current implementation of check_for_setup_error() of sheepdog driver
cannot work correctly with the latest version of sheepdog cluster.
This patch fixes it and adds tests for both old and new version.
Marc Koderer [Wed, 19 Jun 2013 14:07:44 +0000 (16:07 +0200)]
Content-length missing in put_object
Radosgw returns a "411 Length Required" in case the content-length is not
specified. The parameter content_type is not set which leads to the problem
that content_length cannot be determined. Since the content length is already
computed in backup/services/swift it shouldn't be a problem to set this
parameter.
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.
Sergey Vilgelm [Mon, 24 Jun 2013 11:19:50 +0000 (15:19 +0400)]
Do not raise NEW exceptions
Raising NEW exception is bad practice, because we lose TraceBack.
So all places like:
except SomeException as e:
raise e
should be replaced by
except SomeException:
raise
If we are doing some other actions before reraising we should
store information about exception then do all actions and then
reraise it. This is caused by eventlet bug. It lost information
about exception if it switch threads.
Scott DAngelo [Tue, 25 Jun 2013 13:19:51 +0000 (13:19 +0000)]
cinder.[brick,db,image] Replace 'locals()'
Replace use of 'locals()' with explicit values.
Help bring source code into compliance with the
Cinder Style Commandments:
https://github.com/openstack/cinder/blob/master/HACKING.rst
This change covers all affected soruce in the
cinder brick, db, and image modules, i.e.
cinder/brick/*.py and subdirectories
cinder/db/*.py and subdirectories
cinder/image/*.py and subdirectories
Doug Hellmann [Wed, 19 Jun 2013 21:16:32 +0000 (17:16 -0400)]
Update kombu requirement
The minimum version of kombu in the requirements
list has been updated to ensure that compatible
kombu and msgpack libraries are used across all
projects. This update also requires a bump for
anyjson.
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.
Marc Koderer [Thu, 20 Jun 2013 15:20:30 +0000 (17:20 +0200)]
Add support for swift user/key authentication
By default the swift backup service uses keystone authentication to
communicate with the swift endpoint. This patch adds three optional
parameters to allow username/key authentication
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.
Xavier Queralt [Fri, 14 Jun 2013 13:18:23 +0000 (15:18 +0200)]
Raise an error if iSCSI is not supported
Since the compute nodes may not have iSCSI support, volume drivers
requiring it will raise an error if the connector's initiator attribute
is not set when initializing the connection.
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