rally问题合集

rally 执行过程中涉及到keystone的用例,需要调用adminurl,在~/rally/lib/python2.7/site-packages/rally/osclients.py(主机文件的位置依个人而定)create_client函数中添加endpoint_override(rally的existing文件中给了endpoint但是实际上没有起作用)


def create_client

    .....

    if self.credential.endpoint:(add)

        kw["endpoint_override"] = self.credential.endpoint

    return client.Client(**kw)

关于rally相关脚本存放的位置:

  • wait_for_status:~/rally/src/rally/task/utils.py

  • osclient:~/rally/lib/python2.7/site-packages/rally/osclient.py

  • openstack原生api:~/rally/lib/python2.7/site-packages/neutronclient(novaclient)

rally中的判断状态的wait_for只能用class,需要将dict装换为list传入

例如:判断servers的状态时

在context中添加:


self.context['tenants'][tenant_id]['server'] = server.to_dict() #to_dict装换为dict

在scenarios中添加:


manager = self.clients("nova").servers

servers = manager.show(self.context[...]['id'],....)#获取server的id以list的方式传入wait_for

neutron 不能用wait_for

task中涉及中文问题,在json文件中加入:
忘记了.....

rally的deployment状态变成deploy->inconsistent:
导致的原因(我的原因可能是在调试的时候错误退出了任务):

An instance of this class used as a context manager on any unsafe operations to a deployment. Any unhandled exceptions bring a status of the deployment to the inconsistent state.

用最快的方法解决一下这个问题,用以下方法对数据库没有影响,不需要备份数据

rally deployment recreate --deployment uuid
原文地址:https://www.cnblogs.com/joy-li/p/6925220.html