diff options
-rw-r--r-- | nova/virt/xenapi_conn.py | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/nova/virt/xenapi_conn.py b/nova/virt/xenapi_conn.py index 6fae558b5d..5467ee2bcc 100644 --- a/nova/virt/xenapi_conn.py +++ b/nova/virt/xenapi_conn.py @@ -181,8 +181,6 @@ class XenAPIConnection(driver.ComputeDriver): self._initiator = None self._pool = pool.ResourcePool(self._session) - self._capture_dom0_hostname() - @property def host_state(self): if not self._host_state: @@ -196,22 +194,6 @@ class XenAPIConnection(driver.ComputeDriver): #e.g. to do session logout? pass - def _capture_dom0_hostname(self): - """Find dom0's hostname and log it to the DB.""" - ctxt = context.get_admin_context() - service = db.service_get_by_host_and_topic(ctxt, FLAGS.host, "compute") - - try: - compute_node = db.compute_node_get_for_service(ctxt, service["id"]) - except TypeError: - return - - host_stats = self.get_host_stats() - - db.compute_node_update(ctxt, compute_node["id"], - {"hypervisor_hostname": host_stats["host_hostname"]}, - auto_adjust=False) - def list_instances(self): """List VM instances""" return self._vmops.list_instances() @@ -429,6 +411,7 @@ class XenAPIConnection(driver.ComputeDriver): 'local_gb_used': used_disk_gb, 'hypervisor_type': 'xen', 'hypervisor_version': 0, + 'hypervisor_hostname': host_stats['host_hostname'], 'service_id': service_ref['id'], 'cpu_info': host_stats['host_cpu_info']['cpu_count']} |