changed quantum to neutron in vif-openstack

Change-Id: I50c14066584527a6fbc25c59b0bf03a321a5f1f5
Fix incorrect kwargs 'reason' for HTTPBadRequest

webob.exc.HTTPBadRequest doesn't have attribute 'reason', and its
__init__ method doesn't have such parameter too, so if we use such
kwargs, it will not be accepted by constructor of base class
WSGIHTTPException, then the http response body will format message
using default explanation instead of what we expected.

We should use kwargs 'explanation' instead of wrong 'reason'.

Change-Id: I02619164176a723e313ae274e527948d45fa6cad
Closes-Bug: #1264223
Move the metrics update to get_metrics

It is not necessary to update the metrics when get every metric in
one compute monitor plugin, just update once when get metrics for
the monitor plugin.

Change-Id: Ib665188964de8318f6d94343891666c674111c8c
VMware Driver update correct disk usage stat

The nodes managed by VMware VCDriver driver can have multiple
datastores (disk abstraction) attached to it. The driver currently
reports the disk usage of a datastore that has the largest capacity.
But it doesn't report a consolidated disk usage. As a result, the
node's storage capability is under-reported in many occassions.

This patch fixes this issue by aggregating the disk freespace,
capacity from all attached datastores.

Closes-Bug: #1220459

Change-Id: I818a041f33a045773fc799de2c69628064ef8cbf
Prevent thrashing when deploying many bm instances

Nova BM is easily overwhelmed at the moment because it has to convert
every disk image to raw - simply deploying 2 instances at once exceeds
the IOPS on most single disk servers. Avoid this by serialising the
image conversion (which leads to a lower average-time-to-deploy in
nearly all situations).

Change-Id: I6d5ee97ffdbd497802379b13e70b84d70d8ded57
Co-Authored-By: Steve Kowalik <steven@wedontsleep.org>
Sync the latest DB code from oslo-incubator

This sync contains the following commits from olso-incubator:

7959826 db: move all options into database group
dda24eb Introduce mysql_sql_mode option, remove old warning
0b5af67 Introduce a method to set any MySQL session SQL mode
8dccc7b Handle ibm_db_sa DBDuplicateEntry integrity errors
0f24d82 Fix migration.db_version when no tables
ac84a40 Update log translation domains
c0d357b Add model_query() to db.sqlalchemy.utils module
84254fc Fix a small typo in api.py
b8a676c Remove CONF.database.connection default value
86707cd Remove None for dict.get()
0545121 Fix duplicating of SQL queries in logs
fcf517d Update oslo log messages with translation domains
fa05b7c Restore the ability to load the DB backend lazily
630d395 Don't use cfg.CONF in oslo.db
ce69e7f Don't store engine instances in oslo.db
35dc1d7 py3kcompat: remove
b4f72b2 Don't raise MySQL 2013 'Lost connection' errors
271adfb Format sql in db.sqlalchemy.session docstring
0334cb3 Handle exception messages with six.text_type
eff69ce Drop dependency on log from oslo db code
7a11a04 Automatic retry db.api query if db connection lost
11f2add Clean up docstring in db.sqlalchemy.session
1b5147f Only enable MySQL TRADITIONAL mode if we're running against MySQL
39e1c5c Move db tests base.py to common code
986dafd Fix parsing of UC errors in sqlite 3.7.16+/3.8.2+
bcf6d5e Small edits on help strings
ae01e9a Transition from migrate to alembic

Due to API changes in oslo.db code we have to change Nova code a bit
in order to reuse oslo-incubator changes (oslo.db no longer stores
SQLAlchemy Engine and sessionmaker instances globally and it's up to
applications to create them).

Change-Id: I4aaa7151f66e0292ff66c29330f93d78c6bf78a6
Add a missing space in a log message.

It's easy to accidentally forget to add a space between words when splitting a
message up across multiple lines.  I noticed this case while working on some
other code.  Fix it up.

Change-Id: I0d714c0932834a15fb68f26f484495ccccb5a6ad
Adding image multiple location support

Images now support multiple locations within its metadata and it may be
stored on more than one backend storage. Nova should add a layer to
transparently handle image preparing and removing for an instance by the
best approach/location, and it should allow administrators to configure
the image handler pipeline with the order who preferred to the layer.

Also, based on this structure we could implement particular sub-class in
relevant hypervisor layer with more advanced functions, such as CoW
making, snapshot capturing and etc. in future.

Implement bp: image-multiple-location
DocImpact

Change-Id: Idce8d21ae37bfdbb28a2567120a83d1061061904
Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
notifier middleware broken by oslo.messaging

audit middleware in oslo-incubator is incompatible with oslo.messaging.
an oslo.messaging compatible version is available in pycadf library.
remove broken oslo-incubator code in this patch.

also add middleware/request_id to openstack-common.conf so we continue
to pull in request_id middleware but not audit/notifier.

Partial-Bug: #1280327
Change-Id: I665144b256da0b04267cac754324e5779512e65d
No longer call check_uptodate.sh in pep8

check_uptodate.sh re-generates a nova.conf.sample and then compares
it, which was fine. It stopped being fine when we started pulling in
options from oslo, or other modules made releases and then the gate
broke until we fixed the config sample.

Change-Id: I04b2b52a9e46dcf5f4f06e639327f22b827ccd0d
Fixing host_ip configuration help message

The vCenter/ESXi client can only accept a hostname or IP address
and not a URL.  Fix the help message to accurately describe what
kind of address is accepted.

Change-Id: Ie90247195181189d22e727a855145313397550ca
Closes-Bug: #1274294
VMware: refactor _get_volume_uuid

It is more efficient to ask vCenter for specific extraConfig property instead
getting all properties and then manually searching the one which is
needed.

Closes-Bug: #1257726
Change-Id: I4fc8399c9a8b6a141ac489e8fb92117ec03ca42f
Merge "changed quantum to neutron in vif-openstack"
Merge "Adding image multiple location support"
Ignore the image name when booting from volume

In 0185d2445 the _run_instance method was changed to acquire the image
metadata from the request_spec instead of glance. This was needed to be
able to get the image_metadata attached to a volume, when booting from
it. That change didn't consider that the image name key is not inherited
when creating a volume from an image and introduced a bug when creating
the usage_info for volume booted instances.

This change fixes this by only attaching the image name to the usage_info
only when booting from an image and not when booting from a volume.

Related-Bug: 1281973
Change-Id: I8ec441e7815855a94a28c4566790d5144deff16f
Merge "Move the metrics update to get_metrics"
Address the comments of the merged image handler patch

Three minor things which was commented in change:
Idce8d21ae37bfdbb28a2567120a83d1061061904

Change-Id: Idd899ec2c177c9b5695b6908bc897fe3e759beca
Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
Merge "Sync the latest DB code from oslo-incubator"
Merge "Add a missing space in a log message."
VMware: create datastore utility functions

The patch moves datastore interfaces from vmops and vm_util
to a separate file - ds_util.

This is part of the blueprint vmware-image-cache-management.

In the past the datastore methods would poll the task
to determine that it had completed. This has beem addressed by
making the driver _poll_task return the task information.

The patch set also solves the following bugs by checking if
the FileAlreadyExistsException exception is raised. This could
be due to another process or thread creating the file.

Closes-bug: 1230047
Closes-bug: 1254128

Change-Id: I788e33dbcb3dedc41831b976137607274b1c02ca