Fix volumes search by metadata

The metadata parameter is urlencoded (to string) by cinderclient
but isn't decoded back to dict by the API.

The metadata parameter needs to be converted back to dict
to be of any use by the filters parameter of get_all().

The original implementation has been done by:
Mathieu Gagne <mgagne@iweb.com>

Fixes: bug #1195015

Change-Id: I19d7d386afddddc067e9f4ef86967c9b72d9e530
Implement extend volume for Storwize/SVC.

This implements the extend volume functionality for the Storwize/SVC
driver.  Extending volumes with snapshots is not supported, as this
will require converting the snapshots into full copies, which will eat
up free space.

Change-Id: I5fb8c6967e6f3df1adfef46e05c832a953dd7131
Add create & attach times to SolidFire attributes.

This change simply adds create_time and attach_time to
the SolidFire devices attributes.

Times are taken from the volume-ref object, attach_time
is only set/present after an attach, and is also removed
from the attributes list on a detach.

This also required that we actually set attach_time on the
volume in the db.  We have the column, but we weren't actually
setting it, so this change required that be fixed.

In the future we should also look at changing the attach_time
from a string to a proper date-time object.

Change-Id: Ib9577ac160596a6878d1729f6022885b6cfa90e2
Fix further Hacking 0.6.x warnings

* Add missing Apache license header
* Avoid using locals() in string formatting

Change-Id: Ib9fa878babae5c50bc77e48c62b33a8ebfe39f7f
use 'exc_info=1' instead of import traceback

We need store traceback message in log sometime. Python logging module
already provide a argument to do that. For example, we could:

logger.error('msg', exc_info=1)
logger.debug(e, exc_info=(type_,value_,tb))
logger.exception('msg') # exception add exc_info automaticly

Change-Id: Iaf541e4f4ea139d9315ac1990f0e6079c8f8a20d
fix name 'update_volume_status' to 'update_volume_stats'

_update_volume_status() private method is called by
get_volume_stats(). This is confusing as the volume's
stats and not status gets updated.

fixes bug #1199327

Change-Id: I9f7971e457250798320c14d3f58bdc199c8cfceb
Fixes RBD driver docstring format issues.

All docstrings should now comply with HACKING.rst

Change-Id: I0892af8d81415880d5e0f9aab5c7cd95ff3bf6b9
Fixes: bug #1203697
Fix oslo.config.cfg.NoSuchOptError when running individual tests

We need to import cinder.common.config wherever we are using an olso
configuration option from this module. Otherwise it is not necessarily
the case that olso knows about the option and it complains.

cinder.tests imports this configuration module but it not the case that
this module has been imported when you you are running individual tests.

Change-Id: I8f2c966848f55c80213d2ecd2dbf75b777627e6b
Fixes: bug #1203737
Merge "Add create & attach times to SolidFire attributes."
GPFS convert glance image to raw only when needed

Modify _gpfs_fetch_to_raw to check image format.  If already in raw
format, no need to call convert_image.  In that case, simply rename
to destination name.

Change-Id: I197d99194f93c02ce3c501de25433d89b23e6a35
Fixes: bug #1201676
Update RBD driver to be compliant with HACKING

Fixes imports, doc strings, and dict style.

Change-Id: Id678d972b9bf744239460fe97155a6a7bd8a868e
Adding driver minimum features and volume stats to dev doc

This is a first pass in getting information out of the wiki and into the
dev docs, so changes can be reviewed properly as discussed at the Havana
summit.

Change-Id: I75e71b3e5df69e6b507ee64d330a9ec2455266c5
Merge "Adding driver minimum features and volume stats to dev doc"
get_snapshot should populate the snapshot metadata

Update the query in db api snapshot_get() to join with the table
snapshot_metadata, so that snapshot metadata is returned. This makes the
api snapshot_get() function in the same way as volume_get().

Fixes: bug #1204446

Change-Id: I37004140f6a11b96aaeb3af6c631028a44541d3a
Migration for detached volumes with no snaps.

Implementation of volume migration for detached volumes with no
snapshots. Migration is initiated by an admin API. The scheduler
confirms that the specified destination host can accept the volume.
The source driver is given the opportunity to migrate the volume on
their own. Otherwise, a new volume is created on the destination, both
volumes are attached, the data is copied over, the volumes are
detached, the source is deleted, and the destination is renamed. In
the database, the destination volume's attributes are copied to the
source so that the volume-id remains unchanged, and the destination
volume row is deleted.

DocImpact

Implements: bp volume-migration
Change-Id: Ib6fcf27051f45e60aa3ba5f599e88c1421db753e
Imported Translations from Transifex

Change-Id: Ia984fca524ee33c0ce76931187a5293fb80d8b26
use encode('utf8') instead of str()

It is not clear for converting a unicode to string by using str().
Instead we should use var.encode('utf8') to do this.

Change-Id: I8ce4c98f819c98e835a6d8298fe22f2fd0ca18b6
Implements extend volume feature in HP 3PAR driver

This patch enables the extend volume feature to be used in cinder
when the backend storage is a 3PAR array.

Change-Id: I8c8422f0ffc6d55ebe80fa8b2962b54eca266974
Merge "Implement extend volume for Storwize/SVC."
Storwize/SVC: Use VolumeDriver's copy vol<->image.

Inherit the VolumeDriver copy volume<->image functions. This patch also
creates a new SanDriver class which is protocol-agnostic, and leaves
the SanISCSIDriver class for drivers that wish to use it.

Change-Id: Iad5cb030545ef7f4e01d006f1e63cdeeec713bf6