Remove SSH code from 3PAR drivers

This patch migrates all of the communication
to the 3PAR array into the client library.
Some of the calls to the array happen over ssh
and others happen over REST.  Now the drivers
don't care.

This allows us to change the external client
library to replace SSH calls to REST calls,
without the need of driver changes.

Change-Id: Ia5e94a349308055381001c373b91c444860115c7
Move clear_volume back to it's own method

This just moves clear_volume back to it's own method
and also only calls volutils.clear if we actually
need to perform the clear operation.

Also takes out the hard-coded multiplier of 1024 and
uses units.GiB.  Maybe this should be a separate patch,
I'll spin another if there are objections.

Change-Id: I56f6690fbadc0d44eba48f49d29386d5b9dca195
Implement retype in SolidFire driver

This just adds the ability to modify the
type of an existing SolidFire volume to
another type suppported on the same backend.

Main use case for this is changing QoS settings
for a volume on-demand.

Also updates the internal attributes to store the
deltas between the old-type and new-type.

Change-Id: I65a4c34cbec17d0f3987c1d964e6ad1bafea3601
Implements: blueprint retype-support-for-solidfire-driver
Fixes cinder failed to create/restore a backup with NFS driver

The action cinder backup-create fails when trying to backup a newly
created volume when using cinder.volume.drivers.nfs.NfsDriver. This
patch removes not implemented stubs for backup_volume and
restore_volume. The inherited methods in cinder/volume/driver.py
succeed in creating a backup and in restoring it. After manual
testing of this change backups/restores succeed without the not
implemented stubs. This change also adds the not implemented
stubs to the glusterfs driver until a fix is submitted.

Closes-Bug: #1247743

Change-Id: I5478d00442ce855c91a7f04c5ba2b40733d44902
Storwize/SVC: Fix races in host-related functions

In the Storwize/SVC driver, initialize_connection checks if a host
object exists on the storage, and if not, creates one. Similarly,
terminate_connection checks if there are any more mappings for this
host, and deletes the host object if there are none. Consequently, there
exist races between two initialize_connection calls, two
terminate_connection calls, or one and one.

The easy solution here is to use locks. Because locks are files on the
local machine, this implies that all cinder-volume processes managing a
given Storwize/SVC contoller run on the same machine.

Change-Id: I62cd992e7150e7d16f1a2b2be6ef61c64b638858
Closes-Bug: #1274123
Add method for unit tests to set logging level

Implements: blueprint cinder-testcase-set-loglevel
Change-Id: Id4bb7023659eda593cc5ac451aa580f68a1a6b9d
Fixup persistence file not found on tgt remove

After commit: beecd769af02ba5915be827d28a7b46d970e41b0
we're experiencing a race in the tempest gating tests.

It appears that there are certain cases where a detach
and a delete call can overlap causing a race in the
remove_iscsi_target method.  The result is that when
the slower method gets around to the final removal of
the persistence file it's no longer there, so we
hit an unhandled exception.

This patch does two things:
1. It adds the volume lock to the detach_volume
method in the manager (already in place for delete).
This should mitigate the race and allow us to avoid it.

2. In the iscsi_remove_target method check if the
persist file has already been removed when we get
to the last check.  The fact is that if it was somehow
removed before we got here we don't really care, we're
just going to delete it anyway.

Change-Id: Ied45e1a66c8fb79c95ada66f8c59bd2839e200ad
Closes-Bug: 1277362
Merge "Remove SSH code from 3PAR drivers"
Merge "Implement retype in SolidFire driver"
Merge "Fixes cinder failed to create/restore a backup with NFS driver"
Merge "Move clear_volume back to it's own method"
Merge "Add method for unit tests to set logging level"
Merge "Storwize/SVC: Fix races in host-related functions"