diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-11-07 02:04:07 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-11-07 02:04:07 +0000 |
| commit | b01a1bd047408fc9ef9ee87579d0b71d4303c99a (patch) | |
| tree | f980beeec8db12b72823212ffd76fd3bfd385434 /nova/virt | |
| parent | 5f8b4aa85e96b8823412a919d601b49ee9b03830 (diff) | |
| parent | c918ff377f9854a38486a00a0a62548eb27dd2a9 (diff) | |
Merge "Make ComputeDrivers send hypervisor_hostname"
Diffstat (limited to 'nova/virt')
| -rw-r--r-- | nova/virt/baremetal/driver.py | 2 | ||||
| -rw-r--r-- | nova/virt/fake.py | 5 | ||||
| -rw-r--r-- | nova/virt/hyperv/hostops.py | 1 | ||||
| -rw-r--r-- | nova/virt/powervm/operator.py | 1 | ||||
| -rw-r--r-- | nova/virt/xenapi/fake.py | 4 | ||||
| -rw-r--r-- | nova/virt/xenapi/host.py | 1 |
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 |
