Fix wrong description when updating quotas

when updating quota for a resource, with 'force_update=false', an
exception will be raised when the new value is less than the used quota
values(used and reserved). This patch changes the description of
exception.

Change-Id: Iede70444341817afb6953eb604fe4de186622916
Closes-bug: #1243062
Stored metrics into compute_nodes as a json dictionary

The compute manager uses plugins to get the metrics information of each node.
And then sends and stores in DB for the scheduler to read and do scheduling.

The patch reuses table compute_nodes and adds a new TEXT column to store the
metric data as a json dictionary.

This is part of the blueprint utilization-aware-scheduling and the
blueprint generic-host-state-for-scheduler.

Change-Id: I4d20565567e9907cfcc92b1c1b15f3b35a806797
Signed-off-by: Shane Wang <shane.wang@intel.com>
Fix migration 185 to work with old fkey names

Migration 133_folsom.py accidentally changed the name of the FK
constraint on instance_info_caches from instance_info_caches_ibfk_1
to instance_info_caches_instance_uuid_fkey and on virtual_interfaces
from virtual_interfaces_ibfk_1 to
virtual_interfaces_instance_uuid_fkey meaning databases who have
upgraded from before folsom have the old fkey.

This patch adds a check for those with the old fkey name to make sure
it is dropped before changing unique constraints (as is required by
MySQL). It also fixes the fkey name to be as defined in 133 if it
wasn't before (which will persist on downgrade being consistent with
those who have come in after folsom).

Closes-Bug: #1245502

Change-Id: Ib0dcd04fcb9ed776c76d40561181abad2e14f76f
Add log_handler to implement the publish_errors config option

Synced from Olso.
Commit Id is Ibf28ba17f81b5ddeda653f6a3501ecac18ffcd42

This handler sends all error logs as rpc notifications.
Note: when using publish_errors you also need to set the
notification_driver option too.

Change-Id: Ic97b9c8b84d51c84a53ace5b86cc2e72c744f136
Closes-bug: #1240349
Replace assertEquals with assertEqual - tests/etc

The method assertEquals has been deprecated since python 2.7.
http://docs.python.org/2/library/unittest.html#deprecated-aliases

Also in Python 3, a deprecated warning is raised when using assertEquals
therefore we should use assertEqual instead.

This is part of blueprint assertequal

Change-Id: I5ecb36332b9353b7010a4f977813ff0295738014
Moved quota headroom calculations into quota_reserve

Moved headroom calculations into quota_reserve and modified headroom
calculations to take into account -ve quota limits (unlimited) on
cores and ram.

Updated test cases to generate OverQuota exceptions with new headroom
parameter.

Added new tests for 'unlimited' quotas to test_quota.py in
 QuotaIntegrationTestCase and DbQuotaDriverTestCase classes.

Add Exception kwargs checking for OverQuota and QuotaError exceptions.

Change-Id: I855b0cad495182c5c4ee42b2acf5eedd198557b5
Closes-Bug: #1224453 min_count ignored for instance create
xenapi: Fix regression issue in agent update

Agent updates must be processed after guest networking is configured

Change-Id: I7994154ea09befe07396b4e99d43157d268fd6b1
Closes-Bug: 1250162
Merge "Add log_handler to implement the publish_errors config option"
Merge "Replace assertEquals with assertEqual - tests/etc"
Merge "Fix migration 185 to work with old fkey names"
Merge "Stored metrics into compute_nodes as a json dictionary"
Merge "xenapi: Fix regression issue in agent update"
Merge "Fix wrong description when updating quotas"