How to write rally plugin with rally 0.9

Asked by laura

Hi,

I could create a rally scenario as plugin(e.g: VMTasks.boot_runcommand_delete) in rally0.7, in my case I rewrite vmtasks.py and put it under .rally/plugin/scenario folder, and succeed to run it.

Then I want to do the same using rally0.9, but it gives out an error - Task config is invalid: 'There are no benchmark scenario with names: 'VMTasksSeeding.boot_runcommand'' .

Could someone tell me why this happens and how to fix it? Thanks!

Below is my related code which is rewrited as a rally plugin and refers to /rally/plugins/openstack/scenarios/vm/vmtasks.py
vi ~/rally_home/.rally/plugins/scenario/vmtasks_seeding.py
..
@types.convert(image={"type": "glance_image"},
               flavor={"type": "nova_flavor"})
@validation.image_valid_on_flavor("flavor", "image", fail_on_404_image=False)
@validation.valid_command("command")
@validation.number("port", minval=1, maxval=65535, nullable=True,
                   integer_only=True)
@validation.external_network_exists("floating_network")
@validation.required_services(consts.Service.NOVA, consts.Service.CINDER)
@validation.add("required_platform", platform="openstack", users=True)
@scenario.configure(context={"keypair": {}, "allow_ssh": None},
                    name="VMTasksSeeding.boot_runcommand")
class BootRuncommand(vm_utils.VMScenario):
..

Question information

Language:
English Edit question
Status:
Solved
For:
Rally Edit question
Assignee:
No assignee Edit question
Solved by:
laura
Solved:
Last query:
Last reply:
Revision history for this message
Andriy Kurilin (andreykurilin) said :
#1

Hi, laura!
It sounds really strange. Can you launch Rally in debug mode(rally --debug task start...) and post the whole output?

Revision history for this message
laura (mysterious03) said :
#2

Hi Andrey,

Here is the output, but can't get more useful information.
rally@5d632999bbf8:~$ rally --debug task start .rally/tasks/myvmtasks.yaml
Running Rally version 0.9.0
--------------------------------------------------------------------------------
Preparing input task
--------------------------------------------------------------------------------

Task is:
---
  VMTasksSeeding.boot_runcommand:
    -
      args:
        flavor:
            name: "m1.small"
        image:
            name: "^ubuntu-.*-server-amd64"
        volume_args:
            size: 10
        floating_network: "public-tempest"
        force_delete: false
        command:
            local_path: "/home/rally/.rally/tasks/vmtask.sh"
            remote_path: "/tmp/vmtask.sh"
        username: "ubuntu"
      runner:
        type: "constant"
        times: 1
        concurrency: 1
      context:
         network: {}
      sla:
         failure_rate:
           max: 0

Task syntax is correct :)
Task config is invalid: `There are no benchmark scenarios with names: `VMTasksSeeding.boot_runcommand`.`

Revision history for this message
Andriy Kurilin (andreykurilin) said :
#3

The output looks strange. Between 2 next lines, there should be info about loading plugins.

  > rally@5d632999bbf8:~$ rally --debug task start .rally/tasks/myvmtasks.yaml
  > Running Rally version 0.9.0

An example of such output - http://logs.openstack.org/41/463341/1/check/gate-rally-dsvm-rally-cinder/ab603de/console.html#_2017-05-08_14_53_10_270236 .

It is possible that you have some custome setting for logs in rally.conf file that hides info and debug messages. Is this true?

Revision history for this message
laura (mysterious03) said :
#4

Yes, I have set as below. The problem is fixed. The issue I met is because I didn't use the right code base. I rewrite the plugin using rally master branch by mistake, should use rally 0.9 tag code. Thanks!

rally@5d632999bbf8:~$ cat .rally/rally.conf
[DEFAULT]
https_insecure=True
log_dir=/home/rally/.rally/logs
log_file=rally.log
debug=true
rally_debug=true
openstack_client_http_timeout=1800.0
...