Comment 1 for bug 1641971

Revision history for this message
Jeff Lane  (bladernr) wrote :

So after some chatting with the maas team and me pulling out tufts of hair in frustration, I finally figured it out.

Once the initial import is done, you need to do the following steps (manually, the automated part can come from this):

1: fine the boot source ID (likely 1, since that's the first one you get automatically)
bladernr@critical-maas:~$ maas admin boot-sources read
Success.
Machine-readable output follows:
[
    {
        "keyring_filename": "/usr/share/keyrings/ubuntu-cloudimage-keyring.gpg",
        "created": "2016-11-14T18:32:00.358",
        "url": "http://images.maas.io/ephemeral-v3/daily/",
        "keyring_data": "",
        "id": 1,
        "updated": "2016-11-14T18:32:00.358",
        "resource_uri": "/MAAS/api/2.0/boot-sources/1/"
    }
]

which yields an ID of 1.

then you need to find the boot-resource-selection ID (also default of 1):
bladernr@critical-maas:~$ maas admin boot-source-selections read 1
Success.
Machine-readable output follows:
[
    {
        "subarches": [
            "*"
        ],
        "arches": [
            "amd64"
        ],
        "id": 1,
        "os": "ubuntu",
        "labels": [
            "*"
        ],
        "release": "xenial",
        "resource_uri": "/MAAS/api/2.0/boot-sources/1/selections/1/"
    }
]

Note that also has an ID of 1.

Then you need to modify that selection like so:

bladernr@critical-maas:~$ maas admin boot-source-selection update 1 1 arches="amd64" arches="i386"
Success.
Machine-readable output follows:
{
    "subarches": [
        "*"
    ],
    "arches": [
        "amd64",
        "i386"
    ],
    "id": 1,
    "os": "ubuntu",
    "labels": [
        "*"
    ],
    "release": "xenial",
    "resource_uri": "/MAAS/api/2.0/boot-sources/1/selections/1/"
}

THEN you need to redo the import:
bladernr@critical-maas:~$ maas admin boot-resources import
Success.
Machine-readable output follows:
Import of boot resources started

and that should pull in i386.

Now, I have a suspicion that perhaps we can do the modification BEFORE we run the first import.

So the steps would be:

Find the source ID
find the selections ID
modify (or possibly create) the selection
THEN run the import

which should pull in both i386 and amd64 (or whatever we list/modify).

More can be found here:
http://maas.io/docs/en/manage-cli-images

additionally, maybe it's worth finding a way to list available arches and ask which ones to import, as some users may only need to pull in power, or arm, or amd64. or combinations of the available ones like "amd64, ppc64el"