VMware: Do not read opaque type for DVS network

Save backend calls when using DVS VIF type. There is no need to
get the opaque network in the event that we have a DVS network.

Change-Id: I75973005193f862dfde3b99167cb53d3114a8349
Deprecate cinder_* configuration settings

Create a new section in the configuration file called 'cinder'.
Move all of the cinder_* configuration settings to this section.

DocImpact

The table below has the changes:

+---------------------------------+----------------------------+
| 'DEFAULT' Section               | 'cinder' Section           |
|---------------------------------|----------------------------|
| cinder_catalog_info             | catalog_info               |
| cinder_endpoint_template        | endpoint_template          |
| os_region_name                  | os_region_name             |
| cinder_ca_certificates_file     | ca_certificates_file       |
| cinder_http_retries             | http_retries               |
| cinder_http_timeout             | http_timeout               |
| cinder_api_insecure             | api_insecure               |
| cinder_cross_az_attach          | cross_az_attach            |
+---------------------------------+----------------------------+

UpgradeImpact
The changes are backward compatible.

Change-Id: Ie6b3f9d60b5e149375ff3039be444538f5f50756
Use v2.1 URLs instead of v3 ones in API unit tests

Now v2.1 API unit tests use fake.wsgi_app_v3() and they specify v3 URLs.
This patch adds wsgi_app_v21() for using v2 URLs in v2.1 API tests and
changes URLs in unit tests.

Partially implements blueprint v2-on-v3-api

Change-Id: I5cdd7dd1d435ab0e4e093168f01e96f8dac52e8c
Let update_available_resource hit slave

Deployments that have a slave_connection configured can offload
read queries generated by this periodic task there. For
deployments with no slave, behavior remains the same.

Change-Id: Ie663ccc4e3e4334af4bdf75a95689c41ecc959b9
Blueprint: juno-slaveification
Change v3 availability-zone API to v2.1

This patch changes v3 availability-zone API to v2.1 and makes v2
unit tests share between v2 and v2.1.

The differences between v2 and v3 are described on the wiki page
https://wiki.openstack.org/wiki/NovaAPIv2tov3.

Partially implements blueprint v2-on-v3-api

Change-Id: Ifbd152e431d182a5ccabac7fcc84fcc8a2fc6e5a
Adds nova-idmapshift cli utility

nova-idmapshift will be used by the libvirt-lxc driver to
correctly shift ownership of instance rootfs for use with
user namespaces.

Partially implements: bp libvirt-lxc-user-namespaces

Change-Id: I9aee622cca4578149201f02d02231a7bd0cbe912
Change v3 version API to v2.1

This patch changes v3 version API to v2.1 and makes v2 unit tests
share between v2 and v2.1.
v2.1 API does not support XML format. Unit tests related to XML
don't work against v2.1.

Partially implements blueprint v2-on-v3-api

Change-Id: I7abadb0c9082b9e90a98938967f0e27d1a2fa766
Convert multiple-create v3 plugin to v2.1

Changes required to have the multiple create v3 plugin natively
support the v2.1 API. The following Server creation parameters
are reverted:

os-multiple-create:min_count -> min_count
os-multiple-create:max_count -> max_count
os-multiple-create:return_reservation_id -> return_reservation_id

Removes min_count parameter for a test which should never have
been included but due to a gap in input validation was ignored.

Partially implements blueprint v2-on-v3-api

Change-Id: Ie435c357958066e9fde40eab54826261ee9d4226
InstanceNUMAToplogy object create remove uuid param

We can get this from the object attribute so no need to pass it in
explicitly.

We do not need to bump the version of the object as there is no code
calling it as of yet, so we do not have to support the broken method
interface until the next major version bump.

Change-Id: I96e1d958e907272d94d7ca6481592b79ea6b6397
Blueprint: virt-driver-numa-placement
Add API schema for v2.1 "create a server" API

By defining the API schema, it is possible to separate the validation
code from the API method. The API method can be more simple.
In addition, a response of API validation error can be consistent for
the whole Nova API.

Partially implements blueprint v3-api-schema

Change-Id: Ic17d2227909c9180ca86c9d578dad4c73ec57dfc
virt: setup TCP chardevice in libvirt driver

Setup the tcp chardevice in the libvirt driver based on the
configuration (if the serial consoles are enabled) and disable the
logging to a file since we have an interactive console.

A new image property is introduced: hw_serial_port_count
A new flavor extra spec is introduced: hw:serial_port_count

Co-Authored-By: Vladan Popovic <vpopovic@redhat.com>
Co-Authored-By: Ian Wells <iawells@cisco.com>
Co-Authored-By: Sushma Korati <sushma_korati@persistent.co.in>

DocImpact
Partial-Implements: blueprint serial-ports
Change-Id: Ic6d24e27d61f600a90ed8fccb525d8b82725903e
console: add typed console objects

Adds typed console objects used by virt driver API to
return information about consoles.

Also updates virt drivers to use them.

Closes-Bug: #1361611
Change-Id: I8f6a857b88659ee30b4aa1a25ac52d7e01156a68
Convert migrate_server v3 plugin to v2.1

Changes required to have v3 plugin natively support
the v2 API.

The migrate_live action is reverted back to os-migrateLive

Partially implements blueprint v2-on-v3-api

Change-Id: Ib3332ecfbf47ed6cad6108399083f0c26b7eebfe
Port v2 images extension to work in v2.1(v3) framework

Ports v2 images extension and adapts it to the v2.1/v3 API
framework. API behaviour is identical with the exception
that there is no support for XML. Also

- unittest code modified to share testing with both v2/v2.1
  where appropriate
- Adds expected error decorators for API methods

Partially implements blueprint v2-on-v3-api

Change-Id: I7b15a56f41612e3bbf5d59c3ad44fd32386ff315
Port limits extension to work in v2.1/v3 framework

Ports v2 limits extension and adapts it to the v2.1/v3 API
framework. API behaviour is identical with the exception that
there is no support for rate limiting since no one uses that
seriously anyway.

- unittest code modified to share testing with both v2/v2.1
- Adds expected error decorators for API methods

Partially implements blueprint v2-on-v3-api

Change-Id: I072d364f4d2a92a02801862435f11417956d2dc0
vmwareapi oslo.vmware library integration

These are the minimal changes necessary to integrate the vmwareapi
driver with the oslo.vmware code. Much of the change is mechanical
switching to call the library code, and removing obseleted code in the
driver where appropriate.

Effort was made to minimize the amount of actual driver code changes in
this round by keeping a small amount of shim code. Existing unit tests
were modified as appropriate. Additional patches will be introduced
shortly to include additional conversions and tests.

Summary of changes:

- use common/vmware/exceptions.py
- use oslo.vmware vim.py for the Vim implemenation
- use oslo.vmware api.py for api invocation/session
- updated existing unit tests
- nova retains its own version of get_{soap/wsdl}_url which using conf
  settings for default and overrides.

blueprint use-oslo-vmware
Co-authored-by: Radoslav Gerganov <rgerganov@vmware.com>
Co-authored-by: Davanum Srinivas <dims@linux.vnet.ibm.com>
Change-Id: Idab7778d4c7e5e7099d842debbcbc009cf9127b6
Port volumes extension to work in v2.1/v3 framework

Ports v2 volumes extension and adapts it to the v2.1/v3 API
framework. API behaviour is identical with the exception
that there is no support for XML. Also

- unittest code modified to share testing with both v2/v2.1
  where appropriate
- Adds expected error decorators for API methods

Note that there will be further code cleanup in the future
but the code currently is mostly as-is from the v2 codebase.

Partially implements blueprint v2-on-v3-api

Change-Id: If2a9dd1f5233812a1177b54ded6f0ae115c54e97
Convert v3 servers return_reservation_id behaviour to v2.1

Changes return reservation id format on server create to
the v2.1 format.

Adds api sample tests for the os-multiple-create plugin

Partially implements blueprint v2-on-v3-api

Change-Id: I148cce80fb4b19a4240e00ca206fcb7bac20f357
Convert server_usage v3 plugin to v2.1 API

Changes required to have v3 plugin natively support the V2.1
API.

The parameters is changed from os-server-usage to OS-SRV-USG

Partially implements blueprint v2-on-v3-api
Co-Authored-By: Chris Yeoh <cyeoh@au1.ibm.com>

Change-Id: I4a4ebe533f8910a29b54d6ec9554cc151af492d1
Convert v3 hypervisor plugin to v2.1

This patch convert v3 hypervisor plugin to v2.1 and makes v2
unit tests share between v2 and v2.1.

Unit tests has been modified in optimized way.

The differences between v2 and v3 are described on the wiki page
https://wiki.openstack.org/wiki/NovaAPIv2tov3.

Partially implements blueprint v2-on-v3-api

Change-Id: I23ffc10d4c0170cb43ef8aeebf69ae2794a08827