Handle exception better in v2.1 attach_interface

Add more information when exception occurs in attach interface at Nova
v2.1 API layer.
The commit I7402cfc28d4ee7989c7eb054556df57918bbaeee has been merged
for v2.0 API, this patch does the same change for v2.1 API.

Partially implements blueprint v2-on-v3-api

Change-Id: I1b175501e6db48f27a894db2e66e09d31f8b50e2
Compute: catch more specific exception for _get_instance_nw_info

There are cases when the method _heal_instance_info_cache tries to
update the network cache. The problem here is that the instance no
longer exists. The exception handling was very broad. This adds
treatment for the specific exception.

Change-Id: I04372cec81fde6ef06e9d7f2b59c1e47e15c0905
Closes-bug: #1385246
scheduler: Remove assert on the exact number of weighers

Since the weighers code is by design pluggable, downstream packagers may have
added additional weigher classes, causing this assert to fail.

Rather than require downstream maintain a patch against this line, the
proposal is to remove it since the asserts after it are sufficient.

Change-Id: I13765fae188af92a2e729dcd14caf981db01acb4
Return HTTP 400 if use invalid fixed ip to attach interface

When posting an 'attach interface' request to Nova with an invalid fixed ip,
Nova need to return HTTP 400, instead of HTTP 500, in order to inform the
user to correct the fixed ip in HTTP request. It is an API v2 only problem.

Change-Id: I34fc813f38b463460c59672e6c3364aea9ef347d
Closes-Bug: 1365579
Make test_quotas compatible with nosetests

Nosetests detects any function that ends with `test` as a test function which
causes `is_v20_api_test` to be run as a test. This fails because `plugin`
won't be defined yet.

In the interest of being developer friendly and supporting this common
test-runner, we should prefix with an underscore so it doesn't get picked up
as an actual test.

Change-Id: I0802b9f2271cc6f555a409784cfb52911098c2d6
Make test_security_groups nose compatible

With nose, `TestNeutronSecurityGroupRulesBase` will be picked up as an actual
test because it starts with `Test`. Since this is an abstract class, we should
prefix it with an underscore so we don't run those tests directly, rather, run
them in their concrete subclasses instead.

Change-Id: Ifa96152ef71b2b27d8b8c76e25a4136186831032
libvirt: safe_decode domain.XMLDesc(0) for i18n logging

domain.XMLDesc(0) can return a utf-8 encoded string which will cause a
UnicodeDecodeError when substituting the variable in the _LE unicode
translated Message object in oslo.i18n.

This change simply decodes domain.XMLDesc(0) before passing it onto the
logging method when used with a translated message.

Closes-Bug: #1388386

Change-Id: Id56d6564cfb15cc479e664020ae6f1c82acacb09
Merge "Make test_quotas compatible with nosetests"
Merge "Make test_security_groups nose compatible"
Fix instance_usage_audit_log test to use admin context

Nova V2 API 'os-instance_usage_audit_log' is for admin only
and Nova policy.json has rule for the same But
test_instance_usage_audit_log tests this API as non admin.

This patch fix test_instance_usage_audit_log test to use admin
context.

Also adding some more tests to verify this API with non-admin context.

Closes-Bug: #1387901

Change-Id: I20a477786ef0f3e1132629c4a12af40524e2b09f
Merge "libvirt: safe_decode domain.XMLDesc(0) for i18n logging"
Merge "Compute: catch more specific exception for _get_instance_nw_info"
Merge "Handle exception better in v2.1 attach_interface"
virt: introduce types VirtPageSize and VirtPagesTopology

Introduces a new types VirtPageSize and VirtPagesTopology

Work-item: Enhance libvirt driver to report available
           large pages per NUMA node in the host state data

Change-Id: I4a52bd204930245bd0539210a7f703efdeb06542
Partial-Implement: blueprint virt-driver-large-pages
hardware: fix in doctstring the memory unit used

The unit used to handle memory is MiB not KiB

Change-Id: I49de12d0011cff8e4465759d17b502a821bb9740
hardware: introduce VirtNUMATopologyCellInstance

Introduces a new class VirtNUMATopologyCellInstance which extends
VirtNUMATopologyCell used to handle cells of VirtNUMAInstanceTopology
Also this commit make VirtNUMATopologyCell an abstract class.

Work-item: Enhance libvirt driver to report available
           large pages per NUMA node in the host state data

Change-Id: Icac19c17caec98ae31c039a2b22a7c1de546d9a2
Partial-Implement: blueprint virt-driver-large-pages
hardware: make cell instance topology to handle memory pages

Updates VirtNUMATopologyCellInstance to take into account
account pagesize information

Work-Item: Enhance libvirt driver to report available
           large pages per NUMA node in the host state data

Partial-Implement: blueprint virt-driver-large-pages
Change-Id: Ib8772bff16f6ba58a6266a2ef40b9d81b1d7f00a
object: update instance numa object to handle pagesize

Work-item: Enhance libvirt driver to report available
           large pages per NUMA node in the host state data

Partial-Implement: blueprint virt-driver-large-pages
Change-Id: I392bdc45aa3b6b169c1d1bfdada624a16c77c91c
Neutron: remove deprecated config options

Commit 5cacad3508570ce70b1f9ef620e0508169687fda and
commit c2697f8735a38fb05d54ff4f82110829ead85ee9 deprecated
configuration options in Juno. These have now been removed.

Change-Id: I1496ccd1e855c6a0eac4c1825305847e61cc1bcb
Cinder: remove deprecated configuration options

Commit d55dfc6d0d86157832d016243cb5e7a736f2495a deprcated
configuration options. These have been removed.

Change-Id: I96c3172266ea382ee405dc67b696355b97fa1fec