Make dd block size user configurable

This patch introduces a new configuration option volume_dd_blocksize
to change the bs parameter passed to the dd command when creating or
deleting volumes. In certain scenarios changing the block size might
result in better performance.

The default value is still 1M, which was used before.

Change-Id: I0398436ab3ecca51f6121e8f521af8b2dc60acd3
Fixes: bug #1157417
Updates to OSAPI sizelimit middleware.

Updates the OSAPI sizelimit middleware so that we use avoid calling
len on a request body which could cause a really large request
to get buffered into memory.

Also updates the middleware to return HTTP 413 which is a more
correct error code in this case (previously it returned just 400).

Fixes LP Bug #1131857.

Change-Id: Iff6cb0c24bc21e5a1d5dd4cf29acb0b4ee221708
Fixes Cinder REST API /volumes issue

Issue #1
Once GET variable 'offset' is specified, the API /volume will get an empty
output.

Issue #2
Should validate the GET variable 'limit' before query database to get a
consistent message with Cinder REST API v1.
By current implement, error message is as below if the variable 'limit'
is invalid:
--------------------------------------------------------------------------
{"computeFault": {"message": "The server has either erred or is incapable
of performing the requested operation.", "code": 500}}

After this change, the new message is as below:
--------------------------------------------------------------------------
{"badRequest": {"message": "limit param must be an integer", "code": 400}}

Fixes Bug: 1154454

Change-Id: Ifb155477bae0ea3e39877737ee9019e7d8a104a7
CoraidDriver: typo in _login exception handler

In cinder/volume/drivers/coraid.py, _login method, if login is
unsuccessful, we try to get the message from an undefined
object "response". Instead we should be getting it from "reply".

- errmsg = response.get('message', '')
+ errmsg = reply.get('message', '')

Fixes bug 1157499

Change-Id: Ifd047ced6b40f49881e81d4e73189d9bd216c903
CoraidDriver: do not call login from __init__

We should not call _login from the driver's __init__.
If the ESM is down, the constructor will fail.

- self._login()

Fixes bug 1157500

Change-Id: Ie57fbb6d3704d270a81cd9eb056d7988989da1f8
Extend param2id() to work with uuids

Add uuid support to param2id() to allow commands including
cinder-manage volume delete to work with uuid style volumd ids

Fixes bug #1158409

Change-Id: I2d197320b61f44d1104ed0342a6b5b70f673468a
Fixed attach volume for EMC SMI-S iSCSI driver

This problem was encountered during Grizzly RC1 testing.  The driver
didn't find the correct target IQN.  As a result, Nova couldn't find
the matching path in /dev/disk/by-path and therefore detached the volume.

Change-Id: I8bcf6d9896b9d445f6376ecc3a5695be46507663
Fixes: bug #1157912
Merge "Updates to OSAPI sizelimit middleware."
Use the local configuration in the nfs drivers

Fixes bug 1158681

Change-Id: If797a5d3241d6129a8fefea1222b723f03f86452
Merge "Extend param2id() to work with uuids"
Merge "CoraidDriver: do not call login from __init__"
Merge "CoraidDriver: typo in _login exception handler"
Fetch volume_types by uuid and not by name in v2

This was left over from the UUID switch. Looking up volume_types by name
is deprecated in v1 and removed in v2.

Fixes: bug #1087817
Change-Id: I02cc035565f9496cd5af228c55ced5cafef2ad81
Snapshot reservation sync calls wrong resource.

The snapshot reservations code isn't calling the
correct resource on sync (it's calling volumes).  There's
also some problems with the logic being used on the delete/clean up
that are fixed here as well.

Fixes bug: 1157506
Fixes bug: 1157982

Change-Id: I91327b8043ab63aa35ea8a91b6de544bf5bf6c61
Merge "Fetch volume_types by uuid and not by name in v2"
Merge "Snapshot reservation sync calls wrong resource."
Merge "Fixed attach volume for EMC SMI-S iSCSI driver"
Fix bug with 3PAR host entry in wrong domain

This patch exposes a more acurate exception message
when a user has created a manual host entry on a
3PAR system that is in an incorrect 3PAR domain than
the domain that is configured for the 3PAR driver.

The bug complained that it couldn't find a VLUN, when the
actual problem was the host existed in the wrong 3PAR domain.

Fixes bug #1158991

Change-Id: I3f92e59ae43a10a0788d97d987785b6520f9f1be
Last driver sync for Folsom and Grizzly

This is the last of the updates that I've been putting
off while trying to handle the core items in Cinder.

This change fixes the ctxt ordering error in volume_types
and also fixes and also changes the internal SolidFire
metadata storage to a single dict instead of a dict of dicts.

Change-Id: I002a591bc109ae1ab625c89f6ad841f60e464a40
Fix quota updating when admin deletes common user's volume

Add 'project_id=None' optional argument in QUOTAS related methods.

There are two problems when admin deletes volumes of common user
before fixing this bug:
Firstly, It will get tenant quotas using context.project_id which
results in getting admin's quotas not common user's.
Secondly, It will also get wrong quota usages using context.project_id
when updating common user's quota_usages.

So we could pass into QUOTAS related methods an optional argument to
specify the tenant ID to be affected. And if it's not set, then we
default to drawing the tenant ID from the context.

Fixes: bug 1078668
Change-Id: Ie250da84726d1c5c3280430038184000dfd1e9e2