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
[...]
So looking at the code, if we are getting the URL from UbuntuCloudImag esURL then we do: "%s/%s" , source, cloudImagesPath)
source = fmt.Sprintf(
which is, essentially, URL = URL + "/releases"
So it sounds like if you set: YOU_HAD/ releases
image-metadata-url = $WHATEVER_
Then it should work.