Revert to prior method of executing a libvirt hard_reboot.

Fixes bug 1036826.

Using reset for hard_reboot is not reliable, even where it is supported
by libvirt. Hard reboots are one of the only ways to recover a VM in a
broken state. The reset command assumes the domain is running in some
capacity and will fail if it is not.

Hard reset is the current sledgehammer for fixing issues and it really
needs to stay that way.

Change-Id: I84705b72d79cf71adad066b18267fdfb199bc9cb
Restore libvirt block storage connections on reboot.

Fixes bug 1036902.

There are a number of cases where block storage connections are not
properly restored, impacting libvirt in particular. The most common
case is a VM which has block storage attached via iSCSI, whereby the
physical system is rebooted. When the system comes back up and
starts nova-compute, the iSCSI connections are NOT recreated for the
instances slated to be resumed (assuming
resume_guests_state_on_host_boot is set).

The patch changes the compute manager to pass block_storage_info via
driver.reboot() and driver.resume_state_on_host_boot(). The fix is
actually only present in the libvirt driver. However, all the other
drivers were updated to accept the additional, optional function
arg.

With the changes in place, iSCSI connections for libvirt are
re-established after a hypervisor reboot with
resume_guests_state_on_host_boot=True and on every hard_reboot.
The latter is intended so that users have a last ditch option for
recovering their VMs without administrative involvement.

Change-Id: Idf5d53f21991a359bec6ce26ae9fe3bd61800ce3
Move volume size validation to api layer.

As per the discussion on this patch:

  https://review.openstack.org/10540

Change-Id: I5d3031a08aa1e2d17b5fb233ebaec938c66fa88b
Remove unused function in console api

Remove _translate_id_if_necessary from nova.console.api since its
now using instance_uuid and this function is not used anymore.
Complete fix for bug 1014796.

Change-Id: I1350497541ca6571b38a05d66ca3c5498d63a9b5
Fix use of non-existant var pool.

This code was using pool, but this variable did not exist.  It was
erroneously removed in f50ce35c9cf2e05d205485586da1cb6d5433ba56.
This patch fixes the bug, as well as introduces unit tests for this API
that would have caught the problem.

Part of bug 1037183.

Change-Id: I0784aa314a0224198049dbcbe160084bdd1deee1
Fix spelling typos

Fixes for:
* nova/*py
* nova/scheduler/
* nova/compute/*py
* nova/api/ec2/

Change-Id: I7bec89b3551eda84d596e55eeba9ccb9d944a5cb
Sync changes from openstack common

 * Changes to cfg to handle None overrides, tilde expansion,
   and importing opts.
 * Changes to timeutils to marshall and unmarshall datetimes.
 * Cleanups for zeromq and rpc.
 * Removal of unused imports.

Change-Id: Ica7a2e51ea38f37b315be2ff382d4a615dd67207
Fix PEP8 issues

Fix some PEP8 issues in doc/ext/nova_todo.py and doc/source/conf.py
and make the code look more clearly.

Change-Id: I2b0ce1b09a4a707cffaa565747aabd5346eb9f41
Remove unused imports

Fixes bug #1037705

Change-Id: I3e55f283961b4801c863bea05d9dd36e22be0cdb
Revert per-user-quotas

See bug 1034384, bug 1037590.

This reverts commit https://github.com/openstack/nova/commit/391f345d,
but leaves the DB migration in place while adding a further
migration to reverse it.

The motivation for reversion is that the per-user quota logic would
totally undermine the per-project quotas set for a pre-existing
openstack install.

The per-user quota logic could be re-introduced in a fixed state
after Folsom-3.

Change-Id: Idd4b55a2404a25f43f6737b661f828c28501066f
Refactor ComputeCapabilitiesFilter test cases

With so much duplicated code in the test cases, it's really very
difficult to figure out what each of the cases are testing. DRY
the tests up to make them much more clear.

Change-Id: Ie075d44165996fc4f744a49ddbdfd7c49a0c862e
Fix regression in compute_capabilities filter

Fixes bug #1037503

Restore the previous behaviour of matching simple strings in extra
specs against compute node capabilities.

Change-Id: I485e9e63f860a83f7c9c0c41d09919eabe9e66ae
Refactor extra specs matching into a new module

We want AggregateInstanceExtraSpecsFilter to have the same extra specs
matching semantics as ComputeCapabilitiesFilter, so split the code out
so that it can be reused.

Change-Id: I6938c70f7272956eb27a6609546c3e20ec0dd99e
Merge "Revert per-user-quotas"
Remove logging in volume tests

Fixes bug #932137

Usage of logging seems to be limited to the check_for_export() tests and
should be to cleanup. check_for_export() raises an exception if there's
a problem and it does nothing if it succeeds. The tests should just
check whether an exception was raised.

Change-Id: I411948031baeb7e36e6b15b9f31446a100da77d7
Disable I18N in Nova's test suites

Messages translated into other language like Chinese cause some
unit tests to fail.

Fixes LP bug #1037946.

Change-Id: I01d04333d28bab52d6f424432524b206f3845fba
Merge "Remove unused imports"
Update FilterScheduler doc

The FilterScheduler doc was overlooked when new filters were added
or existing filters were changed.  This change updates the doc with
information skimmed from the individual filters.

nova.conf.sample is updated as well with the current list of default
filters.

Change-Id: I48af75c472195ded89b34db76a22947614ffb99b
Makes sure tests don't leave lockfiles around

Our new lockfile code works fine if the locks already exist, but
it is annoying to pollute the source tree with lockfiles in the
tests.

This modifies the lockfile code slightly to use a tempdir if
lock_path is none. Note that a tempdir will not work in production
but it is fine for testing. We set the lock_path to None in the
testing flags.

Also removes the explicit cleanup in run_tests.sh. The new solution
works with tox and will work even if we add new locks.

Fixes bug 1035426

Change-Id: I613926e4288442e79df50ea5f5bd8f9eafdfe7e7
Make missing imports flag in hacking settable.

Change-Id: Ib1ada320588eb42370c9fa2c0eff4eb888258ea5