Remove dynamic default on sf_account_prefix

A dynamic default makes it difficult to generate
a proper cinder.conf.sample template. Make it
default to the hostname when the option is unset
or left at default.

DocImpact: default of sf_account_prefix changed to "None", which
however preserves behavior of a previously unset option: use
the current hostname.

Change-Id: Ic90305bd93ae0156c37e32012cdc32848192de07
Only reverify backing lun when create backing lun

In TgtAdm, we alway do twice _verify_backing_lun whether backing lun
exists or not.
If backing lun exists, it doesn't need to call _verify_backing_lun
function again.
It only needs reverify whether backing lun exists or not when recreate
backing lun.

Change-Id: Ic11d778362540df307056a1adcba932e571b7d20
Closes-Bug: #1262958
Add qos_specs support to solidfire driver

We've added a new qos_specs object to Cinder that allows creation
and management of qos settings separate from volume-types.
Now instead of embedding the qos info in the extra-specs of the
volume-type we associate the desired qos-spec to a volume-type.

This change implements the capability of the SolidFire driver to
take advantage of that feature.

Change-Id: I215bd0cff0c0a91c106de27eea9ec2b91689a46e
Implements: blueprint add-qosspecs-support-to-solidfire-driver
Output Strings of bin/*.py should support i18n

Many more output strings in cinder/bin/*.py don't support i18n,
which should be fixed as visible message.

Change-Id: I863c09a0a398b99360e5a080091e320b594d4024
Closes-Bug: #1257613
Handle initialize_connection() exception in volume manager

Due to the fact that several drivers require backend communication to fetch
connection information for a volume, it's possile that these driver throw
exceptions while doing that.  Currently exceptions can bubble up to volume
API not being handled.  This patch logs exception in volume manager and
then raises VolumeBackendAPIException to caller.

Change-Id: Ib3cc152e04ba029dd835a64b0cfb0a77b8a6828e
Closes-bug: 1256804
Imported Translations from Transifex

Change-Id: I8f2b51a5c5c58fa8c64899091e726139f93967d1
Fix spelling errors

Spelling errors fixed in comments and log messages.

Change-Id: I8ce4899fbb22136ce6d03e1796fc01d929f35562
Merge "Fix spelling errors"
Merge "Handle initialize_connection() exception in volume manager"
Merge "Add qos_specs support to solidfire driver"
Merge "Imported Translations from Transifex"
Bugfix missing foreign key removal for mysql

Downgrading the cinder schema fails when running 018_add_qos_specs.py
under MySQL. The upgrade path of this schema patch adds the foreign
key volume_types_ibfk_1 on table volume_types, and the downgrade does
not correspondingly remove it before attempting to drop the
qos_specs_id column.  This update removes the foreign key when
the engine is mysql prior to dropping the column.

Change-Id: Ibd3b35ad3b0bd41ad04ab7aeeb28c3ba7e5d255d
Closes-Bug: #1264360
Empty files shouldn't contain copyright nor license

http://docs.openstack.org/developer/hacking/#openstack-licensing

Partial-Bug: #1262424
Change-Id: Ib4d35e85ed23581f4a27a1daca8664180751f6f1
Handle terminate_connection() exception in volume manager

Due to the fact that we sometimes need to manually terminate a volume's
connection through volume api, it's possile that these backend drivers
throw exceptions while doing that. Currently exceptions are bubbled up to
volume API not being handled. This patch logs exception in volume manager
and then raises VolumeBackendAPIException to caller.

Change-Id: If809f97998f52516af09ec21b3052b67d3a62f36
Closes-bug: #1263820
Imported Translations from Transifex

Change-Id: Ic024fd0bef15147662612ed49b28133019d68aed
Merge "Handle terminate_connection() exception in volume manager"
Add AllocatedCapacityWeigher

AllocatedCapacityWeigher is a weigher that weigh hosts by their
allocated capacity. The main purpose of this weigher is to simulate
the SimpleScheduler's behavior, which sorts hosts by the size of
all volumes on them.  So by allocated capacity, it equals to the
sum of size of all volumes on target host.

In order to keep track of 'allocated' capacity, host state is updated
to add a 'allocated_capacity_gb' attribute to record the value, which
means each back-end must report one extra stats to scheduler.
Fortunately, the 'allocated' capacity we are interested in here is
pure Cinder level capacity, the volume manager can take all the burden
to calculate this value without having to query back-ends. The volume
manager does the initial calculation in init_host() by the time when it
has to query all existing volumes from DB for ensure_export(). After
initial calculation, volume manager/scheduler will keep track of every
new request that changes 'allocated_capacity' and make sure this value
is up to date.

!DriverImpact! Cinder driver developers, please read on:

This patch contains a change that might IMPACT volume drivers: volume
manager now uses 'stats' attribute to save 'allocated_capacity_gb'.
And this information will be merged with those stats drivers provide
as a whole for scheduler to consume.  If you plan to report any form
of allocated space other than the apparent Cinder level value, (e.g.
actual capacity allocated), Please choose a key name other than
'allocated_capacity_gb', otherwise it will *OVERWRITE* the value volume
manager has calculated and confuse scheduler.

Partially implements bp: deprecate-chance-and-simple-schedulers

Change-Id: I306230b8973c2d1ad77bcab14ccde68e997ea816
Redundant size check in volume restore api

In cinder volume restore api, we do twice size check when restore volume
with a given volume uuid. It's necessary to remove the redundant check.

Change-Id: I8f240b2c0d1014d212ff56c2c9b5e193f9d552bd
Closes-Bug: #1264053
Merge "Empty files shouldn't contain copyright nor license"
Merge "Redundant size check in volume restore api"