Comment 0 for bug 1675254

Revision history for this message
Tetiana Korchak (kotavi) wrote :

Here is my cluster
$nova host-list
+---------------+-------------+----------+
| host_name | service | zone |
+---------------+-------------+----------+
| ic4-ctl01-*** | cert | internal |
| ic4-ctl01-*** | consoleauth | internal |
| ic4-ctl01-*** | conductor | internal |
| ic4-ctl01-*** | scheduler | internal |
| ic4-cpu15-*** | compute | nova |
| ic4-cpu07-*** | compute | nova |
| ic4-cpu03-*** | compute | nova |
| ic4-cpu01-*** | compute | nova |
| ic4-cpu04-*** | compute | nova |
| ic4-cpu08-*** | compute | nova |
| ic4-cpu02-*** | compute | nova |
| ic4-cpu06-*** | compute | nova |
+---------------+-------------+----------+

and rally scenario returns this error
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/rally/task/runner.py", line 72, in _run_scenario_once
    getattr(scenario_inst, method_name)(**scenario_kwargs)
  File "/usr/local/lib/python2.7/dist-packages/rally/plugins/openstack/scenarios/nova/hosts.py", line 60, in run
    self._get_host(host.host_name, atomic_action=False)
  File "/usr/local/lib/python2.7/dist-packages/rally/task/atomic.py", line 115, in func_atomic_actions
    f = func(self, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/rally/plugins/openstack/scenarios/nova/utils.py", line 1063, in _get_host
    return self.admin_clients("nova").hosts.get(host_name)
  File "/usr/local/lib/python2.7/dist-packages/novaclient/v2/hosts.py", line 65, in get
    return self._list("/os-hosts/%s" % host, "host")
  File "/usr/local/lib/python2.7/dist-packages/novaclient/base.py", line 254, in _list
    resp, body = self.api.client.get(url)
  File "/usr/local/lib/python2.7/dist-packages/keystoneauth1/adapter.py", line 223, in get
    return self.request(url, 'GET', **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/novaclient/client.py", line 80, in request
    raise exceptions.from_response(resp, body, url, method)
NotFound: Compute host ic4-ctl01-*** could not be found. (HTTP 404) (Request-ID: req-553c16ff-73a7-4610-8011-a66cd8570b80)

Did update to the code to make it work

rally/rally/plugins/openstack/scenarios/nova/hosts.py
The current version:
    def run(self, zone=None):
  ...
        hosts = self._list_hosts(zone)
        with atomic.ActionTimer(self, "nova.get_%s_hosts" % len(hosts)):
            for host in hosts:
                self._get_host(host.host_name, atomic_action=False)
Added:

if host.service == "compute":
    self._get_host(host.host_name, atomic_action=False)

And this fixed issue