Juju launching Ubuntu Pro instances in AWS/Azure

It looks like this might be possible by specifying a custom machine image, per New feature in Juju 2.8: Add custom machine images with the juju metadata command it should be possible to tell juju to use a pro image with:

juju metadata add-image --series <series> <image-id>

Where series is {trusty,xenial,bionic,focal} and image-id would be the AMI of the Ubuntu Pro image.

The AMI for Ubuntu Pro 18.04 is ami-09109b16d2d9d5779, so you should in theory be able to use:

juju metadata add-image --series bionic ami-09109b16d2d9d5779

I haven’t tested this yet, but it seems possible. It might be necessary to first subscribe to Ubuntu Pro in AWS Marketplace, in order to be able to access the AMI.

It would be nice if Juju could make it easier to enable Ubuntu Pro on models in public clouds where Pro is available.

Update: It doesn’t seem to work :frowning:

I tried the above, obtaining the AMI ID from AWS marketplace two ways:

  • Using the AMI displayed on the “Configure” page for the Pro listing
  • Adding it to Service Catalog and copying the AMI out of the template for the product

In both cases, Juju can’t find the image:

Every 2.0s: juju status                                                                                                                                                               slate: Wed Jul 29 12:36:53 2020

Model  Controller     Cloud/Region   Version  SLA          Timestamp
test   aws-us-west-2  aws/us-west-2  2.8.1    unsupported  12:36:54-05:00

App     Version  Status   Scale  Charm   Store       Rev  OS      Notes
ubuntu           waiting    0/1  ubuntu  jujucharms   15  ubuntu

Unit      Workload  Agent       Machine  Public address  Ports  Message
ubuntu/0  waiting   allocating  0                               waiting for machine

Machine  State    DNS  Inst id  Series  AZ  Message
0        pending       pending  bionic      failed to start machine 0 (cannot run instances: The image id '[ami-0fd6beacda77c37e2]' does not exist (InvalidAMIID.NotFound)), retrying in 10s (9 more attempts)

I’ll open a bug.

Update: LP#:1889458