1

How should I import custom images to MAAS 2.0.0~beta2+bzr4920 in Ubuntu 16.04 LTS Beta2?

The command I successfully used in 1.9 is uploading an image without errors:

$ maas local boot-resources create -d name=custom/foo architecture=amd64/generic filetype=tgz content@=/tmp/ubuntu1604-tgz

This image appears in MAAS > Images > Generated Images section, but I can't seem to find a way of deploying this image afterwards as only boot images from official http://images.maas.io/ appears in the OS to deploy drop list.

BTW /tmp/ubuntu1604-tgz is a renamed copy of official Ubuntu 16.04 from /var/lib/maas/boot-resources/cache/, so I believe there shouldn't be any problems with the image itself and I'm just missing something out.

$ dpkg -l | grep maas
ii  maas                               2.0.0~beta2+bzr4920-0ubuntu2    all          "Metal as a Service" is a physical cloud and IPAM
ii  maas-cli                           2.0.0~beta2+bzr4920-0ubuntu2    all          MAAS client and command-line interface
ii  maas-common                        2.0.0~beta2+bzr4920-0ubuntu2    all          MAAS server common files
ii  maas-dhcp                          2.0.0~beta2+bzr4920-0ubuntu2    all          MAAS DHCP server
ii  maas-dns                           2.0.0~beta2+bzr4920-0ubuntu2    all          MAAS DNS server
ii  maas-proxy                         2.0.0~beta2+bzr4920-0ubuntu2    all          MAAS Caching Proxy
ii  maas-rack-controller               2.0.0~beta2+bzr4920-0ubuntu2    all          Rack Controller for MAAS
ii  maas-region-api                    2.0.0~beta2+bzr4920-0ubuntu2    all          Region controller API service for MAAS
ii  maas-region-controller             2.0.0~beta2+bzr4920-0ubuntu2    all          Region Controller for MAAS
ii  python3-django-maas                2.0.0~beta2+bzr4920-0ubuntu2    all          MAAS server Django web framework (Python 3)
ii  python3-maas-client                2.0.0~beta2+bzr4920-0ubuntu2    all          MAAS python API client (Python 3)
ii  python3-maas-provisioningserver    2.0.0~beta2+bzr4920-0ubuntu2    all          MAAS server provisioning libraries (Python 3)

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04 LTS
Release:    16.04
Codename:   xenial
3

OK, shame on me. I have forgot to run

maas local boot-resources import

after executing

maas local boot-resources create -d name=custom/foo architecture=amd64/generic filetype=tgz content@=/tmp/ubuntu1604-tgz  

Took me a while to figure that out.

Since MAAS documentation is rather poor when it comes to importing custom images, I think I'll write short guidelines how to do it.

First you should know that naming is important. So if you want to import custom image, you should give an appropriate name parameter:

maas local boot-resources create name=custom/foo title="Title is not important" architecture=amd64/generic content@=/path/to/your/image
maas local boot-resources import

Take a close look at name=custom/foo. MAAS is expecting that custom image name starts with custom. There is no difference what you write after the slash, so name=custom/foo is as good as name=custom/bar123.

If you want to import CentOS image, naming is also important according to src/provisioningserver/drivers/osystem/centos.py. To import a custom image for CentOS 7.2, you should execute:

maas local boot-resources create -d name=centos/centos72 architecture=amd64/generic content@=/path/to/your/image
maas local boot-resources import

Yes, exactly. Name parameter should be name=centos/centos72 for CentOS 7.2, name=centos/centos67 for CentOS 6.7 and so on. That's how distro match regexp is implemented.

Haven't tried importing custom SuSE and Windows images, but there should be naming restrictions too. Just take a look to MAAS sources in src/provisioningserver/drivers/osystem/.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.