Rename private functions in db.sqla.api

instance_get_all_by_filters() called 3 helper functions: exact_filter,
regex_filter and tag_filter. None of these functions had any other
callers.

This change prefixes them with _ to identify them as private.
Additionally, it removes the model arguments to the functions as these
always relate to an Instance and/or its InstanceMetadata.
Consequently, the functions are renamed to identify them as specific
to an Instance query. exact_filter is moved from the top of the module
to be next to the other 2.

Change-Id: I671315122438022b13d6b315b577ef2a5cf42545
Remove old Baremetal Host Manager

Baremetal was deprecated in Juno and its driver was removed in
46ed619b9ab1d61582f36155eea0d4a88f31fd50

This cleans out the parts that's still left in the scheduler.

Change-Id: I86f583f7d0747a164dae4530e25f8b01c2144673
Remove the volume api related useless policy rules

There are some old policy rules used by old nova volume, those are
useless anymore, this patch clean them up.

Change-Id: Ibcdba00652808158019600f8ad75e80c85f9423e
Closes-Bug: #1398686
VMware: allow selection of vSAN datastores

With support for handling of stream-optimized disk images added, the
vmware driver is now able to deploy to vSAN datastores, so add support
for the the 'vsan' datastore type, and update the datastore selection
logic to take this type into account when when spawning a
stream-optimized image.

Implements: blueprint vmware-vsan-support
Co-authored-by: Radoslav Gerganov <rgerganov@vmware.com>

Change-Id: Id43ad4adcad212a8e0d8ab3830af62d4afda1442
Libvirt: SMB volume driver

Currently, there are Libvirt volume drivers that support
network-attached file systems such as Gluster or NFS. This patch
adds a new volume driver in order to support attaching volumes
hosted on SMB shares.

Co-Authored-By: Gabriel Samfira <gsamfira@cloudbasesolutions.com>

DocImpact

Change-Id: I1db3d2a6d8ee94932348c63cc03698fdefff0b5c
Implements: blueprint libvirt-smbfs-volume-support
Compute Add build_instance hook in compute manager

The build_instance hook provides a hook close to the actual spawn
of an instance. It distinguishes itself from the create_instance
hook because, in the case of a successful build, the instance will
exist on the hypervisor when the build_instance post hook is
called, instead of simply just being scheduled as is the case with
the create_instance post hook. This is useful as some details may
not be available until after scheduling.

Co-Authored-By: Corey Wright <corey.wright@rackspace.com>
Change-Id: Ic12abf6315bbc6b010b8222ef296ec65cb4b4f95
Assert order of DB index members

Order of columns can matter. Most SQL databases can use the leading
columns for optimizing queries that don't include all of the columns.
Ignoring the order can result in an index being added that may not
be able to be used to optimize the same queries.

Change-Id: Ie827aaacbcfbc01e32591d29aab79ef75aa0c5d9
Adds global API version check for microversions

Adds a check for a request that the version requested is within the
global API version range supported by the REST API. Both the minimum
and maximum are currently set to "2.1". The maximum will be increased
everytime an API change is made.

Also sets up some template/doc files for clearly documenting
the REST API changes with each microversion increment.

Partially implements blueprint api-microversions

Change-Id: Ie7fdb2928d957c03ed788c2ddd29fe798c645fce
Use a copy of NEW_NETWORK for test_networks

In test_networks, NEW_NETWORK is used as a request body between unit
tests. "Create a network" API changes a request body internally, so
each test should use a copy of NEW_NETWORK to avoid affecting to the
other unit tests. However one test uses NEW_NETWORK directly.
This patch makes each test use a copy of NEW_NETWORK for avoiding
similar problem in the future.

Change-Id: I9e12fe89956d18dde54bec83c15af258d66e0682
Add a validation format "cidr"

Nova accepts CIDR attributes on network REST APIs and checks its format
on each API. On v2.1 API, the attributes will be checked with JSONSchema.
In addition, Neutron contains its own "cidr" check for its REST APIs.
This patch add a validation format "cidr" by porting Neutron's check from
https://github.com/openstack/neutron/blob/master/neutron/api/v2/attributes.py#L293

Partially implements blueprint v2-on-v3-api

Change-Id: I03601f8fa34fe7617e4f963cdfd4b178eae36565
Workflow documentation is now in infra-manual

Replace URLs for workflow documentation to appropriate parts of the
OpenStack Project Infrastructure Manual.

Change-Id: Ice00abcbb431b29e28beb0cd8810b8653ef66139
Remove except Exception cases

Replaced 'except Exception' cases with the specific exceptions
that the given code can throw in the util module. In some cases
we added extra unit test to cover the specific exception.

Change-Id: I980237ed9d27f122b4725b8c05015a81764dd6b8
Partial-Bug: #1223605
Remove needless workaround in utils module

Workaround for bug in netaddr library has been removed due to the fix
was introduced in 0.7.6 and nova currently requires 0.7.12 or newer version.

Change-Id: If83cd8ee770d57547f4cfcdbba4a9fbfd55d5983
Related-Bug: #957708
Libvirt normalize numa cell ids

This patch normalizes the cell ids before writing xml.
As cell ids are used to store host cell association,
they need to be normalized before writing xml, or otherwise
the xml will be invalid.

Change-Id: I9b565670f5b0ad24c7a5ff1853648594643b4c7a
Closes-bug: #1397381
Remove unused cinder code

The removed functions aren't used anywhere except in unit tests, so just
remove them.

Change-Id: Id52e8837152fa8654131ca79e50582e03622b765
Downgrade quota exceeded log messages

A user going over quota is a everyday occurrence, no need to log as a
warning. This information is only useful when trying to debug, so move
to debug level.

Change-Id: I6a59d62962ff660aec4898ad525c4b3c3b04faba
Cleanup timeutils override in tests/functional/test_servers

The ServersTest._force_reclaim helper method sets up a timeutils
override but never removes it. This allows the override to potentially
leak into other tests causing spurious failures in completely unrelated
tests.

Change-Id: I637a1dd6301e5645a47dbd65026acfab83e6ae26
Closes-bug: 1399817
Remove unnecessary timeutils override cleanup

The test cases never setup an override in timeutils so the cleanup
is unnecessary.

Change-Id: I54be56d631812be15c489df2b83fd1e750b9162b
Support macvtap for vif_type being hw_veb

This patch programs VLAN into a VF pci device, and properly
plug/unplug it into the instance.

Change-Id: I85eb3c1347d057d1f292e747f950065b8f394147
Closes-Bug: 1370348
Co-Authored-By: Itzik Brown <ItzikB@mellanox.com>
rename oslo.concurrency to oslo_concurrency

oslo.concurrency-0.3.0 has moved its path to oslo_concurrency,
the old path oslo.concurrency can still work but is deprecated now.

Change-Id: I1538dad5cbacf1e6041c571d5bc55994689c08b0
Closes-Bug: #1398656