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
Remove unused code

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

Change-Id: I84f36a2fcb53f0c8c6b2486a37851922805bca13
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
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
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
Make the simple_tenant_usage API use objects

This change makes the simple_tenant_usage V2 and V3 APIs use Instance
and Flavor objects.

Related to blueprint compute-manager-objects

Change-Id: I8e0e870727d687da165c809ffb7a4456bff81122
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
Disable libvirt driver file injection by default

DocImpact: This changes the default for file injection and key
injection with the libvirt driver. Most people should not need file
injection (the metadata server and/or config drive are more robust,
better options).

UpgradeImpact

blueprint disable-file-injection-by-default

Change-Id: Icff1304fc816acc843f8962727aef8bbbc7bbaa3
Co-Authored-By: Russell Bryant <rbryant@redhat.com>
Co-Authored-By: Steve Kowalik <steven@wedontsleep.org>
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
Merge "Make the simple_tenant_usage API use objects"
Merge "Disable libvirt driver file injection by default"
Merge "VMware: use .get() to access 'summary.accessible'"