Matthew Treinish [Wed, 13 Mar 2013 17:28:10 +0000 (13:28 -0400)]
Switch all uses of 422 response code to 400.
The 422 response is normally only for WebDAV, and these types of
errors should normally return a 400 code, HTTPBadRequest. This
commit goes through all the remaining 422 codes and changes them
to 400 responses.
The patch fixes issues when desassigning target to initiators
in the terminate_connection method. The method now takes
the right parameter coming from provider location.
zhangchao010 [Fri, 15 Mar 2013 15:14:39 +0000 (23:14 +0800)]
Use self.configuration to support the multi-backend case
Use self.configuration instead of using FLAGS directly to make
the driver work in a multi backend environment.
And remove three repeated lines:en = out.split('\r\n')
Kurt Martin [Fri, 15 Mar 2013 21:40:10 +0000 (14:40 -0700)]
Fix typo in persona valid values
The 3PAR drivers have a persona extra spec that has a valid
values with a typo in it. The value '11 - VMWare' should be
"11 - VMware', note the lower case 'w'.
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.
This fixes a problem with the 3par drivers where creating
a 3par host was failing but there was no message. The driver
would fail to find the host after the creation failed and the
log entry would show that the host didn't exist. The real
error was failing to create the host.
Avishay Traeger [Thu, 14 Mar 2013 11:44:19 +0000 (13:44 +0200)]
Fix ISCSIDriver rescan.
Cinder fails to rescan iSCSI targets after running copy_image_to_volume
or copy_volume_to_image with the generic iSCSI implementation, due to
a missing comma.
Avishay Traeger [Tue, 5 Mar 2013 09:23:01 +0000 (11:23 +0200)]
Storwize/SVC driver fix for multibackend scenario.
In order for the Filter scheduler to be used to it's full advantage
Cinder drivers need to move away from using FLAGS directly and switch
to appending their specific options to self.configuration.
zhangchao010 [Mon, 4 Mar 2013 16:07:41 +0000 (00:07 +0800)]
Fix bugs for Huawei driver
This fixes two bugs for Huawei iscsi driver.
(1)If firstly we map LUN 1(just not LUN 0) to host,we can also
find LUN 0 mapped,whose device path is '-'.Then we will failed
to map a real LUN 0.So,we avoid mapping LUN 0 to host by setting
every volume's host LUN ID larger than 0,instead of generating it
automatically.
(2)Check valid size of resource pools when creating snapshot and
make sure it larger than 1 GB.
Avishay Traeger [Thu, 7 Mar 2013 17:18:54 +0000 (19:18 +0200)]
Do not use prefix to lookup host in Storwize/SVC.
Currently, the Storwize/SVC driver creates a host name prefix for host
objects on the back-end, and uses that to look up hosts. However, if a
host was already created with a different name (for example, manually
by an admin), the host creation operation will fail, as a host with
that connection information already exists. Instead, we look up a host
based on available connection information.
Michael J Fork [Fri, 8 Mar 2013 05:59:23 +0000 (05:59 +0000)]
Update oslo rpc libraries
Update oslo rpc libraries to capture changes, primarly motivated
by secret=True flag on password config options. Skipping broken,
invalid test case while working on correct fix.
This patch fixes a few issues with the LH driver.
1) attach wasn't working because there was no host
created.
2) get_volume_stats didn't exist.
3) fixed the unit tests to work with the new config
access.
Dan Prince [Thu, 7 Mar 2013 18:07:56 +0000 (13:07 -0500)]
Update tox.ini to support RHEL 6.x.
In order to support running unit tests on RHEL 6.x we need to patch
eventlet with contrib/redhat-eventlet.patch. We already
have support for this in the tools/install_venv_common.py but we
need to make a couple changes to allow tox to consume this:
1) Sync in the latest intall_venv_common.py from oslo. This changes
patch to use the -N option (ignore already applied patches) and
makes it safe to call the patching function more than once.
2) Add a new patch_tox_venv.py script in tools.
3) Update tox.ini to call patch_tox_venv.py before it runs tests and
coverage.
NOTE: This will hopefully go away eventually once this patch lands:
Zhiteng Huang [Fri, 8 Mar 2013 08:54:03 +0000 (16:54 +0800)]
Pull newly merged Olso update for 'is' operator
A recent update to common/scheduler/filters/extra_specs_ops.py in
Oslo added new 'is' operator to allow Boolean check. The original
commit message was:
"Boolean values for capabilities don't work because extra_specs are
all converted to unicode. The scheduler will then check, for example,
if the boolean 'True' is equal to the unicode string 'True', and will
always return False. This patch allows admins to specify '<is> True'
in extra_specs, which will compare successfully to boolean True."
Notice extra_specs_ops now relies on strutils from Olso, so this
change pull strutils from Oslo as well.
Monty Taylor [Mon, 11 Feb 2013 19:57:27 +0000 (13:57 -0600)]
Use nose and openstack nose plugin.
It's a little silly since we're working on removing nose for testr,
but it turns out that the old test run wrapper was in use here, which was
causing all sorts of havoc.
The 3PAR drivers weren't updated when the multi backend
patch landed on G3 day. This patch implements the new config
mechanism to accessing FLAGS, so that it works when an admin
has multiple drivers active.
Xing Yang [Sun, 3 Mar 2013 05:06:29 +0000 (00:06 -0500)]
Fixed copy image to volume and clone volume.
This patch fixed the following issues in EMC driver found during G3 testing:
1. VNX array has two storage processors and it is doing load balancing when
attaching a LUN to a host. The storage processor used to attach a LUN to a
host is different from the one discovered by the driver sometimes, causing
Copy Image to Volume to fail.
2. The clone relationship is removed after a volume is successfully
cloned. However, this happens too soon sometimes before the cloned volume
is fully synced with the source volume. The fix is to wait until it is
fully synced.
Fei Long Wang [Sun, 3 Mar 2013 08:48:22 +0000 (16:48 +0800)]
Fixes issues found in /os-hosts API
There are some issues found in Cinder /os-hosts API:
1) Bracket in the wrong spot in Cinder HostController show method
There is an erroneous bracket on the following line in the show method
that should be at the end of the response:
'total_volume_gb': str(sum)},
2) XML Attributes Missing for List/Index method in Cinder HostController
The HostIndexTemplate class specifies mapping for "host" and "topic"
attributes rather than any of the ones that are actually returned from
the index method.
3) XML Serialization is commented for Cinder HostController show method
Avishay Traeger [Tue, 5 Mar 2013 08:00:11 +0000 (10:00 +0200)]
Fix Storwize/SVC storage_protocol reporting.
The Storwize/SVC driver supports both FC and iSCSI protocols
simultaneously. Therefore, 'storage_protocol' should be defined as a
list of enabled protocols, not simply 'iSCSI'. The extra_specs
key-value would then be, for example, storage_protocol='<in> iSCSI'
or storage_protocol='<in> FC'.
Stephen Mulcahy [Mon, 4 Mar 2013 16:10:34 +0000 (16:10 +0000)]
swift backup service checks version during restore
Modified swift backup service to check metadata version during restore
and raise an error if the backup version isn't a version that the
service knows how to handle. The versions which can be handled are
described in a dictionary mapping versions to methods which can handle
them. This will facilitate graceful handling of newer backup formats by
the swift backup service when we introduce changes.
John Griffith [Thu, 28 Feb 2013 18:34:07 +0000 (18:34 +0000)]
Add some useful log to filter scheduler.
When the filter scheduler is unable to find a suitable host to
deploy a volume on it simply logged a warning "not hosts found".
This isn't very helpful, so this patch adds some logging info as
far as why no valid host was available. This just focuses on the
capacity filtering as that's where I've commonly seen this issue
particularly in tempest runs.
Also noticed that the get status was checking for "if Not capacity",
but this is wrong because free capacity==0 would be interpretted as
failing to get capacity. Change this to "if is None".
John Griffith [Thu, 28 Feb 2013 19:01:39 +0000 (19:01 +0000)]
Elevate context for delete volume with no host.
So in the case of a volume that is placed in error state
on create and never actually deployed, the cinder.volume.api delete
call does a short cut call to db.destroy_volume which is fine because
all we have is a DB entry (scheduler never deployed the volume).
Unfortunately, this requires admin context, so just add an elevate
context to the db.destroy_volume call.
Stephen Mulcahy [Thu, 28 Feb 2013 12:11:39 +0000 (12:11 +0000)]
Improved fail_reason for cinder-backup swift connection errors
Modified swift backup service to catch socket errors when talking to
swift and raise a specific SwiftConnectionFailed exception in these
cases. This allows us to provide a more readable error message
detailing the problem connecting to swift to the end user when they
view the backup. Also reduced the default number of swift retries
so devstack environments fail faster - production environments can
tune these in cinder.conf.
john-griffith [Fri, 22 Feb 2013 05:06:26 +0000 (22:06 -0700)]
Convert from using FLAGS directly in SF driver.
In order for the Filter scheduler to be used to it's
full advantage Cinder drivers need to move away from
using FLAGS directly and switch to appending their
specific options to self.configuration.
John Griffith [Wed, 27 Feb 2013 20:49:53 +0000 (20:49 +0000)]
Improve logging for volume operations via manager
A large percentage of the logging information was
being done using debug. This change moves some
of the logging information to be info level and
also tries to add some consistency in terms of
the general create/delete operations.
This includes moving logging for the basic operations
into the manager and omitting the repetive messages from
the drivers.
Stephen Mulcahy [Wed, 27 Feb 2013 09:15:57 +0000 (09:15 +0000)]
Changed to INFO level logging for main cinder-backup operations
Changed create backup, restore backup and delete backup operations to
log key operations at INFO level instead of DEBUG level (so environments
like devstack see main operations by default).
Rushi Agrawal [Tue, 26 Feb 2013 12:15:57 +0000 (17:45 +0530)]
NetApp: Clean up lock file left behind by unit tests
The synchronization decorator added to the NetAppISCSIDriver class
creates a lock file named cinder/openstack/cinder-netapp_dfm
during the unit tests. This commit cleans it up.
Rushi Agrawal [Wed, 27 Feb 2013 11:37:41 +0000 (06:37 -0500)]
NetApp: Fix race condition in 7-mode iSCSI driver with DFM.
A race condition was discovered in the driver while creating
or deleting multiple volumes in a very short interval of time
(can be reproduced by making successive API calls to Cinder).
This fix decorates the methods responsible for race condition
with a synchronized() decorator. The problem was with the
management software: DFM, and in principle, there should not
be two processes trying to modify the DFM dataset object at
the same time. This patch prevents from such a possibility.
copy_volume_to_image was always using the glance plugin to do the
upload, and was ignoring the users request. Thus the image was always
uploaded as vhd/ovf. This patch is using the image utils to fix the
generic case.
Stephen Mulcahy [Thu, 21 Feb 2013 11:10:34 +0000 (11:10 +0000)]
Fixed cinder-backup start errors seen with devstack
Changes:
- Added cinder-backup to scripts in setup.py
- Added service_name to backup manager __init__
- Switched backup manager to using oslo.config
- Modified cinder-backup to use ProcessLauncher
Tom Fifield [Thu, 21 Feb 2013 10:10:16 +0000 (21:10 +1100)]
Cinder devref doc cleanups
Way back when Cinder was inagurated as a separate project, the docs
directory from Nova was used as a seed for the one in the Cinder repo
This patch is simply cleaning out images and files which have no
relation to Cinder at all, and are at best extremely outdated when
applied to Nova.
Aside from the deletions which are mainly images, and files related
to the configuration of CloudPipe, there is one modification to
conf.py which simply removes a reference to a vmware doc that no
longer exists.