Treat instance like an object in _default_block_device_names

The _default_block_device_names method already gets an instance object
but was treating it like a primitive dict so this change enforces the
object usage with dot notation when accessing fields.

Also updates the existing unit tests to use an instance object.

Part of blueprint compute-manager-objects-juno

Change-Id: I2706fa081ba427956dc4f643d1e5664eaa2573ed
Fixes Hyper-V resize down exception

The Hyper-V driver does not support resize down and is currently
raising an exception if the user attempts to do that, causing the
instance to go in ERROR state.

The driver should use the recently introduced instance faults
"exception.InstanceFaultRollback" instead, which will leave the
instance in ACTIVE state as expected.

Closes-Bug: #1354448

Change-Id: Ibaf8482562094cd2b3165dc62a907fa9e0e56e19
objects: Make use of utils.convert_version_to_tuple()

Make use of the convert_version_to_tuple() utility in objects that had
inlined an implementation of the same thing.

Change-Id: If48df452baa79eeb52218fcbad0e388edf8fd416
Shelve should give guests a chance to shutdown

Currently in libvirt operations which power off an instance such as stop,
shelve, rescue, and resize simply destroy the underlying VM. Some
GuestOS's do not react well to this type of power failure, and so it would
be better if these operations followed the same approach as soft_reboot
and give the GuestOS as chance to shutdown gracefully.

This is one of a set of changes that will eventually expose the choice
of whether to give the GuestOS a chance to shutdown via the API.

This change implements the compute manager changes to shelve.

Partially-Implements: blueprint user-defined-shutdown
DocImpact

Change-Id: Iec3dfd17725440958aac395ebc471e51afd6522e
Fixes Hyper-V unit test path separator issue

Fixes an issue in a unit tests were path separators were not
handled in a platform independent way causing the test to fail
on Windows.

Change-Id: Ifca77a561e5a95af8655f2373af665292b2ca3cb
Co-Authored-By: Zsolt Dudas <zdudas@cloudbasesolutions.com>
Closes-Bug: #1358702
Extend the docstring for obj_make_compatible() with examples

This adds to the docstring for obj_make_compatible() to help outline
the rules and scenarios to help developers understand what they need
to do in that method, and when.

Change-Id: Ifa8cb9a4f9a1a4d5afd0da4629a7d476a52c62d6
Fix ability to generate object hashes in test_objects.py

Change https://review.openstack.org/#/c/114260/3 broke the ability to
generate object hash codes by setting GENERATE_HASHES in the
environment.

Change-Id: I08e015b44ac12655d33e0b04d5608d68c1f13270
Merge "Fixes Hyper-V unit test path separator issue"
Merge "Fixes Hyper-V resize down exception"
Merge "Fix ability to generate object hashes in test_objects.py"
Merge "objects: Make use of utils.convert_version_to_tuple()"
Merge "Treat instance like an object in _default_block_device_names"
Merge "Extend the docstring for obj_make_compatible() with examples"
Merge "Shelve should give guests a chance to shutdown"