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
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
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
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
Catch InstanceIsLocked exception on server actions

In v3, if the server is locked, a 409 error is raised, and the error msg
is like "the server is locked". In v2 now, the 409 error is raised too. But the
error msg is like "Instance is in an invalid state for \'pause(action name)\'".
The error msg is inappropriate, two points:
1. the state is valid for pause
2. the message doesn't tell that the instance is locked

The patch fixes the ploblem, and will do as v3. See the v3 commit:
2c9fca6a3c916f3f594ddbb1a8ee8946b8ea3ac7

Change-Id: I76572e37af686a4af35c31a3ea27f7070894b88a
Closes-Bug: #1255386
Correct network_device_mtu help string

This patch corrects the network_device_mtu help string. This setting
changes the mtu size for the interface not the vlan.

Change-Id: I2f3bcac42f08b70eb1649e3085c0de9af27b350c
Closes-bug: #1256696
Comply with new hacking 0.8 release

Fixes a couple of small issues to pass all PEP8 tests in
the new hacking release

H235  assert_ is deprecated, use assertTrue
H231  Python 3.x incompatible 'except x,y:' construct
H234  assertEquals is deprecated, use assertEqual
H301  one import per line
H302  import only modules
H233  Python 3.x incompatible use of print operator

Change-Id: I0e5e74944e2b034b223ada1b3d0be66f2a9a5722
Recover from build state on compute manager start-up

If a compute manager is stopped / fails during a build operation
then the instance will be left stuck with vm_state=BUILDING

During restart the one thing we can be sure about such instances
is that providing the task state is not SCHEDULING (i.e the request
is not still on the queue) then there is no thread running for this
instance.

In this case we can treat instances in this state as if they have
failed to spawn and put the into an ERROR state.

Closes-Bug: 1197024
Related to blueprint recover-stuck-state

Change-Id: I7b116d8154036c43b0feb23f5669f52358408d2b
Cleanup ec2/metadata/osapi address/port listen config option help

Commit d88cfbd changed the help for the osapi_compute_listen_port config
option but the grammar could be cleaned up a bit for not only that
option but the ec2 and metadata API IP address/port listening options in
nova.service, so this patch cleans them all up.

Change-Id: I66533d576046141bd3cd2f265dc2cfa6383c738d
Don't overwrite marker when checking if it exists

Checking for the existence of a marker overwrote which marker was being
checked for.  The string representation of the marker needs to be
retained so that a proper exception can be built.  So a new variable is
introduced which can be used to check for marker existence.

Change-Id: I81cfdceca3921c364cdeeccd24add14a6b1d0fd4
Closes-bug: 1257008
Merge "Cleanup ec2/metadata/osapi address/port listen config option help"
docker: access system_metadata as a dict

This bit of code causes a problem when moving to objects.  The Instance
object presents system_metadata as you would normally expect (a dict).
The data is in a different format when working with a db instance.  Use
the handy helper utility to normalize it into a dict.

Change-Id: Ieca9ab449a07374ed2c9cdaffdfd54783df7a866
Merge "Correct network_device_mtu help string"
Ensure proper notifications are sent when build finishes

An error condition was missing a notification, and one of the
notifications was incorrect.  Now all build failures will send a
notification and will send the correct notification based on what
occurred.

bp remove-cast-to-schedule-run-instance

Change-Id: Ibffe35da221730283b8ad3016a25dd42b5526f37
Merge "Don't overwrite marker when checking if it exists"