How to use standard images

Errors or typos? Topics missing? Hard to read? Let us know.

This page explains how to select and import the provisioning images that MAAS requires.

Standard images

Canonical provides two SimpleStreams for MAAS images: candidate and stable. Both streams contain Ubuntu images, CentOS images, bootloaders extracted from the Ubuntu archive, and release notifications. Either stream can be used in any version of MAAS greater than 2.1 – but not all images are supported in older versions. Note that MAAS uses the stable stream by default.

Switch to the candidate image stream

To switch to the candidate stream:

  • In the MAAS UI, select Images > Change source > Custom > set URL to http://images.maas.io/ephemeral-v3/candidate> Connect.

  • Via the CLI, enter the following command:

    BOOT_SOURCE_ID=$(maas $PROFILE boot-sources read | jq '.[] | select(.url | contains("images.maas.io/ephemeral-v3")) | .id')
    maas $PROFILE boot-source update $BOOT_SOURCE_ID url=$STREAM_URL
    

Switch to the stable image stream

To switch to the stable stream:

  • In the MAAS UI, select Images > Change source > Custom > set URL to maas.io> Connect.

  • Via the CLI, enter the following command:

    BOOT_SOURCE_ID=$(maas $PROFILE boot-sources read | jq '.[] | select(.url | contains("maas.io")) | .id')
    maas $PROFILE boot-source update $BOOT_SOURCE_ID url=$STREAM_URL
    

Import Standard Images from maas.io (UI)

The Images page shows what images and architectures have been selected and downloaded. By default, MAAS will automatically grab the most recent Ubuntu LTS releases (and amd64 architecture).

To remove an image, simply un-select it and click Save selection.

Use other image mirrors (UI)

You can also host Ubuntu images on a mirror. To use these mirrors:

Select Images > Change source > Custom > enter the mirror URL > select Connect.

For advanced options, choose Show advanced options.

Optionally, a local mirror can be set up as the boot source. MAAS will then use it instead of the standard internet-based server. Local mirroring significantly reduces the time required import images. See Local image mirror for instructions.

Import and provision non-Ubuntu images

It is also possible to import and provision images other than Ubuntu. Images supported and provided by MAAS will appear in Images >> Other Images. These images can be imported and used just like the Ubuntu images above.

Sync standard images

You can tell MAAS to sync images hourly, at the region level. See Boot image sources) for more details. We highly recommended syncing images hourly. Syncing at the rack controller level (from regiond) occurs every 5 min and cannot be disabled.

List boot sources (CLI)

If you want to download boot sources, i.e., the locations from which you may download images, try the following:

maas $PROFILE boot-sources read

Although multiple boot sources may be listed, MAAS can only practically work with a single boot source.

Select boot sources (CLI)

Use the boot-source-selections command to select images from a boot source. After selecting new images, you will need to import them.

maas $PROFILE boot-source-selections create $SOURCE_ID \
    os="ubuntu" release="$SERIES" arches="$ARCH" \
    subarches="$KERNEL" labels="*"

For example, to select all kernels for 64-bit Trusty from a boot source with an id of ‘1’:

maas $PROFILE boot-source-selections create 1 \
    os="ubuntu" release="trusty" arches="amd64" \
    subarches="*" labels="*"

Get hardware enablement (HWE) kernels (CLI)

For example, to get just the latest amd64 HWE kernel available for Trusty, which, at the time of writing, is from Xenial:

maas $PROFILE boot-source-selections create 1 \
    os="ubuntu" release="trusty" arches="amd64" \
    subarches="hwe-x" labels="*"

For Xenial kernels (and starting with MAAS 2.1), notation has changed. To select the latest amd64 HWE kernel available for Xenial:

maas $PROFILE boot-source-selections create 1 \
    os="ubuntu" release="xenial" arches="amd64" \
    subarches="hwe-16.04" labels="*"

List image selections (CLI)

To list image selections for a boot source:

maas $PROFILE boot-source-selections read $SOURCE_ID

Import newly selected images (CLI)

To import newly-selected images (boot resources):

maas $PROFILE boot-resources import

Once newly-selected images are imported, a sync mechanism is enabled (by default) to keep them up to date. The refresh time interval is 60 minutes.

Available images resulting from this action are reflected in the web UI.

List currently available images (CLI)

To list currently available/imported images (boot resources):

maas $PROFILE boot-resources read

Delete a boot source (CLI)

To delete a boot source (the location from which you can download images):

maas $PROFILE boot-source delete $SOURCE_ID

If you delete the sole boot source, then the fields ‘Sync URL’ and ‘Keyring Path’ in the web UI will take on null values.

Editing a boot source (CLI)

You can edit an existing boot source by changing the GPG keyring file ($KEYRING_FILE) and the location ($URL).

Update the boot source:

maas $PROFILE boot-source update $SOURCE_ID \
    url=$URL keyring_filename=$KEYRING_FILE

At this time MAAS only supports a boot source containing official MAAS images. As a result, you can only edit a boot source if you have set up a mirror of its images. The location can change, but the keyring remains constant:

KEYRING_FILE=/usr/share/keyrings/ubuntu-cloudimage-keyring.gpg

Add a boot source (CLI)

To avoid unnecessary complexity, you should probably delete any existing boot sources before adding a new one.

Presented below are a couple of use cases for adding a boot source:

  • Use a local image mirror (official images)
  • If you deleted the default image, re-create it

The general syntax is:

maas $PROFILE boot-sources create \
    url=$URL keyring_filename=$KEYRING_FILE

The output will include a new numeric ID that identifies the boot source ($SOURCE_ID).

Since MAAS can only practically work with a single boot source, you will need to delete any existing sources. Note that the location (URL) is the only variable. The only supported keyring is:

KEYRING_FILE=/usr/share/keyrings/ubuntu-cloudimage-keyring.gpg

If you added a sole boot source, then the fields ‘Sync URL’ and ‘Keyring Path’ in the web UI will reflect its values.

Use a local image mirror

Once the mirror is set up according to Local image mirror it is just a matter of specifying the mirror location (URL). Since the images come from the default source, you should use the default keyring. If you are following the above mirror document, the variable values should be:

Where $MIRROR is the mirror server’s hostname or IP address.

Re-create the default boot source

Re-create the default boot source if it was ever deleted using the following variable values:

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.