Make sure report_interval is less than service_down_time

If service_down_time is less than report_interval, services will
routinely be considered down, because they report in too rarely.
Add check for service_down_time vs report_interval, if report_interval
is larger than service_down_time, automatically change
service_down_time to be report_interval * 2.5

DocImpact

Closes bug #1255685

Change-Id: I1be42e1826142b8f3f2c39f3734bef713a12a693
Clean swap_volume rollback, on libvirt exception.

Handling swap_volume command's rollback on the manager side
instead of the API, to allow clean rollback.

Change-Id: I7d5c1e66bf01fd12fcaa783c1c3c90d92b009aea
Closes-Bug: #1222656
Make _change_index_columns use existing utility methods

The _change_index_columns method is doing a drop/add index operation and
since we have utility methods to do exactly that already, just re-use
them.

Change-Id: I5706c4512b1324aab64f70cd053c464d9a50e233
API schema for v3 console_output 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 nova-api-validation-fw

Change-Id: Id6330e2250448c54679df4f27af25c2614a871f0
Remove unused code

Remove unused code in V2 and V3 nova certificates create function.

Change-Id: I84f36a2fcb53f0c8c6b2486a37851922805bca13
Alphabetize core list for V3 API plugins

Alphabetize list and one line per plugin for future managability.
Deferred from a review comment on a previous changeset:

https://review.openstack.org/#/c/53104/3/nova/api/openstack/__init__.py

Partially implements blueprint nova-v3-api

Change-Id: Iedfae644b97369cc9694df7a10444311418fffd0
Fix the flavor_ref type of unit tests

Some unit tests define a flavor_ref as tuple type, that seems typo.
This patch fixes it.

Change-Id: I8edd93be630ca78b4a4b33a1544b7421a244ae3f
VMware: use .get() to access 'summary.accessible'

the key 'summary.accessible' is not always present in
property-sets hence use .get() instead of []

Change-Id: Ia291b39d1322c486be13f677a816168b501de3fb
Closes-Bug: 1252400
XenAPI: Use get_VALUE in preference to get_record()['VALUE']

Replaces calls to get_record where only a single item is retrieved
from the record with the specific get_VALUE call.

Change-Id: I52e20c4f4c9d6a6ad019694916ee057cc96b18a6
VMware: fix image snapshot with attached volume

A snapshot of a instance with an attached volume will result in
the wrong volume being uploaded to glance. The reason for this
are as follows:
1. the last image in the list of images would be exported
2. the base image would not be exported but the first found

The same happens with a VM rescue if there is a cinder volume
attached.

The solution is to search for an image that contains the instance
UUID.

Change-Id: Ic85b0ffd4f1c34f10d07b1a198eaad2030803d6f
Closes-bug: #1243193
Ignore 'dynamic' addr flag on bridge configuration

When setting the bridge up, if that flag is present but not
ignored, the delete command will fail and may leave the
interface and the bridge in an inconsistent state.

Closes-Bug: #1274611
Related-Bug: #1077066
Change-Id: Iff65d61d724d0de5d8173ac37f7f748aa23e5d8b
Make nova-network use FixedIP object for associations

This makes nova-network manager use the FixedIP.associate*
calls instead of going direct to the database.

Related to blueprint nova-network-objects

Change-Id: I60f287f10bee45980e3671d73102a582c805436f
Fix a bug in v3 API doc

This patch changes the wrong variable names 'addFixedIp' and 'networkId',
which were not used in V3 multinic API. We use 'add_fixed_ip' and
'network_id' in V3 multinic API.

Closes-bug: #1265716

Change-Id: I0c91764603d941df6d011a3b1266eb354c0bc54f
VMware: Remove some unused variables

Remove unused variables from the following files:

* nova/tests/virt/vmwareapi/test_driver_api.py
* nova/virt/vmwareapi/driver.py
* nova/virt/vmwareapi/volumeops.py

There is no design to the above selection of files: this is simply as
I have encountered them.

Change-Id: I43ee2f71edf5872bfe1b1fe010e83435689501bb
Remove get_instance_type and get_active_by_window from nova compute API

Commit 013b301c1c makes both methods vestigial since the
simple_tenant_usage API was the only thing using them.

Change-Id: Idbe8183760edd57b58564761c30f2f6e3ad0086e
Add serializer capability to fake_notifier.

With the change to oslo.messaging.notify.Notifier, we have
introduced the serializer plugin.  In some implementations
this is used to modify the notfications/serialize data.  The
implementations will want to test their serializers and
the easiest way to do this is via the fake_notifier.
This change allows fake_notifier to act more like
notifier with serializer being a pass in as an argument.

The serializer is passed to subnotifiers created via
the prepare method.

Change-Id: I03ef9ed92366961d4e296381d149c54d7da97f70
Fix bittorrent URL configuration option

This change modifies bittorrent to give URL setting preference to the
configuration option first and then to entry point addins.  The thought
process is that users will want the ability to change the URL
via configuration.  The entry point is code and slower to address.

If the user really wants to use the entry point, they can leave
the configuration option empty.

Existing test cases updated to reflect new priority.

Change-Id: I5af94b4b50531fc7801e70d83b89dd7ed2bcf310
Define common "name" parameter for Nova v3 API

Nova v3 API contains 'name' parameters such as aggregate, backup,
flavor, keypair and server. The validation way of each parameter
is different like the following because of just porting it from v2
APIs:

  Resource  | Length  | Pattern
 -----------+---------+----------------------------------
  aggregate | 1-255   | nothing
  backup    | nothing | nothing
  flavor    | 1-255   | '^[a-zA-Z0-9. _-]*[a-zA-Z0-9_-]+
            |         |   [a-zA-Z0-9. _-]*$'
  keypair   | 1-255   | '^[a-zA-Z0-9 _-]+$'
  server    | 1-255   | nothing

All of them are stored in the DB, and it would make APIs consistent if
applying the same validation way to all APIs.

This patch adds the validation way for all 'name' parameters.

Partially implements blueprint nova-api-validation-fw

Change-Id: I05391a03f383cac1d475cd4266cf7f5ced664f9e
Make change_instance_metadata() use objects

This patch makes the compute manager change_instance_metadata()
method take an instance object.

Related to blueprint compute-manager-objects

Change-Id: I4139ef8db87bb42cc05cbfb7cbe38aea27235f8b
Revert "Allow deleting instances while uuid lock is held"

This reverts commit 08beabc5e0fc3fffc074a634040f5821d4d1d5f2.

This patch creates race condition issues in the Hyper-V driver
due to the fact that spawn, destroy and other methods have been
written with the instance lock in mind.

In this context, thread safety needs to be enforced where needed
in all drivers before this patch can be applied.

Sample Hyper-V CI log showing the error:
http://64.119.130.115/63217/7/Hyper-V/hv-compute2/nova-compute.log.gz

Partial-Bug: #1276772

Change-Id: I72fb1f9de7767b7206c5fa39b87216fa3f1b5c68