3PAR Only remove FC Zone on last volume detach

This patch checks to make sure that we don't
include the initiator_target_map in the return
of terminate_connection if there are volumes
still attached for a particular host.  The
FibreChannel ZoneManager doesn't remove zones
if there isn't an initiator_target_map in the
return of terminate_connection.

Change-Id: I98db5adb6da38454933a6e4b78085193f1d37680
Partial-Bug: #1308318
Merge "Use a task subclass instead of a functor + task wrapper"
Merge "Add cinder-manage cmd to update host column"
Add optional_args to fix Volume Import failure

Commit 971a63bd9cf675a00bce1244ec101577b5c17cac added a new
parameter 'optional_args' to execute method of QuotaReserveTask
and QuotaCommitTask. So the new parameter should be needed where
those Tasks are used. This changed volume create task flow to
provide the new parameter. We need the samiliar change to get_flow
method in cinder/volume/flows/manager/manage_existing.py

Trigger EMC VNX CI

Change-Id: Ifed7bd146eec82ba35c2b2c19e9bacd2259ae3ed
Closes-Bug: #1334086
Merge "Don't use ModelBase.save() inside of transaction"
Merge "Add optional_args to fix Volume Import failure"
Fix host option isn't set when using multiple backend

When using multiple volume backend, and volume driver is
cinder.volume.drivers.block_device.BlockDeviceDriver, host
option isn't set so a call to get volumes of a host returns none,
This patch changes to use self.host instead of self.configuration.host

Change-Id: Ide34ed29adad14b778b1a7388e9dc313241fa243
Closes-Bug: 1332909
Merge "3PAR Only remove FC Zone on last volume detach"
Merge "Ensure rbd connect exception is properly caught"
Merge "Fix docstring for snapshots API"
Restore osapi_volume_workers config option

osapi_volume_worker was introduced when enabling multi-process API
support for Cinder. However, this config option was accidentally
dropped in commit 464277220ddb800ac69562649fde62e5ca9358c4
(https://review.openstack.org/#/c/67657/20/cinder/service.py).
As a result, the value in cinder.conf wouldn't be honored.  This
change restore this config option.

Closes-bug: #1335295

Change-Id: Ib2d8532d3e6d0f48da0bc4dd6f6e64bfff8973ea
Use (# of CPUs) osapi_volume_workers by default

This changes the default number of cinder API workers to be equal to the
number of CPUs available on the host, rather than defaulting to 1 as it
did before.

Commit 75c96a48fc7e5dfb59d8258142b01422f81b0253 did the same thing in
Nova in Icehouse. Similar changes are being made to Glance and Trove as
well.

DocImpact: osapi_volume_workers will now be equal to the number of
           CPUs available by default if not explicitly specified
           in cinder.conf.

UpgradeImpact: Anyone upgrading to this change that does not have
           osapi_volume_workers specified in cinder.conf will now be
           running multiple API workers by default when they restart
           the cinder-api service.

Closes-Bug: #1333370

Change-Id: I8dec104800c18618e0c8422bbb93d5dc19c12876
Fix begin_detach logic

Fix begin_detach logic so it checks that a volume is in-use AND
attached.

Change-Id: I6f0e584070a5fc02c55c26ea92cb8b0c2a2cda3e
Closes-Bug: #1337088
Merge "Remove rootwrap module"
Replace tearDown with addCleanup - Part 3

Replace tearDown with addCleanup in some cinder unit tests.

Infra team has indicated that tearDown should not be used and should
be replaced with addCleanup in all places.

Implements blueprint replace-teardown-with-addcleanup

Change-Id: I8469ffb5c896d40f9979cd6d1f8da81be763ec14
Enable E121,E122,E123,E126,E128 hacking rules

This change enables E121,E122,E123,E126,E128 hacking rule and fixes
all violations found in Cinder.

Change-Id: Ibfdcb3e286393d932e1534500e31a5f90c031adf
Ceph rbd volume manage/unmanage support

Ceph rbd support for managing and unmanaging volumes.
Partially Implements: blueprint add-export-import-volumes

Change-Id: I272f65621a3dac50a154b7f2caa545ae6fb0e54f
Merge "Support Volume Num Weighter"
Correct lvm_mirrors help message

The description is not correct if someone sets
lvm_mirrors=0.  Also clarify LVs vs. lvms.

Change-Id: I7ec74fc8beaef5e638bc1a5dac3d7d97f1c474d3
volume_image_metadata missing from volume list

The volume_image_metadata field was missing from the volume list
because we tried to filter VolumeGlanceMetadata against a non-existent
project_id field. Filtering should be done on the Volume associated
to the VolumeGlanceMetadata instead.

Move project_id filtering out of model_query as it assumes
the project_id field is in the queried model itself.
Build the filter ourselves against Volume.

Change-Id: I6053708296f2b5e24513dc87ed63da0f67c220ae
Closes-bug: #1337526