Nova aggregate scenarios should use self._list_hypervisors() instead of self._list_hosts()

Bug #1640642 reported by Rajath Agasthya
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Rally
Fix Released
Undecided
Rajath Agasthya

Bug Description

The CreateAggregateAddAndRemoveHost aggregate scenario in rally/plugins/openstack/scenarios/nova/aggregate.py currently uses self._list_hosts() and picks the first host to add to the aggregate. It needs to use self._list_hypervisors() instead because self._list_hosts() also includes controller nodes and the scenario fails when it tries to add a controller node to an aggregate.

Here's the diff:

class CreateAggregateAddAndRemoveHost(utils.NovaScenario):
    """Scenario for add a host to and remove the host from an aggregate."""

    def run(self, availability_zone):
        """Create an aggregate, add a host to and remove the host from it

        Measure "nova aggregate-add-host" and "nova aggregate-remove-host"
        command performance.
        :param availability_zone: The availability zone of the aggregate
        """
        aggregate = self._create_aggregate(availability_zone)
- hosts = self._list_hosts(zone=None)
- host_name = hosts[0].host_name
+ hosts = self._list_hypervisors()
+ host_name = hosts[0].hypervisor_hostname
        self._aggregate_add_host(aggregate, host_name)
        self._aggregate_remove_host(aggregate, host_name)

I'd be willing to submit a patch if this bug is confirmed.

Changed in rally:
assignee: nobody → Rajath Agasthya (rajagast)
Revision history for this message
Ala Rezmerita (arezmerita) wrote :

@rajath actually it must be something like this:
hosts = self._list_hypervisors()
host_name = hosts[0].service['host']

because hosts[0].hypervisor_hostname can be a FQDN and _aggregate_add_host will fail if the host_name is an FQDN

Changed in rally:
status: New → Confirmed
Revision history for this message
Rajath Agasthya (rajagast) wrote :

@Ala - Thanks for the input. Do you know why _aggregate_add_host would fail if hypervisor_hostname is an FQDN?

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/405143

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

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

commit c89586ce35a5aeb244e7b337901a527aaf2a25ba
Author: Rajath Agasthya <email address hidden>
Date: Wed Nov 30 17:41:23 2016 -0800

    Use _list_hypervisors() method in nova aggregates

    Change nova aggregate test cases to use _list_hypervisors()
    instead of _list_hosts() method.

    Change-Id: Iaea5d3748935e710724da2793e650a98ff9d282f
    Closes-Bug: #1640642

Changed in rally:
status: In Progress → Fix Released
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.