diff options
author | Matthew Booth <mbooth@redhat.com> | 2014-08-13 14:03:15 +0100 |
---|---|---|
committer | Matthew Booth <mbooth@redhat.com> | 2014-09-26 09:10:59 +0100 |
commit | c4451da6e2bc4c90e5944d4eff949533b997aaa8 (patch) | |
tree | e6442b98053884853e17f63e7bbed349c49c3253 /nova/virt | |
parent | 2d7b252f52be6315ff3d2924977de2f36cec3fc1 (diff) | |
download | nova-c4451da6e2bc4c90e5944d4eff949533b997aaa8.tar.gz |
VMware: Remove class orphaned by ESX driver removal
HostState was only used by the ESX driver, which was removed in
change I718fc0ee67dbd625af00c20fa4e34b8a35015437.
Also remove LOG, which is no longer used following previous removals.
Change-Id: I22e30c01e5b5219df858219dc1fda335a83ad225
Diffstat (limited to 'nova/virt')
-rw-r--r-- | nova/virt/vmwareapi/host.py | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/nova/virt/vmwareapi/host.py b/nova/virt/vmwareapi/host.py index 94ba2af36e..844544dfce 100644 --- a/nova/virt/vmwareapi/host.py +++ b/nova/virt/vmwareapi/host.py @@ -21,15 +21,12 @@ from nova.compute import arch from nova.compute import hvtype from nova.compute import vm_mode from nova import exception -from nova.openstack.common import log as logging from nova.openstack.common import units from nova import utils from nova.virt.vmwareapi import ds_util from nova.virt.vmwareapi import vim_util from nova.virt.vmwareapi import vm_util -LOG = logging.getLogger(__name__) - def _get_ds_capacity_and_freespace(session, cluster=None): try: @@ -39,67 +36,6 @@ def _get_ds_capacity_and_freespace(session, cluster=None): return 0, 0 -class HostState(object): - """Manages information about the ESX host this compute - node is running on. - """ - def __init__(self, session, host_name): - super(HostState, self).__init__() - self._session = session - self._host_name = host_name - self._stats = {} - self.update_status() - - def get_host_stats(self, refresh=False): - """Return the current state of the host. If 'refresh' is - True, run the update first. - """ - if refresh or not self._stats: - self.update_status() - return self._stats - - def update_status(self): - """Update the current state of the host. - """ - host_mor = vm_util.get_host_ref(self._session) - summary = self._session._call_method(vim_util, - "get_dynamic_property", - host_mor, - "HostSystem", - "summary") - - if summary is None: - return - - capacity, freespace = _get_ds_capacity_and_freespace(self._session) - - data = {} - data["vcpus"] = summary.hardware.numCpuThreads - data["cpu_info"] = \ - {"vendor": summary.hardware.vendor, - "model": summary.hardware.cpuModel, - "topology": {"cores": summary.hardware.numCpuCores, - "sockets": summary.hardware.numCpuPkgs, - "threads": summary.hardware.numCpuThreads} - } - data["disk_total"] = capacity / units.Gi - data["disk_available"] = freespace / units.Gi - data["disk_used"] = data["disk_total"] - data["disk_available"] - data["host_memory_total"] = summary.hardware.memorySize / units.Mi - data["host_memory_free"] = data["host_memory_total"] - \ - summary.quickStats.overallMemoryUsage - data["hypervisor_type"] = summary.config.product.name - data["hypervisor_version"] = utils.convert_version_to_int( - str(summary.config.product.version)) - data["hypervisor_hostname"] = self._host_name - data["supported_instances"] = [ - (arch.I686, hvtype.VMWARE, vm_mode.HVM), - (arch.X86_64, hvtype.VMWARE, vm_mode.HVM)] - - self._stats = data - return data - - class VCState(object): """Manages information about the VC host this compute node is running on. |