# # This file was deployed via ‘<%= template_name %>’ template # # Supported host/hostgroup parameters: # # blacklist = module1, module2 # Blacklisted kernel modules # # lang = en_US # System locale # # # WARNING # # Foreman will not download the kernel/initramdisk to PXE automatically. Please follow # the official Ubuntu documentation and extract the files from the LiveCD (DVD) manually # and optionally update the KERNEL and INITRD lines in this template. # DEFAULT linux cloud-init autoinstall LABEL linux cloud-init autoinstall
** KERNEL boot/filename-vmlinuz**
** INITRD boot/filename-initrd**
** APPEND ip=dhcp url=http://xxxxxxxx/pub/installation_media/ubuntu/20.04.6/ autoinstall ds=nocloud-net;s=http://foreman-server-domain/userdata/ root=/dev/ram0 ramdisk_size=1500000 fsck.mode=skip**
I’ve just compared your template to the latest version of it (that I just used for my own Ubuntu host deployment).
I recognized that in your version, there is no parameter cloud-config-url=/dev/null. There is currently a bug in the Ubuntu installer which let’s it download the iso image twice - passing this parameter prevents the installer from doing so. Look here for further information on this: server - pxe autoinstall fails with ubuntu 20.04.04 - Ask Ubuntu
You can create a custom template and add the paramter.
Besides that, your template looks fine.
Can you verify that your boot files are downloaded correctly?
There should be some files similar to these in your boot files directory /var/lib/tftpboot/boot/ on your Foreman:
-rw-r--r--. 1 foreman-proxy foreman-proxy 85M Mar 14 2023 ubuntu20lts-mirror-AETB3fdcwlLC-initrd
-rw-r--r--. 1 foreman-proxy foreman-proxy 14M Mar 14 2023 ubuntu20lts-mirror-AETB3fdcwlLC-vmlinuz
The naming could be different, but the file size is important. It should be similar to these.
These files are getting generated however I don’t think they are getting downloaded as the file sizes are very small in kb. I have to manually download initrd & vmlinuz files from the ISO and place here.
Tried with this modification also, still getting the same error:
“/init: line 49: can’t open /dev/sr0: No medium found
unable to find a medium container a live file system
Attempt interactive netboot from a URL?”
Then, it seems like this is the issue. Your machine probably can’t find the boot files.
When copying the files manually, did you check the file names? They must be exactly the same as the ones in your template:
Don’t think the image is getting downloaded because I get the error in 20 seconds when the device is booted from network.
I can see log “Started Get “/userdata/” for foreman-ip” however it ends with error “ActionController::RoutingError”
yes, it gives me the option to choose n/w static or dhcp, then few network setting & URL to download image which is starting with “archive.ubuntu.com”. As per my understanding this means the endpoint is not able to pick the image from my hosted ISO.
So I don’t need to extract the ISO image on my apache server?
At present my ISO is extracted and I have removed the ‘.iso’ from the template as I was not getting the extracted ISO structure in the browser while checking.
Tried with the above suggestion. The good news is Ubuntu ISO is now getting downloaded & starting the installation however now while installing it gets into GUI Desktop mode.
The last log I see on the screen before going into GUI is " Started session 1 of user ubuntu", at this stage non of the files like /etc/hosts or /etc/resolv.conf is update when I am checking on the terminal.
Sharing the below info if it helps:
The initrd & vmlinuz are still not getting downloaded, I have to manually download them.
The ISO file I am using is of Ubuntu Desktop.