Fix cinder error for deprecated Netapp drivers

We deprecated some NetApp drivers in
this release. This change fixes c-vol
breakdown in case of cinder configured for
deprecated drivers and helps
in upgrade scenarios between releases
by printing appropriate warning and
suggestion message for deprecated drivers.

bug 1217220

Change-Id: I533d42257d93f706303b475fb4f222adcc0df3ed
Imported Translations from Transifex

Change-Id: I1831ed17f316a71ada1606555bf73c10eae62d71
Add optimized volume migration to Storwize/SVC

Add an optimized migration path for when the source and destination are
managed by the same storage. If the source and destination pools have
the same extent_size, it will use the optimal migratevdisk command.
Otherwise, it will use addvdiskcopy and rmvdiskcopy, which must be
watched until the copies are sync'ed.

Change-Id: Ic6069422f5ac7f963f4b1268c0d632a038a8474f
Migration for attached volumes

Enable migration for attached volumes by calling Nova to have the
hypervisor copy the data (Nova's swap_volume feature). A new API
function is added for Nova to call once it is done copying to finish
the Cinder side of the migration.

The overall 'generic' migration flow (i.e., not performed by a driver)
is as follows:
1. Creates a new volume
2a. If the source volume's state is 'available', attach both volumes
    and run 'dd' to copy, then detach both. When finished, call the
    migrate_volume_completion function.
2b. If the source volume's state is 'in-use', call Nova to perform the
    copy. Nova will attach the new volume, copy the data from the
    original volume to the new one, and detach the original volume.
    When the copy completes, Nova will call Cinder's new
    migrate_volume_completion function.
3. The migrate_volume_completion function deletes the original volume,
   and calls the database API's finish_volume_migration function. This
   copies all of the new volume's information to the original, and
   deletes the new volume's row, and thus we can keep using the
   original volume_id (the user sees no change).

We also don't change the original volume's status, and instead add a
migration_status column which only selected users can see (e.g., admin).
The migration status is None when no migration is in progress, whether
it succeeded or failed. The admin should check the volume's current
host to determine success or failure. This is meant to simplify
operations. The user will only be aware of a migration if they try to
change the volume's state during the course of a migration.

As mentioned, we change the volume while keeping the original volume
ID. Because a volume's name depends on its ID, the new volume will have
a different name than the original. This is the purpose of the name_id
field in the database - the name is now based on name_id. So although
we keep the original volume's ID, we use the new volume's ID as the
name_id. Thus we can remove the rename_volume function - it is no
longer necessary because the name_id field in the database already
allows for the volume's name on the backend to not rely on its ID.
The user than can see the migration_status can also see the
name_id, in case they need to find it on the backend.

There were a few other places throughout the code that relied on
constructing a volume's name from its ID, and those were fixed.

DocImpact

Implements: bp online-volume-migration

Change-Id: I8daaee174e426fbd450fa75f04f9c8e6fa09f01a
Migrate manage script needs import of db session module

This import looks like it is not used but importing this module as
the side effect of defining the olso configuration. Without it the
script will not work.

Change-Id: Id65f726f34aa2fb86fda13fd65e2e512b3a899ac
Move create_volume flow to a subfolder

In order to start splitting up the create_volume flow into
smaller files we will start by moving the create_volume.py
file to a folder with just __init__.py and this will then
act as the base for create_volume task modules.

Also add in a utils file that contains to start the commonly
used debug listener attachment mechanism.

Change-Id: Ie2fd0c77bb04f8153afecdce75588614b48fed8a
Modified 3PAR drives to support 3parclient 2.0.0

Replaced ssh calls to remove host, show host,
show port, show vlun and create vlun with the
new hp3parclient calls.

Change-Id: I917b4263389331597103d2fe6c9a73994165051b
Fixes: bug #1211994
Merge "Migration for attached volumes"
Merge "Imported Translations from Transifex"
Merge "Fix cinder error for deprecated Netapp drivers"
Merge "Add optimized volume migration to Storwize/SVC"
Add NFS/GlusterFS support to brick library

Refactor NFS driver to use the brick library to perform mounts
rather than duplicating the mount code. Some of the NFS unit
test code was rewritten to test the brick implementation because
the old mount code was moved.

The Gluster driver was slightly affected in the refactoring, but
does not yet use brick to perform attaches.

bug 1214748

Change-Id: Ib29f83fabe407f9591191e9fd19e6306ca9960cf
Adding Read-Only volume attaching support to Cinder

1. Adding an API extension to allow clients set volume Read-Only flag on
demand.
2. Require client to provide and be aware of volume attaching mode when
they call 'os-attach' API.
3. Adding a 'access_mode' field to connection info which
'os-initialize_connection' API returned. This field should be used by
client such as Nova to use correct mode accessing attached volume.
Currently access mode can be 'rw' or 'ro'.
4. In future, the driver within Cinder need to ensure the volume be
exposed under the correct access mode which connection info described,
for example backend should set volume to readonly mode when connection
info ask client using 'ro' access mode consume attached volume. That
means Read-Only is not only a attaching mode but also a status for a
volume.

blueprint read-only-volumes

Change-Id: I4c84614d6541d5f7c358abadb957da7b8c3d9c48
Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
Merge "Migrate manage script needs import of db session module"
Merge "Modified 3PAR drives to support 3parclient 2.0.0"
Pass MB size on copy_volume_data call copy_volume

Modify cinder/volume/driver.py method copy_volume_data
to pass size in MB when calling cinder/volume/utils/copy_volume.py

Closes-Bug #1218054

Change-Id: I5430f015ef0f0077b4794f1ff458e3f54cc4dc06
Update the version for the FC and iSCSI driver

We also now have a version for the common class,
and report that version at startup time.

Change-Id: Ia1b6698450d151d6b4a8bc13bf3b92c72e8c0ab0
Merge "Move create_volume flow to a subfolder"
Add kwargs to create_volume in tests/utils.py

Add availability_zone parameter and kwargs to make create_volume
function more flexible in order to use this function in
unit tests.
The goal is to remove inner _create_volume function in:
- db/test_transfers.py
- api/contrib/test_backups.py
- test_gpfs.py
- test_volume_transfer.py
- test_volume.py
and to use create_volume from tests/utils instead.

Change-Id: I2d9456ff3ff1cd945042f19c47e40f9f0ec0fe8a
Merge "Pass MB size on copy_volume_data call copy_volume"