@atomic.action_timer("nova.find_host_to_migrate")
    def _find_host_to_migrate(self, server):
        server_admin = self.admin_clients("nova").servers.get(server.id)
        host = getattr(server_admin, "OS-EXT-SRV-ATTR:host")
        az_name = getattr(server_admin, "OS-EXT-AZ:availability_zone")
        az = None
        for a in self.admin_clients("nova").availability_zones.list():
            if az_name == a.zoneName:
                az = a
                break
        try:
            new_host = random.choice(
                [key for key, value in six.iteritems(az.hosts)
                    if key != host and
                    value["nova-compute"]["available"] is True])
            return new_host
        except IndexError:
            raise exceptions.InvalidHostException(
                "No valid host found to migrate")
This method isn't yet idempotent; calling multiple times may yield
dataset/ETHPy150Open openstack/rally/rally/plugins/openstack/scenarios/nova/utils.py/NovaScenario._find_host_to_migrate--crossover with--dataset/ETHPy150Open cloudera/ibis/ibis/impala/compiler.py/ImpalaSelect.compile