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.

bug 1182015

Change-Id: Id80584e5d478c83de97735706994206e024f8bf6
(cherry picked from commit 5a8ead7d154bbbb60b3272044a86fddea7afd929)
NetApp server tunneling fix.

NetApp vserver/vfiler api tunneling in concurrent requests
can cause routing request to incorrect servers in race conditions.
This fixes the api and driver for the mentioned situations.

bug 1176759

Change-Id: Id283822e4d1553daed4e6d690ec36f2edfbcf2b4
(cherry picked from commit 837df1272d43bb1a38e12d1c32183071b8294d83)
Fix check for mount.nfs helper installation

This fixes the issue for checking the
existence of mount.nfs helper program
in installation directories during
driver set up.

Closes-Bug:#1212286

Change-Id: If2fa925614bd42295eae0f62ba948e14a89e1343
(cherry picked from commit efd82e0265efbbfa43ff7ebb7523790b81299882)
Fix chown fail for nfs file without necessary permission

chown failed in case of volumes on nfs export when the
permission is not granted on the storage system. Upload
volume only requires read access on the nfs file and hence
chown is not neccessary when current user has read permission.
Chown only executed when read is not granted to the user.

Conflicts:

	cinder/image/image_utils.py

Change-Id: Ifa8eff7e79c6e4f15a1feb7cabec8cae8a0b0a83
Closes-Bug:#1221205
(cherry picked from commit 1498958299ccb807f406e9d257848cb4259e49e4)
Bump stable/grizzly next version to 2013.1.4

Change-Id: I817767bcb618edf94363aa34dd0eb6ce897ce141
test_glance.py: Stub out _get_member_model as well.

glanceclient's v2 client needs to also have its _get_member_model()
stubbed out as well, to avoid attempts to reach 'fake_host' during
client instantiation.

Update: Only stub when _get_member_model() when required.

Fixes: bug #1185178.

Cherry picked from https://review.openstack.org/#/c/30795

Change-Id: Ida47b3039c2539103fa3394d1443c896d7a81135
Fix signature of _create_volume() in ThinLVMVolumeDriver

create_volume_from_snapshot will call _create_volume() with the
wrong parameters when using ThinLVMVolumeDriver.  It should be
compatible with LVMVolumeDriver's _create_volume() method.

Fixes bug: 1210853

Conflicts:
	cinder/volume/drivers/lvm.py

(cherry picked from commit 7323d8751538e06bb2dba106ba394bc6e29b8b84)
Change-Id: I18f7baf60601b3bcf01425b505a0579a826f072e
Dont crash service if sf cluster isnt available

Currently if the SolidFire driver is configured but the cluster
isn't available for some reason the ensure_export call will raise
an unhandled exception and crash the volume-service.

We should be able to handle things like loosing connectivity to
a single back-end without impacting the other volume-service
backends.

We'll wrap the ensure_export call in a try block here and
return None in the case that the connection can't be made.
This will keep the service from crashing and log an error
message that the connection timed out.

Additional work would include adding a periodic retry task
to the manager to try and start the backend service for us
on some regular interval incase the device comes back.

Fixes: bug 1215064

Change-Id: Ice3f517d220c40113074bb77adbb10d5e32abd0b
(cherry picked from commit e13b7d8a46cd54e61bdc20500ad597c2545ffaed)
Ensure that qpid connection is closed (from oslo)

This is commit a9bc62814d in oslo-incubator

Fixes bug 1172922

When reestablishing a session and a connection already exists the
existing connection will be closed prior to opening the new one.

Change-Id: I9a25800fe4b56eba89d550e3461ce095bf902f0a
Clone volume with right size with SolidFire

It is possible to clone a volume with a size greater than
the source volume. When using the SolidFire driver, the volume size
was not passed in the call made to the SolidFire API when
cloning a volume.

It resulted in a cloned volume having the same size as the source
volume but the correct size in the Cinder database.

This changes makes sure the cloned volume has the correct size
by explicitly passing the requested size when calling
the SolidFire API and cloning the volume.

Fixes: bug #1219105
Change-Id: I5628c7fa922780d6b0601e2daa79310a61085edc
(cherry picked from commit 0a87ff988cd21586daeb6ed886e44aedaa49c320)
Do not reschedule if copy_image_to_volume fails

Catch any exception raised by copy_image_to_volume and wrap them
in ImageCopyFailure. Raising ImageCopyFailure will prevent
the volume from being rescheduled.

Fixes: bug #1224211
Change-Id: I1366f86927813cadefe742769eb7cff27ed41b7e
Fix volume_glance_metadata deletion (backport)

Backport patch https://review.openstack.org/#/c/41768/ and
its dependency: https://review.openstack.org/#/c/41601/
(no snapshot handling exception, for this is not trivial
due to specific havana changes)

If volume_glance_metadata does not exist for a certain volume,
it returns an exception and does not delete volume from db.
Avoid deleting it if it does not exist.

Fixes bug: 1209367

Change-Id: Icb34c90b13aac1e92b4645c3016127a2d4b8af6f
Merge "Ensure that qpid connection is closed (from oslo)" into stable/grizzly
Call to_primitive on volumes.rpcapi.create_volume

cinder.volume.rpcapi.create_volume does not convert the request_spec to
primitive before casting the request. This makes requests containing non
primitive types to fail. For example:

cinder create --metadata=Type=test --source-volid $VOLID 1

This will create a new database record and call create_volume on
volume.rpcapi.  This will fail because VolumeMetadata won't be
serialized correctly when calling cast. This, however, is not True when
--source-volid is not passed because in such case,
scheduler.rpcpai.create_volume will be called, which converts
request_spec to primitive correctly.

Closes-Bug 1213964

Conflicts:
	cinder/volume/rpcapi.py

(cherry-picked: 587eb5a6b9acc9f02eee1147dbaafb3782c295d5)

Change-Id: I4b91687cc1e5c933bdb3b04d8560b0500da26541
Fix secure delete for thick LVM snapshots

This change modifies the behaviour of the secure delete for thick
LVM snapshots to wipe the underlying COW of the snapshot LV
instead of the snapshot LV itself.

This change is necessary because the snapshot LV does not contain
exactly the same number of writable blocks as the original LV.  The
COW includes header information per COW block that identifies the
 device as a COW device as well as the source and destination blocks
for the changed item.  The amount of metadata contained in the COW is
variable based on I/O performed on the snapshot.

This does not change the behavior of secure deletes on thin LVs
or secure deletes on the thick LV snapshot origin.

Closes-Bug: #1191812
Change-Id: I308b554429ac981d709c19b78cdc00389a3f598a
Merge "Fix secure delete for thick LVM snapshots" into stable/grizzly
Remove old_name from kwargs when using IET helper.

The IET driver passes the input kwargs from export
directly to the IET driver, but one of the keys here
is specifically for migration and a bug associated with
going from nova-vol to cinder-uuid's.

This patch just checks in the IET code if we have the key set
and if so pops it out before passing through to iet.

Cherry picked: db991e6638533fb019fa5dcf59235d7302ae426e
Fixes bug: 1175207
Fixes bug: 1212206

Change-Id: I965bdfbe078d61b906aebc48961c1806a9fb0c59
Merge "Fix volume_glance_metadata deletion (backport)" into stable/grizzly
Allow display_name for v2 snapshot-update

According to the comment in the source code, the snapshot-update of
v2 would be able to allow either "name" or "display_name" parameter.
And if both paramters are specified, "name" parameter is effective
over "display_name" like "description" parameter.
However "display_name" parameter is ignored now, because cinder writes
over empty dict(update_dict['display_name']).

This patch fixes the problem.

Fixes bug #1226398

Change-Id: Icd48556a26b9346f73b7c1b82ffbcdd469c4d28d
(cherry picked from commit 622f10e87fda5dc439d43543216d953920079282)
Pop out 'offset' and 'limit' before use for filter

In previous code of _items() from api/v{1,2}/snapshots.py,
and also the _items)_ from api/v1/volume.py.we didn't pop
out the 'offset' and 'limit' fields from HTTP get params
before we use such params for filter.This is the root cause
for bug #1205956

For non-admin user, since 'offset' and 'limit' is not in the
allowed_search_options, so the volumes.remove_invalid_options
will help to filter them out. As a result, it walks around this
bug.

But for admin user,the volumes.remove_invalid_options will not
try to filter the search_options.So for admin user, the 'limit'
will appear in search_options, then obviously get no result.

fixed bug #1205956

Change-Id: Ib1a66c9d104ac52d6eae18be7f06d02985d4c2fd
(cherry picked from commit 08af981ffc104d7cb836c1b674e1d73724eeaf88)