summaryrefslogtreecommitdiffstats
path: root/nova/virt
diff options
context:
space:
mode:
authorArata Notsu <notsu@virtualtech.jp>2012-11-06 23:12:20 +0900
committerArata Notsu <notsu@virtualtech.jp>2012-11-06 23:12:20 +0900
commitc918ff377f9854a38486a00a0a62548eb27dd2a9 (patch)
tree3bec3b05984922b944a4ade26ed3f515d8f1811a /nova/virt
parentd8d00ef30800cd9ab635d42ec54b6737fc0532b1 (diff)
Make ComputeDrivers send hypervisor_hostname
hypervisor_hostname is set in get_available_resource() and in get_host_stats(). Except for vmwareapi driver. Change-Id: I66348ae1e986162b8139b04ab03c42c424338175
Diffstat (limited to 'nova/virt')
-rw-r--r--nova/virt/baremetal/driver.py2
-rw-r--r--nova/virt/fake.py5
-rw-r--r--nova/virt/hyperv/hostops.py1
-rw-r--r--nova/virt/powervm/operator.py1
-rw-r--r--nova/virt/xenapi/fake.py4
-rw-r--r--nova/virt/xenapi/host.py1
6 files changed, 12 insertions, 2 deletions
diff --git a/nova/virt/baremetal/driver.py b/nova/virt/baremetal/driver.py
index c38b0f98b..ee183584c 100644
--- a/nova/virt/baremetal/driver.py
+++ b/nova/virt/baremetal/driver.py
@@ -676,6 +676,7 @@ class BareMetalDriver(driver.ComputeDriver):
'local_gb_used': self.get_local_gb_used(),
'hypervisor_type': self.get_hypervisor_type(),
'hypervisor_version': self.get_hypervisor_version(),
+ 'hypervisor_hostname': FLAGS.host,
'cpu_info': self.get_cpu_info(),
'cpu_arch': FLAGS.cpu_arch}
@@ -737,4 +738,5 @@ class HostState(object):
self.connection.get_memory_mb_used())
data["hypervisor_type"] = self.connection.get_hypervisor_type()
data["hypervisor_version"] = self.connection.get_hypervisor_version()
+ data["hypervisor_hostname"] = FLAGS.host
self._stats = data
diff --git a/nova/virt/fake.py b/nova/virt/fake.py
index 877fb7603..79d98c5cf 100644
--- a/nova/virt/fake.py
+++ b/nova/virt/fake.py
@@ -70,7 +70,9 @@ class FakeDriver(driver.ComputeDriver):
'disk_total': 600000000000,
'disk_used': 100000000000,
'host_uuid': 'cedb9b39-9388-41df-8891-c5c9a0c0fe5f',
- 'host_name_label': 'fake-mini'}
+ 'host_name_label': 'fake-mini',
+ 'hypervisor_hostname': 'fake-mini',
+ }
self._mounts = {}
def init_host(self, host):
@@ -265,6 +267,7 @@ class FakeDriver(driver.ComputeDriver):
'local_gb_used': 0,
'hypervisor_type': 'fake',
'hypervisor_version': '1.0',
+ 'hypervisor_hostname': 'fake-mini',
'cpu_info': '?'}
return dic
diff --git a/nova/virt/hyperv/hostops.py b/nova/virt/hyperv/hostops.py
index b2a025e0c..a2f9d5904 100644
--- a/nova/virt/hyperv/hostops.py
+++ b/nova/virt/hyperv/hostops.py
@@ -152,6 +152,7 @@ class HostOps(baseops.BaseOps):
data["supported_instances"] = \
[('i686', 'hyperv', 'hvm'),
('x86_64', 'hyperv', 'hvm')]
+ data["hypervisor_hostname"] = platform.node()
self._stats = data
diff --git a/nova/virt/powervm/operator.py b/nova/virt/powervm/operator.py
index bc0986ca4..2601f0537 100644
--- a/nova/virt/powervm/operator.py
+++ b/nova/virt/powervm/operator.py
@@ -156,6 +156,7 @@ class PowerVMOperator(object):
data['host_memory_free'] = memory_info['avail_mem']
data['hypervisor_type'] = constants.POWERVM_HYPERVISOR_TYPE
data['hypervisor_version'] = constants.POWERVM_HYPERVISOR_VERSION
+ data['hypervisor_hostname'] = self._operator.get_hostname()
data['extres'] = ''
self._host_stats = data
diff --git a/nova/virt/xenapi/fake.py b/nova/virt/xenapi/fake.py
index b22112f66..db4f5d03e 100644
--- a/nova/virt/xenapi/fake.py
+++ b/nova/virt/xenapi/fake.py
@@ -583,7 +583,9 @@ class SessionBase(object):
return jsonutils.dumps({'host_memory': {'total': 10,
'overhead': 20,
'free': 30,
- 'free-computed': 40}})
+ 'free-computed': 40},
+ 'host_hostname': 'fake-xenhost',
+ })
def _plugin_poweraction(self, method, args):
return jsonutils.dumps({"power_action": method[5:]})
diff --git a/nova/virt/xenapi/host.py b/nova/virt/xenapi/host.py
index 8a69f7c54..39a3b9824 100644
--- a/nova/virt/xenapi/host.py
+++ b/nova/virt/xenapi/host.py
@@ -174,6 +174,7 @@ class HostState(object):
data["host_memory_free_computed"] = host_memory.get(
'free-computed', 0)
del data['host_memory']
+ data['hypervisor_hostname'] = data['host_hostname']
self._stats = data