About Images

Hello Everyone,

I hope you’re doing fine !

I am wondering is there a way to just register, I would say an “unknow” image that maas would just dd to first disk during deployment ?

I have tried many diffrent around boot-resources create thanks to the docs, the forums, google search, without succes.

Thanks in advance,
Have a nice day,
Best Regards,
Mickaël.

Typo :

I have tried many “different things” around boot-resources create thanks to the docs, the forums, google search, without succes.

And PS :
Unsupport operating system blablabla, supported operating systems: [‘ubuntu’, ‘ubuntu-core’, ‘bootloader’, ‘centos’, ‘rhel’, ‘custom’, ‘windows’, ‘suse’, ‘caringo’, ‘esxi’]
Can’t we have a kind of “raw”, like just write it?

You can upload custom images in dd format using a procedure similar to the one described in https://discourse.maas.io/t/using-static-ubuntu-images/5279 (see “How to upload a custom Ubuntu image”).
You need to specify the base_image field to match the operating system that image is based on.

Hello and thanks for your answer.

But !
Your link is not working, searching discourse for the topic lead nowhere.

Also I repeat myself, it is not a custom ubuntu image.
It is not even a “custom” image of any OS at all.
Does MAAS can dd for me anything? Even garbage?

Thanks in advance,
Have a nice day,
Best Regards,
Mickaël.

I even didn’t noticed up to now, but I guess I crashed the rack controller which is now in a forever trying loop to handle the image.
Do you know how to clear the error ?

Doing :

  maas $profile boot-resources create \
    name='bootloader/garbage.1.2.3' \
    title='Test Garbage Image 1.2.3'  \
    architecture='amd64/generic' \
    filetype='ddgz' \
    content@=/tmp/test-garbage.1.2.3.img.gz
 
Apr  6 11:13:15 localhost sh[1249]: 2022-04-06 11:13:15 provisioningserver.rpc.common: [critical] Unhandled failure dispatching AMP command. This is probably a bug. Please ensure that this error is handled within application code or declared in the signature of the b'ListBootImages' command. [maas2:pid=1248:cmd=ListBootImages:ask=40]
...
Apr  6 11:13:37 localhost sh[1249]: #011builtins.ValueError: too many values to unpack (expected 3)

uname -a
Linux maas2 5.4.0-104-generic #118-Ubuntu SMP Wed Mar 2 19:02:41 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
lsb_release --all
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.4 LTS
Release:        20.04
Codename:       focal


dpkg -l | grep maas
ii  maas                                  1:3.1.0-10901-g.f1f8f1505-0ubuntu1~20.04.1  all          "Metal as a Service" is a physical cloud and IPAM
ii  maas-cli                              1:3.1.0-10901-g.f1f8f1505-0ubuntu1~20.04.1  all          MAAS client and command-line interface
ii  maas-common                           1:3.1.0-10901-g.f1f8f1505-0ubuntu1~20.04.1  all          MAAS server common files
ii  maas-dhcp                             1:3.1.0-10901-g.f1f8f1505-0ubuntu1~20.04.1  all          MAAS DHCP server
ii  maas-proxy                            1:3.1.0-10901-g.f1f8f1505-0ubuntu1~20.04.1  all          MAAS Caching Proxy
ii  maas-rack-controller                  1:3.1.0-10901-g.f1f8f1505-0ubuntu1~20.04.1  all          Rack Controller for MAAS
ii  maas-region-api                       1:3.1.0-10901-g.f1f8f1505-0ubuntu1~20.04.1  all          Region controller API service for MAAS
ii  maas-region-controller                1:3.1.0-10901-g.f1f8f1505-0ubuntu1~20.04.1  all          Region Controller for MAAS
ii  python3-django-maas                   1:3.1.0-10901-g.f1f8f1505-0ubuntu1~20.04.1  all          MAAS server Django web framework (Python 3)
ii  python3-maas-client                   1:3.1.0-10901-g.f1f8f1505-0ubuntu1~20.04.1  all          MAAS python API client (Python 3)
ii  python3-maas-provisioningserver       1:3.1.0-10901-g.f1f8f1505-0ubuntu1~20.04.1  all          MAAS server provisioning libraries (Python 3)

apt list -a maas
Listing... Done
maas/focal,now 1:3.1.0-10901-g.f1f8f1505-0ubuntu1~20.04.1 all [installed]
maas/focal-updates 1:0.7 all
maas/focal 1:0.6 all

Sorry, but seems doing a “Update selection” for the WEB GUI Images solved the issue.

So first question remains :

Does MAAS can dd for me anything? Even garbage?

I’ve similar need, i.e. to dd some img (e.g. memtest86.img).
I’ve successfully uploaded the image by cheating base_image=ubuntu/focal, during the deployment it failed at curtin hook and status failed deployment in maas portal (see below for err msg). A quick check on the hdd found that it dd the image on the hdd (and bootable from efi shell). I guess I need to pack curtin/cloud-init or whatever into the img to make it work?

Running curtin builtin curthooks
finish: cmd-install/stage-curthooks/builtin/cmd-curthooks: FAIL: curtin command curthooks
Traceback (most recent call last):
  File "/curtin/curtin/commands/main.py", line 202, in main
    ret = args.func(args)
  File "/curtin/curtin/commands/curthooks.py", line 1886, in curthooks
    builtin_curthooks(cfg, target, state)
  File "/curtin/curtin/commands/curthooks.py", line 1681, in builtin_curthooks
    distro_info = distro.get_distroinfo(target=target)
  File "/curtin/curtin/distro.py", line 118, in get_distroinfo
    variant_name = variant_os_release['ID']
KeyError: 'ID'
'ID'
curtin: Installation failed with exception: Unexpected error while running command.
Command: ['curtin', 'curthooks']
Exit code: 3

Hi @wpteoh and @mkl1 ,

MAAS doesn’t support deploying arbitrary images, it needs some preconditions and assumptions to be fulfilled. You can try to trick MAAS into deploying your image by:

  1. using a raw image (dd.gz)
  2. creating the boot-resource with base_image set to something MAAS knows how to deploy (e.g. ubuntu/focal)
  3. inhibiting the default Curtin hook by adding a /curtin/curtin-hooks script to the image.
  4. adding cloud-init to the system initialization, or a script that downloads cloud-init’s user-data from MAAS during the first boot.
  5. adding a dpkg-query script to fake the presence of packages (when the system is not ubuntu based)

DISCLAIMER: this is NOT supported. These tricks might get you far, but there’s no guarantee it will work in end.

1 Like

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