Handle ExternalNetworkAttachForbidden exception

When creating an instance and assigning a public network
to it without admin authority, ExternalNetworkAttachForbidden
will be raised. But this exception is not handled in V3 api.

Change-Id: Id70d8eaa704fd82cef1afdb65756d75cb56fbdce
Closes-Bug: #1353949
Convert v3 ExtendedAvailabilityZone api to v2.1

This patch changes v3 ExtendedAvailabilityZone 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: I49baff38b7a9dabd40550267c2119fe84137594f
Add API schema for v2.1 access_ips extension

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: I495e7538e5d8d67f19792dfa0427ab7a1b0068cf
virt: use compute.arch constants and validate architectures

Where we have hardcoded architectures, use the compute.arch
constants. Where we get architectures from external systems
or users, validate them against the list of acceptable names.

The Xen hypervisor is reporting 'i686' architecture with the
unusual name 'x86_32' so must be converted to use the normal
name. Upon upgrade the existing data in the compute nodes
table will be upgraded by the periodic refresh of compute
node information.

On the other side, the ImagePropertiesFilter will canonicalize
the architecture it fetches from image metadata, so that
'x86_32' gets remapped to 'i686' during comparison.

Closes-bug: #1348624
Change-Id: I1adfb0a2258a628004aaa28c1ac04c4cf3d3eea6
compute: add get_serial_console in manager.py

Adds method get_serial_console and updates
validate_console_port to refer the new method in
virt/driver get_serial_console

Co-Authored-By: Ian Wells <iawells@cisco.com>
Co-Authored-By: Sushma Korati <sushma_korati@persistent.co.in>
Co-Authored-By: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@redhat.com>

Partial-Implements: blueprint serial-ports
Change-Id: Id1153e2d370463872eedd3988503457435b228f5
compute: add get_serial_console rpc and cells api calls

Co-Authored-By: Ian Wells <iawells@cisco.com>
Co-Authored-By: Sushma Korati <sushma_korati@persistent.co.in>
Co-Authored-By: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@redhat.com>

Partial-Implements: blueprint serial-ports
Change-Id: If79255be351e76fb4c4f671c929b71ce822a9db2
api: add serial console API calls v2

Adds a new REST APIv2 to call service serial console

Co-Authored-By: Ian Wells <iawells@cisco.com>
Co-Authored-By: Sushma Korati <sushma_korati@persistent.co.in>
Co-Authored-By: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@redhat.com>

Patial-Implements: blueprint serial-ports
Change-Id: I35d94c1924caa9cbc0fcdd9c637d28e95ff31ab2
Move to oslo.db

Replace common oslo code nova.openstack.common.db by usage
of oslo.db library and remove common code.

Replaced catching of raw sqlalchemy exceptions by catches
of oslo.db exceptions(such as DBError, DBDuplicateEntry, etc).

Co-Authored-By: Eugeniya Kudryashova  <ekudryashova@mirantis.com>

Closes-Bug: #1364986
Closes-Bug: #1353131
Closes-Bug: #1283987
Closes-Bug: #1274523
Change-Id: I0649539e071b2318ec85ed5d70259c949408e64b
Import Ironic Driver & supporting files - part 1

Import the Ironic virt driver and supporting files (client lib wrapper
and state mapping), as well as relevant unit tests, as of commit
da967d77894be6f23d81fb5cc948f9d13898ba84

This is the dicing up of review/103167 into smaller chunks
ready for review.

Change-Id: If1f51c97212f687dd0d4d4044e9dbf7a90335e75
Co-authored-by: Adam Gandelman <adamg@ubuntu.com>
Co-authored-by: Andrey Kurilin <akurilin@mirantis.com>
Co-authored-by: ChangBo Guo(gcb) <eric.guo@easystack.cn>
Co-authored-by: Chris Behrens <cbehrens@codestud.com>
Co-authored-by: Chris Krelle <nobodycam@gmail.com>
Co-authored-by: David Shrewsbury <shrewsbury.dave@gmail.com>
Co-authored-by: Devananda van der Veen <devananda.vdv@gmail.com>
Co-authored-by: Dmitry Tantsur <dtantsur@redhat.com>
Co-authored-by: Jim Rollenhagen <jim@jimrollenhagen.com>
Co-authored-by: Lucas Alvares Gomes <lucasagomes@gmail.com>
Co-authored-by: Matthew Gilliard <matthew.gilliard@hp.com>
Co-authored-by: Mikhail Durnosvistov <mdurnosvistov@mirantis.com>
Co-authored-by: Pablo Fernando Cargnelutti <pablo.fernando.cargnelutti@intel.com>
Co-authored-by: Robert Collins <rbtcollins@hp.com>
Co-authored-by: ryo.kurahashi <kurahashi-rxa@necst.nec.co.jp>
Import Ironic Driver & supporting files - part 2

Import the Ironic virt driver and supporting files (patcher), as
well as relevant unit tests, as of commit
da967d77894be6f23d81fb5cc948f9d13898ba84

This is the dicing up of review/103167 into smaller chunks
ready for review.

Co-authored-by: Adam Gandelman <adamg@ubuntu.com>
Co-authored-by: Andrey Kurilin <akurilin@mirantis.com>
Co-authored-by: ChangBo Guo(gcb) <eric.guo@easystack.cn>
Co-authored-by: Chris Behrens <cbehrens@codestud.com>
Co-authored-by: Chris Krelle <nobodycam@gmail.com>
Co-authored-by: David Shrewsbury <shrewsbury.dave@gmail.com>
Co-authored-by: Devananda van der Veen <devananda.vdv@gmail.com>
Co-authored-by: Dmitry Tantsur <dtantsur@redhat.com>
Co-authored-by: Jim Rollenhagen <jim@jimrollenhagen.com>
Co-authored-by: Lucas Alvares Gomes <lucasagomes@gmail.com>
Co-authored-by: Matthew Gilliard <matthew.gilliard@hp.com>
Co-authored-by: Mikhail Durnosvistov <mdurnosvistov@mirantis.com>
Co-authored-by: Pablo Fernando Cargnelutti <pablo.fernando.cargnelutti@intel.com>
Co-authored-by: Robert Collins <rbtcollins@hp.com>
Co-authored-by: ryo.kurahashi <kurahashi-rxa@necst.nec.co.jp>

Change-Id: I50fdaa333959c5bad124c3791f48948beed1d439
Import Ironic Driver & supporting files - part 3

Import the Ironic virt driver and supporting files (driver part 1 -
infrastructure, list functions, power functions), as
well as relevant unit tests, as of commit
da967d77894be6f23d81fb5cc948f9d13898ba84

This is the dicing up of review/103167 into smaller chunks
ready for review.

Also added in the new power_off function signature as per
https://review.openstack.org/#/c/116093

Change-Id: I7cb9066564f939ec5d873d86915ad17d03983dc5
Co-authored-by: Adam Gandelman <adamg@ubuntu.com>
Co-authored-by: Andrey Kurilin <akurilin@mirantis.com>
Co-authored-by: ChangBo Guo(gcb) <eric.guo@easystack.cn>
Co-authored-by: Chris Behrens <cbehrens@codestud.com>
Co-authored-by: Chris Krelle <nobodycam@gmail.com>
Co-authored-by: David Shrewsbury <shrewsbury.dave@gmail.com>
Co-authored-by: Devananda van der Veen <devananda.vdv@gmail.com>
Co-authored-by: Dmitry Tantsur <dtantsur@redhat.com>
Co-authored-by: Jim Rollenhagen <jim@jimrollenhagen.com>
Co-authored-by: Lucas Alvares Gomes <lucasagomes@gmail.com>
Co-authored-by: Matthew Gilliard <matthew.gilliard@hp.com>
Co-authored-by: Mikhail Durnosvistov <mdurnosvistov@mirantis.com>
Co-authored-by: Pablo Fernando Cargnelutti <pablo.fernando.cargnelutti@intel.com>
Co-authored-by: Robert Collins <rbtcollins@hp.com>
Co-authored-by: ryo.kurahashi <kurahashi-rxa@necst.nec.co.jp>
Import Ironic Driver & supporting files - part 4

Import the Ironic virt driver and supporting files (driver part 2 -
validation, spawn, destroy, further getters), as well as relevant
unit tests, as of commit da967d77894be6f23d81fb5cc948f9d13898ba84

This is the dicing up of review/103167 into smaller chunks
ready for review.

Incorporating the bug fix https://review.openstack.org/#/c/118189

Change-Id: If1d966c937c56a8dbf27588b94462c0a71759cca
Co-authored-by: Adam Gandelman <adamg@ubuntu.com>
Co-authored-by: Andrey Kurilin <akurilin@mirantis.com>
Co-authored-by: ChangBo Guo(gcb) <eric.guo@easystack.cn>
Co-authored-by: Chris Behrens <cbehrens@codestud.com>
Co-authored-by: Chris Krelle <nobodycam@gmail.com>
Co-authored-by: David Shrewsbury <shrewsbury.dave@gmail.com>
Co-authored-by: Devananda van der Veen <devananda.vdv@gmail.com>
Co-authored-by: Dmitry Tantsur <dtantsur@redhat.com>
Co-authored-by: Jim Rollenhagen <jim@jimrollenhagen.com>
Co-authored-by: Lucas Alvares Gomes <lucasagomes@gmail.com>
Co-authored-by: Matthew Gilliard <matthew.gilliard@hp.com>
Co-authored-by: Mikhail Durnosvistov <mdurnosvistov@mirantis.com>
Co-authored-by: Pablo Fernando Cargnelutti <pablo.fernando.cargnelutti@intel.com>
Co-authored-by: Robert Collins <rbtcollins@hp.com>
Co-authored-by: ryo.kurahashi <kurahashi-rxa@necst.nec.co.jp>
Merge "Handle ExternalNetworkAttachForbidden exception"
Merge "Import Ironic Driver & supporting files - part 1"
VMware: Remove VMwareVCVMOps

This support is no longer needed as we only support the VC driver
since commit 1deb31f85a8f5d1e261b2cf1eddc537a5da7f60b.

The patch makes use of VMwareVMOps. All of the specific VC methods
are moved into this class.

partial blueprint vmware-spawn-refactor

Change-Id: Ieb2198a956853c75855e3b4441cc3a893b2e6079
Merge "Move to oslo.db"
Merge "compute: add get_serial_console in manager.py"
Merge "compute: add get_serial_console rpc and cells api calls"
Merge "api: add serial console API calls v2"
Merge "Convert v3 ExtendedAvailabilityZone api to v2.1"