Prevent nova services' coverage data from combining into nova-api's

Now if combining a coverage report once, nova services' coverage
data are combined into nova-api's.
This renames nova-api coverage datafile to .nova-coverage.api and
creates a new coverage instance to combine when reporting.

Fixes bug: 1152475

Change-Id: I90b6535d490cf0123a127f8752986edd782ef37e
Switch nova-baremetal-deploy-helper to use sfdisk.

This patch changes make_partitions function to use sfdisk instead
of fdisk. Also added logging of cmd, stdout, and stderr should
command fail.

Fixes Bug 1088652

Change-Id: Ia2711a5450900c95598253f2a7b02e7c3e83a3d8
Authored-by: Chris Krelle <nobodycam@gmail.com>
Show quota 'in_use' and 'reserved' info

We need show all the quotas related info, including 'in_use' and
'reserved'--not just the limit--when executing 'nova-manage project
quota'.

Fix bug 1160752

Change-Id: I25e10e58c6af705e2189550ad762e6f39bca342e
Fix migrating instance to the same host.

In current code logic, Migration to the same host is allowed which is
meaningless.

In the patch, a Conf flag 'allow_migrate_to_same_host' is added and set to
false as default. When 'allow_migrate_to_same_host' is false, the current
instance host will be added into filter property 'ignore_hosts' to avoid
migrating instance to the same host.

Fixes: bug #1160268

Change-Id: I5ac0391cf468310a89fb6d8a8f5120c5654cb4ff
Add CRUD methods for tags to the EC2 API.

This is an incomplete implementation of the EC2 tags API.  In EC2, most
resources are able to be tagged.  See
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html

In openstack, the only currently 'taggable' resource is an instance, as
it has an instance_metadata table associated.  So far, only instance
tagging has been implemented, but it is relatively simple to extend this
to other resource types by creating the associated model and api calls.

Additionally, in EC2 searches, shell-style globs are allowed, eg:
fo* will match fo, foo, foobar
fo? will match foo

This has been left to do at a later date.

DocImpact: Adds new API calls: CreateTags, DeleteTags, DescribeTags
See:
http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-CreateTags.html
http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DeleteTags.html
http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeTags.html

Fixes: bug #1096821
Implements: blueprint ec2-tags-api

Change-Id: Idf1108f6a3476cabdbdb32ff41c00aa4bc2d9ffe
Signed-off-by: Stephen Gran <stephen.gran@guardian.co.uk>
Convert host value from unicode to a string.

The memcached API expects string format, not unicode.
Convert the host value to a string before creating
the cache_key and passing it to memcached.

Fixes: bug #1158958
Change-Id: I26e86b7fb61b4b3380a14686bd2faa9f58017999
Ensure only pickle-able objects live in metadata

Conductor api has been added to InstanceMetadata object, but it cannot
be serialised. This breaks storing metadata in memcache, because the
information needs to be passed through pickle.

Since the field was not used outside of the constructor, it can be
removed to fix the problem.
Also add a test that pickles a sample InstanceMetadata to catch similar
failures in the future.

Fixes bug 1160900

Change-Id: I7e8cef5a131290eaa1402d48295026bcac6baff6
Use Cluster reference to reduce SDK calls

The vmware compute driver retrieves the cluster reference
for every spawn and volume operation. The solution is to
retrieve the reference once from the __init__() of
vmwareapi/driver.py and reuse the same in other methods.
This will reduce the number of VI SDK calls made.

Fix for bug 1130222

Change-Id: I2179733ee4ab1b2aea919de0ad4c10631cf005ea
get context from req rather than getting a new admin context

This patch removes the call to context.get_admin_context() and instead
obtains the context from the req object. Allowing the context.auth_token
to be reused.

Fixes bug 1161081

Change-Id: I3b104edc2966fc3263fad824b1c4c99df832672e
Accepts aws-sdk-java timestamp format

The aws-sdk-java timestamp format is "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"
which contains millisecond representation. However, the current
implementation does not accept this kind of format.

References:
https://github.com/aws/aws-sdk-java/blob/master/src/main/java/com/amazonaws/auth/QueryStringSigner.java#L173

Adds ability to parse this format in ec2utils.is_ec2_timestamp_expired.

Fixes bug 1156445.

Change-Id: I389ff8b9c6c91b699538b889add264d66dbb8131
Set default fixed_ip quota to unlimited.

DocImpact: our previous default quota of ten was poorly thought through
and resulted in upgrade problems. Instead, let's have operators opt into
fixed IP quotas. This change should be mentioned in release notes please.

Resolves bug 1161190.

Change-Id: I2f066a0129461899fe330a628cf49ee5273eaba4
Add missing unit tests for FlavorActionController

Fixes bug 1115575

Change-Id: I81740bd30d03fd3c5d9b1dcc7f73e1b7a2b757c7
'injected_files' should be base 64 encoded.

If an instance build needs to be rescheduled, send the original
base 64 encoded injected_files parameter.

bug 1161479

Change-Id: I4dad95e95cd27f7f128989daa36b3a2bbf132c73
Fix automatic confirmation of resizes for no-db-compute

compute/api.py:confirm_resize() was still making a bunch of calls
against the database that were tripping over the no-db-compute
enforcement checks. Instead of trying to unwind all of the instance
action, quota, etc code and divert to conductor, just farm out the
entire confirm_resize() call to conductor.

Fixes bug 1161402

Change-Id: I121040a3b575f5866d45cc8ef6862d67f5558715
Merge "'injected_files' should be base 64 encoded."
Merge "Set default fixed_ip quota to unlimited."
Merge "get context from req rather than getting a new admin context"
Merge "Fix automatic confirmation of resizes for no-db-compute"
improve handling of an empty dnsmasq --domain

Currently all domains passed through the dnsmasq --domain option,
are single quoted.  It's not fully understood how dnsmasq handles
single quotes in this situation, so it's safer to just avoid the
--domain option in this case.

Fixes bug: 1161506
Change-Id: I8ecd996676189f53908abd48fee81132091ee820
Sync in matchmaker and qpid Conf changes from oslo

The following should use integers not strings.
* matchmaker_heartbeat_freq
* matchmaker_heartbeat_ttl
* qpid_port

Fixes bug 1159889 and bug 1161679

Change-Id: I2f055929ffa48ead300d2a3efdb0ce0692a13716