NetApp fix free space as zero during 1st vol stats update

NetApp clustered ontap drivers report space as zero
till first 60 seconds of driver start. This is causing
discomfort for some performance sensitive deployements.
This was due to async nature of the NetApp stats collection job.
Job is changed to sync at driver start to improve customer
experience.

Change-Id: I7d5cbf590897a0d328ece3a60516c92c0ad0ee7f
Closes-bug: #1253660
(cherry picked from commit 585f34ff7798ad271121d432e0cae8820bc54389)
Brick connector revised fix for NFS drivers

This change fixes the error that comes
while getting brick connector and attaching volumes
in case of NFS drivers in cinder. The attribute for
mount point base was not passed to attach_volume method
as the connector initialization logic is common for all
types of protocols. It is fixed by populating
the required parameter in the RemoteFsConnector
by extracting it from connection properties. The infrastructure
for fixing this situation for remote fs drivers is implemented
in this fix. The drivers need to override the method
_get_mount_point_base in their implementation. NFS driver
implements it. GlusterFs implementation of the method to follow
in a separate patch. Hence marking it partial fix.

Change-Id: Id61a437fca1870529fa8b85f7fc2f73eae665294
Partial-Bug: #1238085
(cherry picked from commit 1cd362630655798e5ff4c058b3f44862ae61c801)
GlusterFS: Ensure Cinder can write to shares

Ensure the Cinder user can write to the GlusterFS share.  This
is required for snapshot functionality, and means the admin
does not have to set this permission manually.

Conflicts:
	cinder/tests/test_glusterfs.py

Closes-Bug: #1236966
Change-Id: I4a9ea40df9681ca6931ad6b390aa21b09d6cfec9
(cherry picked from commit 371fa540600b20b97eae389e1f976145866cadae)
LVM migrate: Use keywords for the brick instance

In the `migrate_volume` method a new instance is created when the
dest_vg is not equal to the source vg. This new brick instance is
created using positional arguments instead of keywords. However, some of
those arguments are passed in the wrong positions.

This patch uses keywords for the misplaced arguments.

The patch also changes `test_lvm_migrate_volume_proceed` in order to
fully test the happy path and catch things like this.

Closes-bug: #1258128
(cherry picked from commit 69ce114232f9102220b45c8242eda3e78872a3e6)

Conflicts:
	cinder/volume/drivers/lvm.py

Change-Id: I75cf91171709554053fd5b52a4aae4e176e8364e
Convert lvm_mirrors to int

When the location_info is parsed and `lvm_mirrors` extracted, it is not
being converted to int. This causes some boolean checks to return True
even when there are not mirrors enabled because of the u'0'.

Closes-bug: #1258133
(cherry picked from commit 1dff30492f0ce1df3ef01ccc21353248a7207709)

Change-Id: I67c463d9f139fe326bbcab4d193c45459129b514
LVM migration: Check if name is equal to dest_vg

The existence check of the destination volume group is wrong. It
currently checks if there's a VG with a name equal to the source's vg
name instead of checking if it's equal to the dest_vg.

Closes-bug: #1258203
(cherry picked from commit 17912f4c4fba270a15cab47bb68d9e30c34a69b0)

Change-Id: Ia5d4acb24b94c6aa832107c7eb4b6996985af97f
Bump stable/havana next version to 2013.2.2

Change-Id: I3a7170180717bd62fce4cbc2c3a9107187f89fb1
Merge "LVM migrate: Use keywords for the brick instance" into stable/havana
delete.start/delete.end notification for hostless

Third party GUIs may rely on notifications to track the
progress of volume creation and deletion.  In the case that
a volume is being deleted after a failed attempt to create
(the volume is listed in the database but is not actually
resident in a backing store) the path that is taken in
volume.api.delete() makes no notifications of deletion
occurring.

This patch adds a volume_utils.notify_about_volume_usage
call to the beginning and end of the delete with a
delete.start and delete.end respectively.  The notifications
serve as triggers for GUIs to refresh the state of the
volume.  This change makes the hostless delete path's
functionality more consistent with the other paths through
the delete code.

Change-Id: I091b9d277834b341105569d41a48ef5c1fc105ce
Closes-Bug: 1257053
(cherry picked from commit a347b99c261dc1c761a8bc51c2aee99d20161ca6)
Merge "Convert lvm_mirrors to int" into stable/havana
Merge "LVM migration: Check if name is equal to dest_vg" into stable/havana
Fix QoS information in initialize_connection() result

Currently the entire QoS information (if any) is included in the result of
initialize_connection() even if the consumer of the QoS is 'back-end'. Also
the format for QoS specs also is changed so that front-end (Nova) can
parse correctly. Add unit test to cover initialize_connection().

Closes-bug: 1259957

DocImpact

(cherry-pick: e40dafd54411f0e4648fc051ef4d9c806f337f9d)

Change-Id: Ibc5e92cc1ddf6404e5b234ef524698feae282eec
Merge "Brick connector revised fix for NFS drivers" into stable/havana
Merge "Fix QoS information in initialize_connection() result" into stable/havana
GlusterFS: Complete snapshot_delete when info doesn't exist

The snapshot_delete operation will fail if the snapshot info file
doesn't contain a record for the snapshot, or does not exist.
This happens in cases such as when snapshot_create fails to commit
anything to disk.

The driver should allow the manager to delete the snapshot
in this case, as there is no action required for the driver
to delete anything.

Closes-Bug: #1252864

(cherry picked from commit d8a11168c908fe6c6a07fbb30a5bc88a6df6e939)

Change-Id: I8686a1be09dbb7984072538bff6c026bb84eeb52
GlusterFS: Use correct base argument when deleting attached snaps

When deleting the most recent snapshot, the 'file_to_merge' field
which translates into the base= field for libvirt's blockRebase
call in Nova must be set depending on whether other snapshots exist.

If there are no other snapshots, base = None, which results in
libvirt clearing the qcow2 backing file pointer for the active
disk image.

If there are other snapshots, pass the parent of the file being
deleted as the new base file.  The snapshot info pointer for the
prior base file must also be updated in this case.

Closes-Bug: #1262880

(cherry picked from commit 186221779a92002ff9fa13c254710c0abb3803be)
Conflicts:
	cinder/tests/test_glusterfs.py

Change-Id: If7bc8259b031d0406346caafb8f688e65a38dba6
NFS/GlusterFS: Skip incorrectly formatted shares

Shares should always be of the form address:/volume.  If they are
not (i.e., are missing the '/'), then skip them and issue a warning
message.  This will prevent us from sending incorrect connection_info
dicts to Nova.

Closes-Bug: #1267253

Change-Id: Ic40cd0cdc862b44b0a7d3e5b1d7c4fee8ea1b28d
(cherry picked from commit 21ebf2898e2f5fc8127b7a3bdc9743c49933f952)
Fixed a problem in iSCSI multipath

Multipathing during copy image to volume and copy volume to image
operations doesn't work properly if there are different targets
associated with different portals for a mulitpath device.

Change-Id: I65c93f3788020c944db0d3a55063a6415554ff11
Closes-Bug: #1266048
(cherry picked from commit 3e4f554f614c8cb6d5f014c72f3c635184a4dec2)
Merge "Fixed a problem in iSCSI multipath" into stable/havana
Merge "NetApp fix free space as zero during 1st vol stats update" into stable/havana