Images created by images context cannot be passed to scenario

Bug #1503744 reported by Chris St. Pierre on 2015-10-07
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

If you create a named image with the images context, you cannot use that image name as an argument to a scenario. For instance:

- args:
      name: m1.small
      name: fedora-22
      image_type: raw
      image_container: bare
      image_name: fedora-22
        tenants: 2
        users_per_tenant: 2

This happens because the image is created as a non-public image in each ephemeral tenant, but ImageResourceType.transform() queries for images as the admin (i.e., in the admin context).

Unfortunately, it won't work to simply make ImageResourceType search all tenants, since the task I described above winds up creating two images named "fedora-22", and each run of the scenario must use the correct image. I think the best solution is to make preprocess() run for each scenario instead of for each task, and pass it the scenario context so that it had the non-admin creds that the scenario was being run with. That's obviously a big change, and it has a huge downside: most of the preprocessed resource types can be run just once for the entire task, not once per run. So we may need to split out two different ResourceType subclasses: one that applies per-task, and one that applies per-run.

Obviously this is a mess.

Boris Pavlovic (boris-42) wrote :


Described workflow ahead is not what actually happens in real life.

First of all validation is executed before context classes are actually run. So at the moment of validation you don't have any images at all.

That's why during image validation we are analyzing whatever we use image_context or not. And if we are using we are expecting that we will have such image.

Here is the code:

Changed in rally:
status: New → Incomplete
Chris St. Pierre (stpierre) wrote :

I've dug into this some more, and I'm not sure we're talking about the same thing. The error I'm hitting isn't in validation, but in the runner. Here's the traceback I'm getting, for instance:

[-] Invalid scenario argument: 'Image with pattern 'rally-f22' not found'
Traceback (most recent call last):
  File "/home/cstpierr/stack/rally/rally/task/", line 350, in run
    name, context_obj, kw.get("args", {}))
  File "/home/cstpierr/stack/rally/rally/task/", line 206, in run
    args = types.preprocess(name, context, args)
  File "/home/cstpierr/stack/rally/rally/task/", line 63, in preprocess
    clients=clients, resource_config=resource_cfg)
  File "/home/cstpierr/stack/rally/rally/task/", line 262, in transform
  File "/home/cstpierr/stack/rally/rally/task/", line 184, in _id_from_name
    return obj_from_name(resource_config, resources, typename).id
  File "/home/cstpierr/stack/rally/rally/task/", line 127, in obj_from_name
    typename=typename.title(), pattern=pattern.pattern))
InvalidScenarioArgument: Invalid scenario argument: 'Image with pattern 'rally-f22' not found'

That's happening in @types decorator processing, and I'm pretty sure that my original explanation is correct. If I kill Rally at the point where it raises that exception (that is, I don't let it clean up), then I can see the image created in the admin user's tenant as a non-public image.

Submitter: Jenkins
Branch: master

commit 013792c458d9c85eebdad02b51963a855615de5c
Author: Chris St. Pierre <email address hidden>
Date: Wed Dec 23 15:50:40 2015 -0600

    Images context: accept arbitrary image create args

    This deprecates the min_ram and min_disk arguments in favor of
    image_args, which lets the user specify any image creation keyword
    arguments they want.

    This provides a workaround for the bug that prevents images created in
    the images context from actually being used by letting the user
    specify that the image should be public, and thus can be used by
    scenarios running other tenants than the admin user's tenant. Also
    adds a gate job to ensure that images created by the images context
    can be used in a scenario.

    Partial-Bug: 1503744
    Change-Id: I200821f4850073990878c38f04959ecf1ff9c522

Launchpad Janitor (janitor) wrote :

[Expired for Rally because there has been no activity for 60 days.]

Changed in rally:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers