163
163
return self._stats
165
165
def update_status(self):
166
"""Update the current state of the host.
168
host_mor = vm_util.get_host_ref(self._session, self._cluster)
172
summary = self._session._call_method(vim_util,
173
"get_dynamic_property",
166
"""Update the current state of the cluster."""
167
# Get the datastore in the cluster
182
169
ds = vm_util.get_datastore_ref_and_name(self._session,
184
171
except exception.DatastoreNotFound:
185
172
ds = (None, None, 0, 0)
174
# Get cpu, memory stats from the cluster
175
stats = vm_util.get_stats_from_cluster(self._session, self._cluster)
176
about_info = self._session._call_method(vim_util, "get_about_info")
188
data["vcpus"] = summary.hardware.numCpuThreads
190
{"vendor": summary.hardware.vendor,
191
"model": summary.hardware.cpuModel,
192
"topology": {"cores": summary.hardware.numCpuCores,
193
"sockets": summary.hardware.numCpuPkgs,
194
"threads": summary.hardware.numCpuThreads}
178
data["vcpus"] = stats['cpu']['vcpus']
179
data["cpu_info"] = {"vendor": stats['cpu']['vendor'],
180
"model": stats['cpu']['model'],
181
"topology": {"cores": stats['cpu']['cores'],
182
"threads": stats['cpu']['vcpus']}}
196
183
data["disk_total"] = ds[2] / (1024 * 1024 * 1024)
197
184
data["disk_available"] = ds[3] / (1024 * 1024 * 1024)
198
185
data["disk_used"] = data["disk_total"] - data["disk_available"]
199
data["host_memory_total"] = summary.hardware.memorySize / (1024 * 1024)
200
data["host_memory_free"] = data["host_memory_total"] -\
201
summary.quickStats.overallMemoryUsage
202
data["hypervisor_type"] = summary.config.product.name
203
data["hypervisor_version"] = summary.config.product.version
186
data["host_memory_total"] = stats['mem']['total']
187
data["host_memory_free"] = stats['mem']['free']
188
data["hypervisor_type"] = about_info.name
189
data["hypervisor_version"] = about_info.version
204
190
data["hypervisor_hostname"] = self._host_name
205
191
data["supported_instances"] = [('i686', 'vmware', 'hvm'),
206
192
('x86_64', 'vmware', 'hvm')]