This patch adds the new brick initiator connector object
which contains the code to do volume attach and detach to a host
machine. It includes hooks to work in both cinder and nova.
Nova has different exec wrapper and it also needs to talk to a
hypervisor at certain points during detach.
This patch also pulls the copy/pasted code from nova in the base
ISCSIDriver's _attach_volume method to use this new brick library.
This patch also includes a fix in the ISCSIDriver's
copy_volume_to_image code that didn't actually detach a volume
when it was done with the operation.
Bug 1194962
This patch also includes a fix for iSCSI detaches where the
iSCSI LUN wasn't being removed from the system until the very
last detach issues an iscsiadm logout.
Bug 1112483
This patch includes a fix for iSCSI multipath detaches where
the multipath device and the iSCSI LUNs for the multipath device
were never removed from the kernel.
Bug 1112483
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.
Haomai Wang [Mon, 10 Jun 2013 15:20:26 +0000 (23:20 +0800)]
Add availability zone checking in the api service
This patch adds availability zone checking for api request period.
If the availability zone the request specified isn't exist in the
Cinder services, the response returned to the user will give an
error immediately.
Stephen Mulcahy [Fri, 7 Jun 2013 11:52:11 +0000 (11:52 +0000)]
Add missing attributes to xml deserializer for volume request
The v1 and v2 xml deserializers for volume requests are missing
support for the imageRef, snapshot_id and source_volid attributes
resulting in xml format create volume requests which specify any
of those attributes being silently ignored. This fix adds support
to v1 and v2 and extends the volumes unit tests to check for this.
Also includes some minor debug logging enhancements to make this
easier to find in future.
Svetlana Shturm [Mon, 10 Jun 2013 14:02:26 +0000 (15:02 +0100)]
Integrate oslo's periodic tasks.
Cinder use old style invocation of periodic tasks, which not based on oslo library.
It will be better to use main idea of periodic tasks for all services.
John Griffith [Mon, 10 Jun 2013 21:05:33 +0000 (15:05 -0600)]
Remove direct call to utils.execute.
The executes calls in the base driver class
are set up to use the exectue enginge passed in on
init. There are a couple of methods that call
utils.execute directly, and as a result you end
up not using the expected execute engine when
you pass in something other than default for these
two calls.
We'd like to get away from the local execute altogether
and use the OpenStack common version only, so fix these
in driver.py and put the appropriate wrapper around them.
John Griffith [Wed, 5 Jun 2013 19:57:29 +0000 (13:57 -0600)]
Add policy checking for transfer create/accept.
This patch adds policy checks for transfer create/accept
as well as adding the associated default policy. In addition
we add the wrap in the volume/api accept_transfer method.