Add adding multiple simplestreams with per-image stream preference

Currently, MAAS only supports a single simple stream for image syncing. By default this pulls from the stable stream at maas.io, but there are also occasions where someone would want to install the candidate stream (e.g. getting development releases or using an internal simple stream that hosts other MAAS compatible images in a company environment).

It would be nice if MAAS could support a limited number of additional streams and then at the Image level allow selecting which stream to pull the image from.

A sample use case could be:

  • having both the stable and candidate streams tracked
  • pulling current LTS releases from stable stream (selecting stable as the preferred source for thatt image)
  • pulling the most recent dev release from candidate (selecting candidate as the preferred source for that image)

Another scenario (one we’ve recently seen in the test lab) is this:

  • The MAAS server tracks the candidate stream.
  • Something changed breaking installations of Jammy from Candidate, but other images were verified as still working.
  • Because of how streams are handled currently, we had to completely shift to the stable stream and that forces a deletion and re-sync of all images. This process took several hours and had to be restarted. It was also discovered that often the streams from maas.io can be extremely slow (<500kb/s download was reported in chat) meaning even without being hung and having to restart, the download of up to 8 versions of Ubuntu took nearly a day, with maas being unable to deploy during that time.
  • If we had the ability to track both stable and candidate at the same time, we could have simply had MAAS sync ONLY the Jammy images from stable while leaving everything else on Candidate.
    • Or alteratively, we could track stable for all LTS images, and candidate for all interim and dev release images

MAAS currently supports multiple sources (only in the CLI).

The important bit is that you should never make selections on the sources that are clashing, otherwise you don’t really know what image you are going to download as it’s not deterministic. We are addressing this problem in the new API: we’ll give the user the ability to set a priority on every source so to know how to resolve the conflict.

I can’t wait for API 3.0. Seems like lots of improvements being made.