Scenario NovaHosts.list_and_get_hosts doesn't work with Rally v0.8.1 and v0.9.0

Bug #1675254 reported by Tetiana Korchak
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Rally
Fix Released
Undecided
zhangzhihui

Bug Description

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

Tetiana Korchak (kotavi)
description: updated
description: updated
Jonte Watford (jwatford)
Changed in rally:
assignee: nobody → Jonte Watford (jwatford)
Revision history for this message
Jonte Watford (jwatford) wrote :

Adding the code segment does not solve this issue. What exactly did you do? can you show something more detailed?

Changed in rally:
assignee: Jonte Watford (jwatford) → nobody
Revision history for this message
Tetiana Korchak (kotavi) wrote :

I also updated nova.conf by adding AggregateInstanceExtraSpecsFilter to scheduler_default_filters
and restarted service
service nova-scheduler restart

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

Sorry, previous comment was to the wrong thread.
To solve this issue I only did described changes in rally docker container in file
/usr/local/lib/python2.7/dist-packages/rally/plugins/openstack/scenarios/nova/hosts.py

zhangzhihui (zhangzhang)
Changed in rally:
assignee: nobody → zhangzhihui (zhangzhang)
Revision history for this message
zhangzhihui (zhangzhang) wrote :

The scenario measure the "nova host-describe <hostname>" command performance, the code will describe all hosts which are listed by "nova host-list" command performance. but the hostname seems to must be compute host's name, so we only should describe compute host. the code is wrong.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to rally (master)

Fix proposed to branch: master
Review: https://review.openstack.org/454558

Changed in rally:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to rally (master)

Reviewed: https://review.openstack.org/454558
Committed: https://git.openstack.org/cgit/openstack/rally/commit/?id=84229476d8d93ee6569aaf35427a605917d8836f
Submitter: Jenkins
Branch: master

commit 84229476d8d93ee6569aaf35427a605917d8836f
Author: zhangzhang <email address hidden>
Date: Fri Apr 7 10:35:58 2017 -0400

    Fix list_and_get_host scenario bug

    The scenario measure the "nova host-describe <hostname>" command
    performance, the code will describe all hosts which are listed by "nova
    host-list" command performance. but the hostname seems to must be
    compute host's name, so we only can describe compute hosts.

    Change-Id: I037264580570e68b8cd587280f50660d89566051
    Closes-Bug: #1675254

Changed in rally:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to rally (stable/0.9)

Fix proposed to branch: stable/0.9
Review: https://review.openstack.org/454810

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to rally (stable/0.9)

Reviewed: https://review.openstack.org/454810
Committed: https://git.openstack.org/cgit/openstack/rally/commit/?id=71182b27516d1241c84a871e7842a7ca303421c8
Submitter: Jenkins
Branch: stable/0.9

commit 71182b27516d1241c84a871e7842a7ca303421c8
Author: zhangzhang <email address hidden>
Date: Fri Apr 7 10:35:58 2017 -0400

    Fix list_and_get_host scenario bug

    The scenario measure the "nova host-describe <hostname>" command
    performance, the code will describe all hosts which are listed by "nova
    host-list" command performance. but the hostname seems to must be
    compute host's name, so we only can describe compute hosts.

    NOTE: change in atomics from original patch is missed here, since atomic
          refactoring patch was not included in 0.9.0 release

    Change-Id: I037264580570e68b8cd587280f50660d89566051
    Closes-Bug: #1675254
    (cherry picked from commit 84229476d8d93ee6569aaf35427a605917d8836f)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.