Raise InstanceInvalidState for double hard reboot

A hard reboot is not allowed if the instance task_state is
REBOOTING_HARD so check for that state and raise InstanceInvalidState.
This returns the correct status of 409 to the caller.

Previously the hard reboot would fail the the expected_task_state check
on db.instance_update_and_get_original which would log a traceback and
return a 500 to the caller.

Bug 1157237

Change-Id: Ifb6111790352da5c404289b218c50d8104384301
Improve message and logging for corrupt VHD footers

 * Handles the output of vhd-util check a bit more intelligently.
 * Changes it to use LOG like in other modules
 * Adds a necessary import (errno)

Change-Id: I75d6b9e081159bc29732a721deb7a557e5f2ee06
Adds useful debug logging to filter_scheduler

On a large system (>500 hosts) the amount of logging
information if everything is at DEBUG is vasts, due to
the number of hosts checked for each filter

However at the moment some useful information is only
available within the filter's debug entrys (such as
parts of the request_spec).   Also instance uuids are
not logged making it hard to search for instance entries.

This set of changes allows it to be used in a very
large install with debug turned off for everything
except nova.filters

Specifically:
 - Log.Info the instance_uuids at the start of schedule
 - Log.debug the request_spec at the start of schedule
 - Log.debug hosts in weighted order
 - Log.info which host has been allocated to a specific
   instance_uuid
 - Log.debug how many hosts are returned by each filter

To get a count from each filter nova.filters had to be
changed to generate a list after each filter rather than
building a recursive generator object.   Although this
new approach is less elegant it does provide simple and
useful insight into the behaviour of the filters, and s
the impact on execution time on a system with several
hundred hosts and 10 filters was negligible

Change-Id: Ibbdd14f87b1dfd3cee8bf3cf6388e40b474e530a
Merge "Adds useful debug logging to filter_scheduler"
Merge "Improve message and logging for corrupt VHD footers"
Merge "Raise InstanceInvalidState for double hard reboot"