{image,tools}-metadata-url not usable w/ ec2 provider

Bug #1287949 reported by dann frazier
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Anastasia

Bug Description

I'm trying to override the simple stream used for ec2 images in juju-core 1.17.4. Basically I have an AMI that includes a network-transparent arm64 simulator, and I need to teach juju to use that AMI when I specify an arch=arm64 constraint.

Initially I tried doing this with via environments.yaml by specifying a image-metadata-url parameter to my simple stream. I see juju pull my metadata from the server, but it isn't able to use the AMI I added:

$ juju bootstrap --constraints arch=arm64
Launching instance
WARNING no matching image meta data for constraints: {region: us-east-1, series: trusty, arches: [arm64], constraints: arch=arm64 cpu-power=100, storage: ebs}
ERROR bootstrap failed: cannot start bootstrap instance: no "trusty" images in us-east-1 with arches [arm64]
ERROR cannot start bootstrap instance: no "trusty" images in us-east-1 with arches [arm64]

But, if I instead hack the juju code and change the default value for UbuntuCloudImagesURL to the same URL in ./src/launchpad.net/juju-core/environs/imagemetadata/simplestreams.go to point to the same URL, it launches ok:

$ juju bootstrap --constraints arch=arm64
Launching instance
 - i-63bd8142
Waiting for address
Attempting to connect to ec2-50-17-155-57.compute-1.amazonaws.com:22
Attempting to connect to ip-10-10-53-152.ec2.internal:22
Attempting to connect to 50.17.155.57:22
Attempting to connect to 10.10.53.152:22
[...]

Curtis Hovey (sinzui)
tags: added: config
tags: added: arm64 ppc64el
Changed in juju-core:
status: New → Triaged
importance: Undecided → High
milestone: none → 1.18.0
tags: added: hs-arm64
Revision history for this message
John A Meinel (jameinel) wrote :

So looking at the code, if we are getting the URL from UbuntuCloudImagesURL then we do:
  source = fmt.Sprintf("%s/%s", source, cloudImagesPath)
which is, essentially, URL = URL + "/releases"

So it sounds like if you set:
 image-metadata-url = $WHATEVER_YOU_HAD/releases

Then it should work.

Changed in juju-core:
milestone: 1.20.0 → next-stable
Revision history for this message
dann frazier (dannf) wrote :

I tried this again with 1.19.2, and confirmed I'm using the recommended string (URL = URL + "/releases"). I'm still seeing the same issue, but I have more information to add. The problem does not appear to be with URL parsing, rather that only "signed" metadata is allowed. If I patch the source to permit unsigned metadata, things work as expected.

On the plus side, this might mean that LP: #1320312 isn't an issue for the ec2 provider - but on the negative side, it does seem like the stream override feature isn't a usable feature, in practice, for the ec2 provider, because you can neither provide unsigned repos nor specify a key to use to verify a 3rd party repo.

One suggestion is to add image-metadata-key/tools-metadata-key options for environments.yaml.

summary: - image-metadata-url doesn't work as expected
+ {image,tools}-metadata-url not usable w/ ec2 provider
Curtis Hovey (sinzui)
Changed in juju-core:
importance: High → Medium
milestone: 1.21 → none
Revision history for this message
Bogdan Teleaga (bteleaga) wrote :

This still doesn't work in the latest juju. After trying to deploy a windows AMI with a custom image-metadata-url even with the latest patch https://bugs.launchpad.net/juju-core/+bug/1452422, that fixes generation and maybe other issues I get:

agent-state-info: no "win2012hvr2" images in us-east-1 with arches [amd64]

However doing juju metadata validate-images yields

ImageIds:
- ami-850adbee
Region: us-east-1

Applying the patch specified by dann frazier above does fix the issue.

Revision history for this message
Curtis Hovey (sinzui) wrote :

I am escalating this issue. The patch demonstrate that we can easilly enable any juju cloud developer or tester to develop for arm64, windows, and centos.

Changed in juju-core:
milestone: none → 1.25.0
importance: Medium → High
tags: added: centos windows
Revision history for this message
Bogdan Teleaga (bteleaga) wrote :

I've got a patch for enabling unsigned metadata for ec2 only(as opposed to everything that's simplestreamed) that I'll propose soon. It'll probably bring about another bug report on enabling user-signed metadata after that.

Revision history for this message
Eric Snow (ericsnowcurrently) wrote :
Revision history for this message
Eric Snow (ericsnowcurrently) wrote :

However, I see that only as a temporary hack. I would expect the proper fix to be 2-fold:

* determine signedImageDataOnly based on config criteria (default to true unless custom image-metadata-url is provided
* add a config option to explicitly override the calculated signedImageDataOnly value

Revision history for this message
Eric Snow (ericsnowcurrently) wrote :

...or add a config option for the key to use for custom-signed metadata (see lp:1477464).

Revision history for this message
William Reade (fwereade) wrote :

Yeah, +100 to ericsnow's comments. It's good to allow unsigned metadata; but we need to be sure that we don't open a path by which we can ignore the signature on the official metadata.

Curtis Hovey (sinzui)
Changed in juju-core:
milestone: 1.25.0 → 1.25.1
Changed in juju-core:
milestone: 1.25.1 → 1.26.0
Changed in juju-core:
milestone: 1.26.0 → 2.0-beta5
Changed in juju-core:
milestone: 2.0-beta5 → 2.0-beta4
Curtis Hovey (sinzui)
Changed in juju-core:
milestone: 2.0-beta4 → 2.0-rc1
Curtis Hovey (sinzui)
Changed in juju-core:
milestone: 2.0-beta5 → 2.0-rc1
Curtis Hovey (sinzui)
Changed in juju-core:
milestone: 2.0-beta6 → 2.0-beta7
Revision history for this message
Anastasia (anastasia-macmood) wrote :

Curtis - I believe that this is fixed as part of another bug. This restriction is no longer in code for images supplied though image-metadata-url. Feel free to confirm and close \o/

tags: added: simplestreams
Curtis Hovey (sinzui)
Changed in juju-core:
milestone: 2.0-beta7 → 2.0-beta8
Changed in juju-core:
assignee: nobody → Anastasia (anastasia-macmood)
status: Triaged → Fix Committed
Curtis Hovey (sinzui)
Changed in juju-core:
status: Fix Committed → Fix Released
affects: juju-core → juju
Changed in juju:
milestone: 2.0-beta8 → none
milestone: none → 2.0-beta8
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.