eucalyptus/eutester

ec2.get_all_images gets images regardless of availability, causing test failures

Opened this issue · 0 comments

Repro:

  1. Install testing branch of latest eutester.
  2. Pull down creds for greg@eucalyptus on the 3.3 internal test cloud.
  3. (optional) Run cloud_admin/create_user.py to get some new users.
  4. Run cloud_admin/create_resources.py.

Full test report at the following gist: https://gist.github.com/gregdek/5499920

So it seems like what's happening is that a tester is being loaded that does not have access to all the EMIs. create_resources.py calls:

reservation=resource_tester.run_instance(keypair=keypair.name,group=group.name,zone=zone)

...so ec2ops.run_instance basically says "run the EMI given, and if that doesn't work, just run the first EMI you find." Trouble is, this in turn calls the ec2.get_all_images call to get a list of potential images -- and sometimes picks an EMI that the current credentials don't have access to.

There's one public image on this cloud that every account should have access to: emi-66AC3CEB. But run_instance, after pulling all images, instead chooses emi-65CC32E0 -- which is not available to the various users.

I'm guessing this is only showing up now because the new 3.3 clouds have lots of private images for the various services; previously, maybe all images were public by default?

Not sure why boto's get_all_images would even allow this.

Possible remediations:

  1. Put the responsibility on the individual test to pull a valid list of EMIs and deprecate the ability for ec2ops.run_instance to run a random image;
  2. Filter the ec2.get_all_images output so that only properly public EMIs are returned.