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
Fix init of pci_stats in resource tracker

Because pci_stats is list of dict, i.e., [{}, {}, ...],
if pci_stats is null, its field should be '[]' not '{}'.

When making object models, we found this bug in PCI stuffs.

Related to blueprint pci-extra-info.

Change-Id: I06564cb541b050060e87fd3d334299df66f23dec
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
Fix scheduler_hints parameter of v3 API

"create a server" API contains a scheduler_hints parameter which is
a hint where a server should boot.
According to scheduler-hints-post-req.json API sample, the parameter
name is "os-scheduler-hints:scheduler_hints":
  {
    "server" : {
      "name" : "new-server-test",
      "image_ref" : "..",
      "flavor_ref" : "..",
      "os-scheduler-hints:scheduler_hints": {
        "hypervisor": "xen",
        "near": "48e6a9f6-30af-47e0-bc04-acaed113bb4e"
      }
    }
  }

However create() of SchedulerHintsController tries to get its value
from invalid position where is the same level as "server":
  {
    "server" : {
      [..]
    },
    "os-scheduler-hints:scheduler_hints": {
      "hypervisor": "xen",
      "near": "48e6a9f6-30af-47e0-bc04-acaed113bb4e"
    }
  }

As the result, Nova cannot get the value from the right parameter.
To fix the problem, this patch merges both the parameter parser and
the validation code to server_create() like the other API extensions.
SchedulerHintsController becomes unnecessary, then this patch removes
the class.

Partially implements bp v3-api-inconsistencies

Change-Id: I4e0bcbde8e2d2171d0b2e18b72d2c2b3d88d7239
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
Fixed naming issue of variable in a debug statement formatting

Closes-bug: 1275802

Change-Id: I5bf57290ff3023f6d3332a92114cc4f235e1f4af
Hyper-V: Change variable in debug log message

The variable used in the log message is incorrect. The log message
outputs the file size instead of the internal VHD size.

Closes-bug #1275805

Change-Id: I270709098e058cf51bbe6494b903a461b3938d15
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