Deploying any packed image fails with snap 3.2.x of maas

Bug #1987622 reported by Charles Bedford
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Invalid
Undecided
Unassigned

Bug Description

I've successfully built all the images supported, and all of them fail to install when selected as an image during deployment.

Here are relevant supporting details:
cbedford@cfru2infrmaas01:~$ sudo snap list maas
Name Version Rev Tracking Publisher Notes
maas 3.2.4-12012-g.91c5952db 23425 3.2/stable canonical✓ -

I used the CLI to load the images with the following commands:
maas admin boot-resources create name='custom/rhel8' title="RedHat Enterprise Linux 8" architecture='amd64/generic' filetype=tgz content@=rhel8.tar.gz

I used the git repository here: https://github.com/canonical/packer-maas.git - and it's still up to date.

The host I used to build the packer image was running Ubuntu 20.04:
uname: Linux cf-cosd4-g4-09 5.15.0-46-generic #49~20.04.1-Ubuntu SMP Thu Aug 4 19:15:44 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

I deploy an image using the GUI and select the uploaded rhel8 image for the deployment and it fails with with the attached image on the console, and the following in the following in the installation logs:
'''
Finalizing /tmp/tmpplouiu3_/target
finish: cmd-install/stage-hook/builtin/cmd-hook: SUCCESS: curtin command hook
start: cmd-install/stage-late/98-validate-custom-image-has-cloud-init/cmd-in-target: curtin command in-target
Running command ['mount', '--bind', '/dev', '/tmp/tmpplouiu3_/target/dev'] with allowed return codes [0] (capture=False)
Running command ['mount', '--bind', '/proc', '/tmp/tmpplouiu3_/target/proc'] with allowed return codes [0] (capture=False)
Running command ['mount', '--bind', '/run', '/tmp/tmpplouiu3_/target/run'] with allowed return codes [0] (capture=False)
Running command ['mount', '--bind', '/sys', '/tmp/tmpplouiu3_/target/sys'] with allowed return codes [0] (capture=False)
Running command ['unshare', '--help'] with allowed return codes [0] (capture=True)
Running command ['unshare', '--fork', '--pid', '--', 'chroot', '/tmp/tmpplouiu3_/target', 'bash', '-c', 'dpkg-query -s cloud-init || (echo "cloud-init not detected, MAAS will not be able to configure this machine properly" && exit 1)'] with allowed return codes [0] (capture=False)
bash: dpkg-query: command not found
cloud-init not detected, MAAS will not be able to configure this machine properly
Running command ['udevadm', 'settle'] with allowed return codes [0] (capture=False)
TIMED subp(['udevadm', 'settle']): 0.009
Running command ['mount', '--make-private', '/tmp/tmpplouiu3_/target/sys'] with allowed return codes [0] (capture=False)
Running command ['umount', '/tmp/tmpplouiu3_/target/sys'] with allowed return codes [0] (capture=False)
Running command ['mount', '--make-private', '/tmp/tmpplouiu3_/target/run'] with allowed return codes [0] (capture=False)
Running command ['umount', '/tmp/tmpplouiu3_/target/run'] with allowed return codes [0] (capture=False)
Running command ['mount', '--make-private', '/tmp/tmpplouiu3_/target/proc'] with allowed return codes [0] (capture=False)
Running command ['umount', '/tmp/tmpplouiu3_/target/proc'] with allowed return codes [0] (capture=False)
Running command ['mount', '--make-private', '/tmp/tmpplouiu3_/target/dev'] with allowed return codes [0] (capture=False)
Running command ['umount', '/tmp/tmpplouiu3_/target/dev'] with allowed return codes [0] (capture=False)
finish: cmd-install/stage-late/98-validate-custom-image-has-cloud-init/cmd-in-target: FAIL: curtin command in-target
curtin: Installation failed with exception: Unexpected error while running command.
Command: ['curtin', 'in-target', '--', 'bash', '-c', 'dpkg-query -s cloud-init || (echo "cloud-init not detected, MAAS will not be able to configure this machine properly" && exit 1)']
Exit code: 1
Reason: -
Stdout: start: cmd-install/stage-late/98-validate-custom-image-has-cloud-init/cmd-in-target: curtin command in-target
        Running command ['mount', '--bind', '/dev', '/tmp/tmpplouiu3_/target/dev'] with allowed return codes [0] (capture=False)
        Running command ['mount', '--bind', '/proc', '/tmp/tmpplouiu3_/target/proc'] with allowed return codes [0] (capture=False)
        Running command ['mount', '--bind', '/run', '/tmp/tmpplouiu3_/target/run'] with allowed return codes [0] (capture=False)
        Running command ['mount', '--bind', '/sys', '/tmp/tmpplouiu3_/target/sys'] with allowed return codes [0] (capture=False)
        Running command ['unshare', '--help'] with allowed return codes [0] (capture=True)
        Running command ['unshare', '--fork', '--pid', '--', 'chroot', '/tmp/tmpplouiu3_/target', 'bash', '-c', 'dpkg-query -s cloud-init || (echo "cloud-init not detected, MAAS will not be able to configure this machine properly" && exit 1)'] with allowed return codes [0] (capture=False)
        bash: dpkg-query: command not found
        cloud-init not detected, MAAS will not be able to configure this machine properly
        Running command ['udevadm', 'settle'] with allowed return codes [0] (capture=False)
        TIMED subp(['udevadm', 'settle']): 0.009
        Running command ['mount', '--make-private', '/tmp/tmpplouiu3_/target/sys'] with allowed return codes [0] (capture=False)
        Running command ['umount', '/tmp/tmpplouiu3_/target/sys'] with allowed return codes [0] (capture=False)
        Running command ['mount', '--make-private', '/tmp/tmpplouiu3_/target/run'] with allowed return codes [0] (capture=False)
        Running command ['umount', '/tmp/tmpplouiu3_/target/run'] with allowed return codes [0] (capture=False)
        Running command ['mount', '--make-private', '/tmp/tmpplouiu3_/target/proc'] with allowed return codes [0] (capture=False)
        Running command ['umount', '/tmp/tmpplouiu3_/target/proc'] with allowed return codes [0] (capture=False)
        Running command ['mount', '--make-private', '/tmp/tmpplouiu3_/target/dev'] with allowed return codes [0] (capture=False)
        Running command ['umount', '/tmp/tmpplouiu3_/target/dev'] with allowed return codes [0] (capture=False)
        finish: cmd-install/stage-late/98-validate-custom-image-has-cloud-init/cmd-in-target: FAIL: curtin command in-target
'''

Revision history for this message
Charles Bedford (bedfordc) wrote :
Revision history for this message
Alberto Donato (ack) wrote :

Could you please provide the command used to upload the custom image to maas, and the output of

maas $profile boot-source-selections read $boot_source_id

for that image?

Changed in maas:
status: New → Incomplete
Revision history for this message
Alberto Donato (ack) wrote :

Sorry, I just say you did include the first command:

maas admin boot-resources create name='custom/rhel8' title="RedHat Enterprise Linux 8" architecture='amd64/generic' filetype=tgz content@=rhel8.tar.gz

It seems you're missing the base_image="rhel/rhel8" parameter to that command, which tells maas which image the custom one is based on.

Can you please try uploading the image with this parameter and deploying again?

Changed in maas:
status: Incomplete → New
status: New → Incomplete
Revision history for this message
Charles Bedford (bedfordc) wrote :

That appears to have fixed the issue Alberto, thank you very much.

Perhaps that should be included in the documentation.

Changed in maas:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.