LVM: Activate source snap LV when cloning from volume

Similar to the change made in:
01a2199 LVM: Activate source LV before cloning from it

Previous change only fixed this issue for clone-from-snapshot.

This activates the source snapshot LV when cloning from volume
as well, fixing the problem where cloning fails due to inability
to open the source LV device.

Change-Id: If48be8516fd71738cb83a91683c33d02f227b9d6
Related-Bug: 1252423
Closes-Bug: 1260786
Add time_type dictionary to test_migrations

A number of postgresql migration tests fail because the test case
is verifying that an sqlalchemy.types.DATETIME column was created.
When the column type is checked, however, postgresql reports the type as
sqlalchemy.types.TIMESTAMP.  The mismatch causes numerous
test cases to fail for postgresql.

This creates a dictionary for each engine being tested to handle the
different time types.

Change-Id: Ic9921ff9fda001a66c0ea3a6a75c8adefa60b107
Closes-bug: 1262426
Change default policy for volume_extension:volume_tenant_attribute

The volume_tenant_attribute extension should be accessible by
the owning tenant and the admin. Change default policy from
'rule:admin_api' to 'rule:admin_or_owner'.

Change-Id: I886cd717741c86b5083aeaf16e3e7ea5b4e525b4
Closes-bug: #1269312
Pull Bug #1263122 fix for service module from Oslo

Get latest service module from Oslo mainly to avoid the impact of
bug #1263122 when multi-process API service is enabled.

Follow commits are included in this change:
* 8b2b0b7 2013-12-20 | Use hacking import_exceptions for gettextutils._
* 37e46bb 2013-12-20 | disable SIGHUP restart behavior in foreground
* 12bcdb7 2013-10-11 | Remove vim header

Change-Id: I506ff809c32542520cc6ba2fa07519b1361f439c
Added missing accept_transfer to FC

The base class FibreChannelDriver was
missing the new accept_transfer method.
This was caught while running the devstack
driver certification tests again the
3PAR FC driver.
This patch adds the missing method to the
base VolumeDriver.

Change-Id: I0aa91a4f11edd03eee7607d15317b89c30732cb7
Closes-Bug: #1269633
Use a mirrored mirror log

By default, LVM will sync the two mirrors of a logical volume on
creation. This is I/O intensive and it takes a long time though, so we
tell it not to with --nosync. The next default behavior is to create a
mirror log which says what portions of the mirrors are in sync. But
then if a disk backing a mirror log fails, we have to deal with
resyncing the mirrors at each reboot.

This commit tells LVM to use a mirrored mirror log, which will use
approximately 4MB of extra space, but means we'll never have to
sync mirrors, ever.

Change-Id: I6586ced4e7e66ae79ae134406a4c633f8fbc8602
Fix import log_handler error with publish_errors set

Sync latest module log_handler from Oslo.
Commit Id is 2843a92a0e4007f50d5ad63d51fe574e1ba5e280

This handler sends the error to configured notifier.
The notifier could be any kind (log, RPC, no_op, None).

Note: when using publish_errors you also need to set the
notification_driver option too.

Closes-bug: #1240349
Change-Id: I4f759b049b8f34904ba11382a2e8fc1578677a8f
Rename __init__.py to create_volume.py

This commit is the first step of creating packages structure for
flows. This change is required to preserve git history of renamed files
for change I63473f549f0c501fe0f373830bc1080239d01892

Change-Id: Ib5ed0e9196fa7bf4fd0b69a13c90e40c360ad8ef
Fix up calculating space info for mirrored volumes

The status reporting in the lvm driver for cinder volume incorrectly
reports free capacity. This is due to a couple of issues:
  a) the number of mirrors isn't taken into account
  b) there are some pathological cases where a
     simple division by total mirrors isn't sufficient
     because all mirrors must be on separate physical volumes.

Co-authored-by: Vishvananda Ishaya <vishvananda@gmail.com>
Co-authored-by: John Griffith <john.griffith@solidfire.com>

Closes-Bug: 1269964
Change-Id: I65e16b24367b4093a52c1c52d895fb58ef6a29ff
Do not show quota of removed volume types in Default Quotas panel

Fixes the issue where quota for removed volume types still show up
in Admin -> Defaults -> Default Quotas view.

Change-Id: I2a822ac08b8347a8d76e8de70deca0e34fafe6e3
Closes-Bug: #1266906
Remove unused exceptions

The following exceptions are not used.
  class MigrationNotFound(NotFound):
  class BadDriverResponseStatus(VolumeDriverException):
  class InstanceNotFound(NotFound):
  class VolumeRetypeFailed(CinderException):
  class DuplicateSolidFireVolumeNames(SolidFireDriverException):

Change-Id: I891360f9c150eb8ea3f3968f12b9ad3da998981a
Remove unused config options

The following options are not used.

o fake_tests=true
  This configuration was removed in the following commit.

    commit 6ae520677da80103bae79e3db3569360df1220cd
    Author: Monty Taylor <mordred@inaugust.com>
    Date:   Fri May 24 01:36:21 2013 +0200

        Replace custom skip_ methods.

o backlog=4096
  This configuration was added in the following commit.

    commit 24d961023f2a32ca3454991a7891199d2da796dc
    Author: Davanum Srinivas <dims@linux.vnet.ibm.com>
    Date:   Sat Jan 12 16:16:19 2013 -0500

        Support for SSL in wsgi.Server

  But there is no evidence that was used.

o bindir=$pybasedir/bin
  This configuration was added in the following commit.

    commit c53d8e343e50d4cf7ea9a6a81258848c2d893bfb
    Author: Jenkins <jenkins@review.openstack.org>
    Date:   Thu May 3 10:48:26 2012 -0700

        Initial fork out of Nova.

  But there is no evidence that was used.

o root_helper=sudo
  This configuration was removed in the following commit.

    commit 5bce6ad46f57d22fcb22ba9e194fbd1e2d53f55d
    Author: John Griffith <john.griffith@solidfire.com>
    Date:   Tue Jun 4 17:07:03 2013 -0600

        Use common.processutils.execute

o nexenta_mount_options=<None>
  This configuration was added in the following commit.

    commit 96677735f6d8f1f5b6380127956921f719aab799
    Author: Mikhail Khodos <hodosmb@gmail.com>
    Date:   Wed Aug 14 11:18:12 2013 -0700

        Adds Nexenta NFS driver

  But there is no evidence that was used.

o nexenta_used_ratio=0.95
  This configuration was added in the following commit.

    commit 96677735f6d8f1f5b6380127956921f719aab799
    Author: Mikhail Khodos <hodosmb@gmail.com>
    Date:   Wed Aug 14 11:18:12 2013 -0700

        Adds Nexenta NFS driver

  But there is no evidence that was used.

o nexenta_oversub_ratio=1.0
  This configuration was added in the following commit.

    commit 96677735f6d8f1f5b6380127956921f719aab799
    Author: Mikhail Khodos <hodosmb@gmail.com>
    Date:   Wed Aug 14 11:18:12 2013 -0700

        Adds Nexenta NFS driver

  But there is no evidence that was used.

o zadara_default_striping_mode=simple
  This configuration was removed in the following commit.

    commit 2f907133aeaee09f58be30e75089c23b13573500
    Author: Vladimir Popovski <vladimir@zadarastorage.com>
    Date:   Fri Aug 16 04:34:54 2013 +0000

        Add features to Zadara Storage Cinder driver

o zadara_default_stripesize=64
  This configuration was removed in the following commit.

    commit 2f907133aeaee09f58be30e75089c23b13573500
    Author: Vladimir Popovski <vladimir@zadarastorage.com>
    Date:   Fri Aug 16 04:34:54 2013 +0000

        Add features to Zadara Storage Cinder driver

Change-Id: Ie78b8c7fc081899b8053060150e81e1a6c5d4958
Remove unused method 'is_key_value_present()'

The following method is not used.
  is_key_value_present() in cinder/volume/volume_types.py

Change-Id: If1ecd22f2cfb758f0e9f7c6b730727559e9dcdf0
Update HACKING.rst with regard to mock usage

Add a sentence about using mock rather than mox for unit tests.

Change-Id: If3c175d986f3ebed6d949df5c473e0cf9177ef6e
Fixed inconsistency in iqn

Brick's TargetAdmin classes have a
default value set in __init__ for
iscsi_target_prefix.   The unit test was changing
the value returned for the internal _get_target,
but wasn't changing the CONF.iscsi_target_prefix to
match.  So the default value in the __init__ was
being used and hence the differences.

This patch sets the configuration's iscsi_target_prefix
which alters the values passed into the driver.  This
also makes the tests consistent between the iqn of the volume
at create time and delete time.

Closes-Bug: #1271249
Change-Id: Ie3308cf68adcbdff6057ea795af1299dded82e14
Convert RBD unit tests to use mock instead of mox

Change-Id: If32e14a8f5ff180b6c0ff46797bcb81b21f805f1
Closes-bug: 1261864
Merge "Pull Bug #1263122 fix for service module from Oslo"
Add notifier events to cinder volume rename, reset-state

Implements: notifiers for cinder volume rename, reset-state
Fixes: bug #1271692
Change-Id: Ie82a4c062904a4f86c9f6364649b8c2b9f71ea6e
Merge "Remove unused config options"
Merge "Use a mirrored mirror log"