Change the comments of SOFT_DELETED race condition

_reclaim_queued_deletes will only find instances in SOFT_DELETED
state and delete them if they are only old enough. The quotas will be
committed when the instance was soft-deleted so that resource can
be used right after the soft-delete operation.

There are some concern about the quota inconsistency for the operation,
The only case that the quota might be inconsistent is
the compute node died between set instance state to SOFT_DELETED
and quota commit to DB; when compute node start again
it will have no idea the reservation is committed or not or even
expired, since it's a rare case, so marked as todo.

There are some alternatives if the problem need to be fixed, e.g.
able to find reservation when nova compute restart, so we can double
check whether the quota is committed or not.

Partial-Bug: #1296414

Change-Id: Idf9c179b2dd439462a646568ffd5098cd5d7851f
Format eph disk with  specified format in libvirt

novaclient has following command parameters:
--ephemeral size=<size>[,format=<format>]
Create and attach a local ephemeral block device of
<size> GB and format it to <format>.

so mkfs should use the specified format instead of using
default format.

Change-Id: I7a8753284d7b1da1a1203e85b430bd0c5012937a
Closes-Bug: #1280132
libvirt: remove flawed get_num_instances method impl

The get_num_instances method impl simply asks libvirt
how many running domains there are. This is flawed for
a number of reasons.

 - It doesn't filter out 'Domain-0' on Xen
 - It doesn't count inactive instances

As a result the value is returns is inconsistent with
the number of instances shown by 'list_instances'.
This will cause the _sync_power_states method in the
compute manager to constantly try to re-sync the list
of instances.

Remove the flawed impl and just allow the base class
default impl to be used. This just does a len() call
over the return of 'list_instances'. Previously this
was quite a heavy API call, but with new enough libvirt
it can be completed in a single API call which should
be fine.

Blueprint: libvirt-domain-listing-speedup
Change-Id: I96242717afa5c928f1cfb5f307b71739f2147e69
Correct use of nova.image.glance in compute API

The nova.api.openstack.compute.images modules was using the
nova.image.glance module directly, instead of using the new,
standardized nova.image.API module.

This patch corrects that usage and updates the associated unit tests to
use mock instead of the nova.tests.api.fake.stub_out_glance() method.

Copies the nova.tests.api.fake._make_image_fixtures() call to a new
nova.tests.image_fixtures module, and corrects a number of errors in the
original function, including not returning datetime objects for
timestamp fields (as the nova.image.API returns) and ensuring that the
ID field is a string in the returned fixture dicts.

The _make_image_fixtures() function and the stub_out_glance() function
will be removed in the next patch, which fixes up the image_metadata
module, which is the last unit test that uses them.

Change-Id: Icd22ff3f438b8ba476f2637c7d4129ea6d0f45e8
Re-add H803 to flake8 ignore list.

I6c2537dd27c947e36ebf37eb3b5c8a1ab8b026a1 mistakenly removed H803 since
running flake8 had no hits for this test, but H803 is the period in the
commit message which we are explicitly ignoring until the next version
of hacking is released (which will remove this check).

Change-Id: I22860cc61336ef5bf8ce4509fe130160bdf7e45b
Merge "Correct use of nova.image.glance in compute API"
Merge "libvirt: remove flawed get_num_instances method impl"
Merge "Re-add H803 to flake8 ignore list."
Merge "Format eph disk with  specified format in libvirt"
Merge "Change the comments of SOFT_DELETED race condition"