'Retrieve resource information.
This method is called when nova-compute launches, and
as part of a periodic task that records the results in the DB.
:param nodename: ignored in this driver
:returns: dictionary describing resources'

def get_available_resource(self, nodename):

    host_stats = self.host_state.get_host_stats(refresh=True)
    total_ram_mb = (host_stats['host_memory_total'] / units.Mi)
    free_ram_mb = (host_stats['host_memory_free_computed'] / units.Mi)
    total_disk_gb = (host_stats['disk_total'] / units.Gi)
    used_disk_gb = (host_stats['disk_used'] / units.Gi)
    allocated_disk_gb = (host_stats['disk_allocated'] / units.Gi)
    hyper_ver = versionutils.convert_version_to_int(self._session.product_version)
    dic = {'vcpus': host_stats['host_cpu_info']['cpu_count'], 'memory_mb': total_ram_mb, 'local_gb': total_disk_gb, 'vcpus_used': host_stats['vcpus_used'], 'memory_mb_used': (total_ram_mb - free_ram_mb), 'local_gb_used': used_disk_gb, 'hypervisor_type': 'XenServer', 'hypervisor_version': hyper_ver, 'hypervisor_hostname': host_stats['host_hostname'], 'cpu_info': jsonutils.dumps(host_stats['cpu_model']), 'disk_available_least': (total_disk_gb - allocated_disk_gb), 'supported_instances': host_stats['supported_instances'], 'pci_passthrough_devices': jsonutils.dumps(host_stats['pci_passthrough_devices']), 'numa_topology': None}
    return dic
