Ah okay, this API endpoint has been introduced in Foreman 3.4 - so that makes sense now.
So, the installation process is started but it stops at this point? I haven’t seen it stopping at this point before.
How much RAM did you give the machine? (Ubuntu Autoinstall needs at least ~3GB).
That shouldn’t be an issue - but you should still see some event in your var/log/foreman/production log when the host downloads the userdata template from Foreman.
2023-10-24T11:39:17 [I|app|8dce6478] Started GET "/userdata/user-data?url=<foreman URL> for <host IP> at 2023-10-24 11:39:17 +0200
2023-10-24T11:39:17 [I|app|8dce6478] Processing by UserdataController#userdata as TEXT
2023-10-24T11:39:17 [I|app|8dce6478] Parameters: {"url"=>"<foreman URL>", "userdatum"=>{}}
2023-10-24T11:39:18 [I|app|8dce6478] Rendered text template (Duration: 0.0ms | Allocations: 1)
2023-10-24T11:39:18 [I|app|8dce6478] Completed 200 OK in 506ms (Views: 1.0ms | ActiveRecord: 65.8ms | Allocations: 76581)
There might be also some calls to userdata/vendor-data but those can be ignored.
The associated templates are fine. So, for further debugging, please post the rendered version of the Preseed default PXELinux Autoinstall and Preseed Autoinstall cloud-init user data templates
I have never been able to install with this little RAM. We’ve told our techs they need at least 5GB. I’d be curious if you try with 6GB (or even 8GB) if your install works.
# # 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:
Sharing the below info if it helps:
When I was trying without downloading the initrd & vmlinuz files manually, it was showing error " invalid or corrupt kernel image & was stuck at boot:".
Post downloading these files manually it is atleast starting the PXE however I am getting this error now “/init: line 49: can’t open /dev/sr0: No medium found”.
I would recommend downloading the whole image and extracting it again - just to check whether there is an issue with the boot files or the image itself.
Coming back to your original post:
I’m not entirely sure when that “Running scripts/caser-premount” step is run. But, I assume that your host downloads the ~2GB Iso image and starts installing, yes?
Then, it should download the Userdata template and you should find log entries as mentioned here:
When the error comes up, is an interactive shell opened?
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.
Since you want to deploy an Ubuntu 20.04 host with Autoinstall (so, an Ubuntu 20.04.3+ host), you just follow the 22.04 setup as described in the docs (for Ubuntu 20.04.0/1/2, it’s been different):
Thereby, Foreman needs the extracted iso image in order to download the boot files and the Ubuntu host needs the unextracted iso image for its installation.
We’re working on automating this process such that you only need to provide the iso image in the future and Foreman extracts the boot files on its own.
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.