invalid magic number after custom image deployment failure
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Invalid
|
Undecided
|
Unassigned |
Bug Description
[Problem]
When a deployment using a custom image fails, subsequent boots from the server will show:
Fetching Netboot Image
Booting under MAAS direction...
error: invalid magic number.
error: you need to load the kernel first.
Press any key to continue...
Inspecting the GRUB menu, after the key press, there are URLs with a /no-such-image/ path:
� linux (http,192.
�no-such-
�/images/
�t:BOOTIF ip6=off overlayroot=tmpfs overlayroot_
�ource_list': ['MAAS']\}end_cc cloud-config-url=http://
�-internal:
� log_host=
� initrd (http,192.
�no-such-
Investigating the issue, the grub menu is brought using tftp and is dynamically
generated based on the mac address:
tftp get /grub/grub.cfg-<mac address>
Based on the mac address, maas tries to find a boot image that matches:
image["osystem"] == params["osystem"]
and image["release"] == params["release"]
and image["
and image["purpose"] == purpose
where purpose == commissioning. These are the variables taken for the Failed machine:
'arch': 'amd64'
'osystem': 'custom'
'release': 'my-ubuntu'
'purpose': 'commissioning'
But since it's a custom image, there is no commissioning image available, only a xinstall one:
Image: custom | my-ubuntu | amd64 | xinstall
And it falls back to the no-such-image situation.
[Workaround]
The machine is marked with "Failed deployment", and the Release Action in the Web UI
will bring the machine to a bootable state, where the expected commission boot process will happen.
[Reproducer]
- Create a custom image [https:/
- Deploy a server using the custom image - my reproducer uses a VM with UEFI boot
- Interrupt the installation (I shutdown the VM during the image extraction)
- Wait for the deployment to be marked as failed
- Restart the server and follow the boot process
[Alternatives]
- Can this issue be handled in a more informative way, instead of falling into this condition? The
message: "Booting under MAAS direction..." could be changed to provide some hints on the issue
- Instead of picking a no-such-image, a regular Ubuntu commissioning image could be used. This way
the server hostname appears in the boot process and it's easy to relate to an already enlisted machine.
Thank you Joao for putting this together.
I'm adding an extra note, in BIOS mode, the machine goes into a kernel panic after the reboot instead of the mentioned GRUB screen above and the "invalid magic number" errors are not observed.
Best,
Alan