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
Remove unused imports

Fixes bug #1037705

Change-Id: I3e55f283961b4801c863bea05d9dd36e22be0cdb
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
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
Merge "Makes sure tests don't leave lockfiles around"
Merge "Fix use of non-existant var pool."
Merge "Remove logging in volume tests"
Fix a TypeError that occurs in _reschedule.

Updates the compute manager so that it passes the correct
arguments to the scheduler API's run_instance function.

Fixes the following exception which will occur if an instance
is rescheduled:

  TypeError: run_instance() got an unexpected keyword argument
  'reservations'

As part the fix the FakeSchedulerAPI we use in test_compute.py
has been updated to match the arguments of the real scheduler API.

Fixes LP Bug #1038193.

Change-Id: I25782b79a7b19013b25cb94cc5569b5aa83a2df0
Fix get_vnc_console race.

There exists a window between a server create is done and when the host
is assigned by the scheduler that a request to get the vnc console will
result in a 500 error.

This patch adds a check in the compute API to ensure that the instance
has a host assigned before try to execute a rpc on the compute node.
If not, it raises InstanceNotReady (which translates to a 409 in the
OS API).

Fix bug 1037809.

Change-Id: I3f5af90d57ae84f98f787e14ccb66f1841ac0c6d
Merge "Revert to prior method of executing a libvirt hard_reboot."