CinderException args to strings when exceptions

CinderException message and kwargs are converted to strings if the
argument is itself an exception.

Exceptions passed as arguments to CinderException happen in many areas
of the code. This causes an error when oslo.messaging tries to serialise
the exception.

Change-Id: I1399c939bbca47ab8362ac3bbe0e9a349c6d5572
Closes-Bug: #1301249
Remove second get call to list/show volumes

Recently it was observed that with large numbers of volumes
that things like "cinder list" could take extremely long to
return.

For example, running cinder list on a system with 1000 volumes took
greater than 30 seconds to return.  It turns out that the cause of
this is the addition of visible admin_metadata.

There's two problems with this:
1. The original patch probably shouldn't have gone in
   data is either admin data or it's not, selectively picking
   pieces of admin data out to provide to the user just creates
   complications and introduces confusion.
2. The REAL issue here is that since the standar gets are made
   with the standard user context, the add_visible_admin_metadata
   would go through and do an elevated context get on every single
   volume individually.  This is what caused the horrible performance
   issue on cinder list with large numbers of volumes.

Running as admin, or removing the second call drops this down to about 3
seconds for the same 1000 volume list.

This patch removes the secondary admin context get_call.  Instead where
we expect to do display the visible admin_meta, we pass in a flag
requesting that the volume object we're getting has the appropriate
metadata.  This way we can elevate the context if needed and avoid
iterating through the gets again.

This patch also cleans up the get_visible_admin_meta methods, and
consolidates both V1 and V2 to use the utils method.

Change-Id: I3fb7aefb7d8a5664b0a3fb3958f509b5cd621320
Closes-Bug: 1317606
hp_lefthand_rest_proxy no handler for logger during tests

Create the proxy during do_setup() instead of __init__()
so that the logger is ready for an import error during tests.

Closes-Bug: #1325116
Change-Id: I88145d97df5d746e92bc8302bf516ca9eaa05d00
Copy custom properties to image from volume

Presently after copying an image to volume, all properties
of the image are getting copied properly but while creating
image back from volume, it doesn't copy custom properties
to the image.

At present in volume-glance-metadata table all the properties
of volume are stored as key and value. Because of this it is
difficult to differentiate between core and custom properties.
To overcome this, I have added a new option
'glance_core_properties' in cinder.conf. This option defines
all core properties of an image. This way, it's easy to separate
core and custom properties from the glance_volume_metadata and add
custom property to the newly created image.

For Example:
glance_core_properties = 'checksum', 'container_format',
'disk_format', 'image_name', 'image_id', 'min_disk',
'min_ram', 'name', 'size'

DocImpact: Added 'glance_core_properties' to distinguish the
core and custom properties as discussed above in cinder.conf

blueprint: restrict-uploading-volume-to-image

Change-Id: I786edbc6e54b3d06ef679a71e22676d2f88e7307
Merge "hp_lefthand_rest_proxy no handler for logger during tests"
Implements HDS-Cinder HNAS Drivers

This change introduces HDS HNAS iSCSI and NFS Drivers.

HNAS NFS certification results:
  https://gist.github.com/sombrafam/6c73cb823ce75b0538bd

HNAS iSCSI certification results:
  https://gist.github.com/sombrafam/2625987243ec91d53c7a

Change-Id: I1a16f76887cf22dcf8ce0ed1dbc0b57327a87616
Implements: blueprint hds-hnas
Merge "Copy custom properties to image from volume"
Allow reset-state on attach and migration fields

The reset-state API call only sets that main status
column on the volume object.  There's also a method
to set attach status, however it turns out that due
to the implementation of the status validation method
in the parent class, this was impossible to use because
it only checked and accepted "status" NOT "attach_status".

This patch fixes that attach_status problem, it also implements
the ability to update the migration status.  A cinderclient change
will be needed to expose these calls as well.

DocImpact

Change-Id: I59e1bb2522f033c944fa07acf4876ca71c8c3d3f
Closes-Bug: #1308253
Merge "CinderException args to strings when exceptions"
Merge "Remove second get call to list/show volumes"
Merge "Implements HDS-Cinder HNAS Drivers"
Merge "Allow reset-state on attach and migration fields"