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
Fix test case with wrong parameter in test_quota_classes

The 'id' parameter is filled in the quota-classes request body in
unit test, but it is not necessary. 'id' is passed to the server
by the URL but not the body. This patch fixes this bug.

Change-Id: I4014264e16031382277f6f1b520556a2a2690ad8
Closes-Bug: #1266634
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
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
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 hacking test to block cross-virt driver code usage

The baremetal driver has been accessing some libvirt driver
private classes and config variables. Any code that is intended
to be shared across virt drivers should be in a common package
instead. Add a hacking file to enforce this for imports and
config options so that no further problems like this are made
in the future.

NB, this skips verification of the baremetal driver until
bugs 1261826 and 1261827 are fixed, or the baremetal driver is
removed, whichever comes first.

Change-Id: Ifbfe597795795a847830f9bd937dc459cd37d118
Closes-Bug: #1261842
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
Add XenAPI driver deprecation warning log message

The XenAPI driver does not have running CI and per the schedule,
is slated for deprecation in Icehouse-3. This adds the warning
message to the log to alert admins to this fact, in line with the
others we have been adding for drivers in similiar situations.

Change-Id: Iaff48aaca27d87c600291b8abcc23273a879366a
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
Merge "Add hacking test to block cross-virt driver code usage"
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 "Fix test case with wrong parameter in test_quota_classes"
Merge "Make the simple_tenant_usage API use objects"