When customizing an Ubuntu 16.04 image for use with MAAS 2.0 there are no instructions available.
It looks like other people have had success but there are no steps available to repeat their success.
Steps I have tried are:
Get a copy of a known working image:
or from here: /var/lib/maas/boot-resources/cache
Mount the image to customize
gunzip root-image.gz mkdir /tmp/image mount root-image /tmp/image
Customize the image as you desire, umount and gzip it
umount /tmp/image gzip root-image
Import this into MAAS
maas admin boot-resources create name="custom/my-custom-image" architecture="amd64/generic" subarches="generic" content@=/root/root-image.gz maas admin boot-resources import
Next you deploy a node with this image but in my case this fails with the following output.
Cloud-init v. 0.7.8 running 'modules:config' at Mon, 26 Sep 2016 18:17:20 +0000. Up 14.84 seconds. --2016-09-26 18:17:32-- http://10.40.0.250:5248/images/custom/amd64/generic/my-custom-image/uploaded/root-tgz Connecting to 10.40.0.250:5248... connected. HTTP request sent, awaiting response... 200 OK Length: 211170553 (201M) [text/html] Saving to: 'STDOUT' 0K ..... 0% 19.0M=0.02s Cannot write to '-' (Success). Unexpected error while running command. Command: ['chroot', '/tmp/tmpoa1mrw83/target', 'dpkg-query', '--list'] Exit code: 127 Reason: - Stdout: '' Stderr: "chroot: failed to run command 'dpkg-query': No such file or directory\n" Installation failed with exception: Unexpected error while running command. Command: ['curtin', 'curthooks'] Exit code: 3 Reason: - Stdout: b'Unexpected error while running command.\nCommand: [\'chroot\', \'/tmp/tmpoa1mrw83/target\', \'dpkg-query\', \'--list\']\nExit code: 127\nReason: -\nStdout: \'\'\nStderr: "chroot: failed to run command \'dpkg-query\': No such file or directory\\n"\n' Stderr: '' Unexpected error while running command.
This is related to: MAAS 2.0 importing custom images does not work