XenAPI: Speedup host_ref cannot change - get it once

The host we run on is fixed - getting this each time from XAPI
is expensive

Change-Id: Ifee9a778f3ed855ef52b001de3fc2ebbd0b972cf
Remove smoketests

We don't use them anymore. Also remove boto_v6 since only smoketests
have was using it.

Change-Id: Iee206fd4ba6cd502ded794f2de302062604d4186
Refactor time conversion helper function for objects in db api

Refactor the code to use common time conversion code for objects. Strip
timezone info out from datetimes, which is no need for database.

This is a part of: blueprint make-instance-action-use-objects

Change-Id: Id7f8b48da1499ded3418ceebe4680e066420e2a3
Image cache: move all of the variables to a common place

In addition to this it creates a base ImageCacheManager class.

This moves common image cache config from the libvirt driver into
a place that can be shared between drivers, nova.virt.imagecache
The libvirt specific image caching variables are untouched.

The other image cache fields that were in the nova.compute.manager
have also been moved to the common place.

These common configuration can be used by the
blueprint multiple-image-cache-handlers and the
blueprint vmware-image-cache-management.

DocImpact
    The following configuration variables are now in the DEFAULT
    section:
        image_cache_manager_interval
        image_cache_subdirectory_name
        remove_unused_base_images
        remove_unused_original_minimum_age_seconds

Change-Id: I92080f20c3d21ec348aff7d0a9795e773bcc2649
Merge "XenAPI: Speedup host_ref cannot change - get it once"
Add configurable 120s timeout ovs-vsctl calls

By default, or with a secs of 0, ovs−vsctl waits forever for a response
from the database. This option limits runtime to approximately 120 seconds.
If the timeout expires, ovs−vsctl will exit with a SIGALRM signal. (A
timeout would normally happen only if the database cannot be contacted,
or if the system is overloaded.)

The user can update the timeout by setting the ovs_vsctl_timeout
configuration variable.

DocImpact

Closes-bug: 1229018

Change-Id: Ica64ae98fb6162d2119021972127a82417d5ee7a
Merge "Remove smoketests"
Merge "Add configurable 120s timeout ovs-vsctl calls"
Merge "Image cache: move all of the variables to a common place"
Merge "Refactor time conversion helper function for objects in db api"
XenAPI: get_info was very expensive

Getting the whole VM record is expensive and slowed down Tempest tests
significantly.  Replaced with getting each required item.

When getting power state, only need that specific value, so reduce the
calls to get_info too.

Change-Id: I93bcef5b692a531aac41518dc29d5d4f46cded65
XenAPI: Tidy calls to get_all_ref_and_rec

get_all_records is more efficient than getting them individually in the
old get_all_ref_and_rec implementation.

Replaced some cases of get_all_records with a faster and more
specific API call.

Change-Id: I4725c3f1fdebdf1737941cb7db69b19afb22df9f
XenAPI: Speedup get_vhd_parent_uuid

In many cases the VDI record has already been retrieved.
Use it rather than expensively getting a new VDI record from XAPI.

Change-Id: I469e2a415c1f1924010f47d3927ca18c45a7b8f8
XenAPI: Use get_VALUE in preference to get_record()['VALUE']

Replaces calls to get_record where only a single item is retrieved
from the record with the specific get_VALUE call.

Change-Id: I52e20c4f4c9d6a6ad019694916ee057cc96b18a6
XenAPI: Monitor the GC when coalescing

Add a new host plugin to monitor whether the garbage collector is running.
This is then used by the wait_for_vhd_coalesce function to know whether
waiting any more is likely to produce the expected results.

Increased the number of times we loop waiting for coalesce as the loop
now has knowledge that something is still happening.

Change-Id: Idcc0738945bd1aee8cdb52c9cfabd798f85c31db
Closes-bug: 1258169

Conflicts:

	nova/virt/xenapi/vm_utils.py
XenAPI: Use direct IO for writing config drive

If you don't use direct IO when writing to the device, the unplug
immediately following this may not succeed as the device may still
be in use.

Also add a sync to ensure the device is not being used at the point
of unplug.

Closes-bug: 1259163

Change-Id: I68f09835648b36772a7839af9718123a4c60734f