add hints to api_samples documentation

Based on my own experience and questions I recently answered in
the openstack-nova channel, these hints could help developers.

Change-Id: Id7350f1a6a834b0de8456fdc28c2db890f2971de
Fix AttributeError(s) from get_v4/6_ips_by_interface

Add some defensive code to prevent AttributeError especially
when virtual_interface_get_by_uuid returns None. Add some basic
tests for good and bad data returned from
virtual_interface_get_by_uuid

Change-Id: I0ee1bb2087a6ed2619ac343534e4ade84e08d9bd
Closes-Bug: 1246087
Add flavor-access to core for V3 API

Adds the flavor-access plugin to the core list for the V3 API.
This is part of the process of adding all of the flavor related
extensions to core, with the exception of rxtx, as per the discussion
here: https://etherpad.openstack.org/p/NovaV3APICore

Note that since the alias changes from os-flavor-access to flavor-access
the api samples move directory and quite a few of other api samples
as well as flavor access is included by default.

Partially implements blueprint nova-v3-api

DocImpact

Change-Id: I9abc7df8f4620d462b0d381a2c0ed180c48f220e
Add flavor-extra-specs to core for V3 API

Adds the flavor-extra-specs plugin to the core list for the V3 API.
This is part of the process of adding all of the flavor related
extensions to core, with the exception of rxtx, as per the discussion
here: https://etherpad.openstack.org/p/NovaV3APICore

Partially implements blueprint nova-v3-api

Change-Id: Id4b4fad5e584bdf2bbbaaae579a07e28c312ef34
Remove used_limits extension from the V3 API

Remove the used_limits extension from the V3 API because
it shows usage for limits which are no longer going to be displayed
by the limits extension. See https://review.openstack.org/#/c/39872/
The limits are not being displayed there because they are already
available through the quotas extension.

Although the quotas extension currently only displays the quota limit
and not usage, the following proposed changeset adds display
of usage: https://review.openstack.org/#/c/32303/. And this is done
in a way which is much more consistent in terms of naming and interface
than used_limits does.

So we no longer need the used_limits extension

Partially implements blueprint nova-v3-api

Change-Id: I8ec1f300335ca4fc3b86323cc3af6bc1591da7bb
Removed unused instance object helper function

Remove code that is no longer used

Change-Id: Iaf99824ad28aa03206a997e69d9f6097ba034941
Remove V3 API version of coverage extension

As discussed at the summit in the QA session, this removes
the coverage extension from the V3 API. The coverage extension
doesn't work properly and has security issues. An alternative technique,
though more limited in nature will soon be proposed.

Partially implements blueprint nova-v3-api

Change-Id: Ib4296288fefeb7e1e11bb6e44bd1cf355f29b9b9
Remove V2 API version of coverage extensions

As discussed at the summit in the QA stream, this removes
the coverage extension from the V2 API.

According to the API Change Guidelines
https://wiki.openstack.org/wiki/APIChangeGuidelines
we should not be doing this. However the coverage
extension is a rather special case. It has security issues
such that it shouldn't be used in a production cloud
environment. It also doesn't work properly so its usefulness
to measure API coverage is limited. And in the past the presence of
this plugin has been used as a reason not to accept
an alternative technique to measure API coverage.

This is the proposed replacement

https://review.openstack.org/#/c/25882/

Change-Id: I07d798129ee277a6f7691c25f88c07a5204c0943
Add a driver method to toggle instance booting

Add a driver method to toggle the ability to boot an instance.

The only implementation provided is for the xenapi virt driver.  Other
drivers will log a warning and treat the method as a no-op.

Implements: blueprint cleanup-running-deleted-shutdown

Change-Id: Ie448c681d653b126cb12d3a48d79ab4febde8828
VMware: add support for VM diagnostics

The drivers now return diagnostics for a requested VM.

Implements blueprint vmware-vm-diagnostics

VMware specific keys will be namespaced.

DocImpact

Change-Id: I08f199f7e3b4edafe60ce73d2fc833f8c5a5574e
objects: declare some methods as static

A lot of code is composed of static methods, but they are not declared
as is.

Change-Id: I64be630b560e331aed9d1ab9a68152da52eb0d82
handle migration errors

handle errors:
   MigrationPreCheckError, NoValidHost,
   InvalidSharedStorage and InvalidLocalStorage
in _migrate_live so that the 'reason' is passed up

Closes-Bug: 1250523

Change-Id: I3d7e0626223f2606c5e7205e5022e26585506cfb
Use of logging in native thread causes deadlock connecting to libvirtd

When connecting to libvirtd daemon we were calling the _connect
method in a native thread. The use of logging in this method hit this
bug in eventlet https://bitbucket.org/eventlet/eventlet/issue/137/
causing nova-compute to hang.

Closes-Bug: #1252409

Change-Id: I0d22c3ed1b3288aeb1afae130f11a4f38dc6440a
Removes check CONF.dhcp_options_enabled from nova

* Neutron supports extra_dhcp_opts since Havana
* Hence remove boolean check dhcp_options_enabled

Closes-Bug: #1214162
DocImpact
Change-Id: I9af217a87a237e078e70332cbed1c80ad4d5db0a
baremetal: Make api validate mac address

Check if the address in the form of xx:xx:xx:xx:xx:xx.

Closes-Bug: 1238595
Change-Id: Idcba745a011604d7664b62d88f1dede88d10443d
ComputeFilter shouldn't generate a warning for disabled hosts

Disabling a service is a normal operation, so this state should
not be included in the same log statement as a host that fails
the service_is_up() check.

A service which is enabled but not up deserved a warning rather
than debug entry.

By separating out the checks we also avoid the service check on
disabled hosts.

Change-Id: I1a398bc033ebe71f42ac117af7dae39502aceede
Closes-Bug: 1254356
Pass Instance object to spice compute rpc api

Update the get_spice_console() method of the compute rpc api to take in
an Instance object instead of a dict.  The object_compat() decorator is
used to maintain backwards compatibility with receiving a dict.

Change-Id: I0bafe18d9c8bffcd0b72629542fbf7aedacdfbb4
Remove duplicate FlavorNotFound exception handling in server create API

The v2 and v3 openstack server create APIs have duplicate handling for
the FlavorNotFound exception. This patch removes the duplicate handling
which is found in a generic catch-all block for each API.

Closes-Bug: #1256427

Change-Id: I78344cd588178c501398147f3afcd418e0744b0d
Move flags in libvirt's volume to the libvirt group

This change continues moving libvirt specific flags into a libvirt
specific configuration group.

Progresses blueprint libvirt-opts-group.

DocImpact: the following flags have moved into the libvirt group:
    num_iscsi_scan_tries
    num_iser_scan_tries
    rbd_user
    rbd_secret_uuid
    nfs_mount_point_base
    nfs_mount_options
    num_aoe_discover_tries
    glusterfs_mount_point_base
    iscsi_use_multipath (formerly libvirt_iscsi_use_multipath)
    iser_use_multipath (formerly libvirt_iser_use_multipath)
    scality_sofs_config
    scality_sofs_mount_point
    qemu_allowed_storage_drivers

Change-Id: I78941aff4bf49fc70d91a3239deff44dbaaab6c9
Remove _security_group_chain_name from nova/virt/firewall.py

The function _security_group_chain_name in nova/virt/firewall.py is
useless for now, just remove it.

Change-Id: I1ad7050115ad56ce7b152efbcfcc42aff8e6c3ed