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
Change unit test for availability_zones.reset_cache

Test_rest_availability_zone_reset_cache can not make sense
because the result of az._get_cache().get('cache') before
executing az.reset_cache() and after az.reset_cache() are
same.

This Patch will provide a reasonable test for it.

Change-Id: I7a27998bdf70f39077a5d79fc460974fc5806c3e
Closes-bug: #1258041
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 log message in APIRouter

In _setup_ext_routes(...) and _setup_extensions(...)[0], there are three
logs telling that I'm setuping extensions routes, and these are done,
those failed. At line3 in [0], every resource woulld be logged before
the line 6-7 skip (conintue in Python). So here should be that I'm
'extending' resource, not 'extended'. Similiar in line 38 and line 43,
these two should be what is done and what is failed.

So this patch fix the first log from 'Extended' to 'Entending', and in
third log, 'extending' to 'extended' instend which makes context log
more reasonable.

[0] http://paste.openstack.org/show/60246/

Change-Id: I2de66f1a8e09945e1915b61771a55af6b630369c
Remove unused code in test_attach_interfaces.py

"body = jsonutils.dumps({'port_id': FAKE_PORT_ID1})" is unused in
test_attach_interface_without_network_id(). We should remove it.

Change-Id: Id31b559752d57c9f55fd2bf0de909b8d8f9a0333
Closes-Bug: #1266617
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
Use the full string for localisation

Concatenating localized strings is bound to be confusing.
Give the full string so that translations can be tuned accordingly.

Change-Id: I84a5fa2939c02add5468c4ab4b6f2c4ea1a5f8f0
Abstract add_timestamp out of ComputeDriverCPUMonitor class

Move add_timestamp decorator into ResourceMonitorBase class,
then other monitor metrics can reuse it.

Change-Id: I060353b9e194b1882549fec07fc2a486aeb1fce0
replace type() to isinstance() in nova

In nova/utils.py, a func use the "type" method to
determine the type. It's bertter to use the "isinstance"
method instead.this bug is fixed in glance:
https://review.openstack.org/#/c/65611/4

Change-Id: I10d25d2308436239c50cf3932c212e22c45f92a8
Closes-Bug: #1267300
XenAPI: Use direct IO for writing config drive

If you don't use direct IO when writing to the device, the unplug
immediately following this may not succeed as the device may still
be in use.

Also add a sync to ensure the device is not being used at the point
of unplug.

Closes-bug: 1259163

Change-Id: I68f09835648b36772a7839af9718123a4c60734f
Fix potential fd leak

Always close the test socket.

Change-Id: Ic87b713a7791cf39ed5146754e1345fc662c894e
Capture exception for JSON load in virt.storage_users

If CONF.instances_path/compute_nodes is empty when the storage_users
tries to register the storage use (virt.storage_users.register_storage_use)
the exception is uncaught and raised. As a consequence, the image cache
manager won't run.

Closes-Bug: #1252659

Change-Id: If9ed5e75b0bc0b8f3a7c5fd7ec88f6399e4e59c6
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
Merge same db calls for some quota methods

db.quota_get_all_by_project is called twice in method limit_check()
and reserve(),
db.quota_get_all_by_project_and_user is called twice in method
get_settable_quotas() in nova/quota.py

Change-Id: Ie5e3a414d3d52964c16613f44fe60a7f68bc0c66
Closes-bug: 1277068
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 multi availability zone issue part 2

In order to keep consistency with fixing in
code review:
I788782a9f21ec2672551f75123753175bb268586

adding aggregate az checking logic to guarantee
that aggregate updating and aggregate metadata
updating shouldn't be done when aggregate's hosts
belong to other az. So, when az conflict exist,
user should remove those hosts.

sync the changes into V3 aggregate APIs.

Fixes: bug #1200479
Change-Id: I18ad1ac22c6aee298ccc75c978b85241ae1ac616
VMware: Fix incorrect comment indentation

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