Merge "hyperv: report disk_available_least field"

This commit is contained in:
Jenkins 2017-09-19 13:29:53 +00:00 committed by Gerrit Code Review
commit 04c816ed03
2 changed files with 7 additions and 0 deletions

View File

@ -170,11 +170,17 @@ class HostOps(object):
cpu_topology['cores'] *
cpu_topology['threads'])
# NOTE(claudiub): free_hdd_gb only refers to the currently free
# physical storage, it doesn't take into consideration the virtual
# sizes of the VMs' dynamic disks. This means that the VMs' disks can
# expand beyond the free_hdd_gb's value, and instances will still be
# scheduled to this compute node.
dic = {'vcpus': vcpus,
'memory_mb': total_mem_mb,
'memory_mb_used': used_mem_mb,
'local_gb': total_hdd_gb,
'local_gb_used': used_hdd_gb,
'disk_available_least': free_hdd_gb,
'hypervisor_type': "hyperv",
'hypervisor_version': self._get_hypervisor_version(),
'hypervisor_hostname': self.get_hostname(),

View File

@ -203,6 +203,7 @@ class HostOpsTestCase(test_base.HyperVBaseTestCase):
'memory_mb_used': mock.sentinel.MEMORY_MB_USED,
'local_gb': mock.sentinel.LOCAL_GB,
'local_gb_used': mock.sentinel.LOCAL_GB_USED,
'disk_available_least': mock.sentinel.LOCAL_GB_FREE,
'vcpus': self.FAKE_NUM_CPUS,
'vcpus_used': 0,
'hypervisor_type': 'hyperv',