i am confirming that the install docs could be cleaned up here - there is no need to extract the complete iso contents to your foreman instance or smart proxy - just these 2 files + having the ISO on same storage, for example this is my internal repo/mirror server:
[11:30:31] (ssh) (SUDO) root@mirror:ubuntu # ls -lah *
-rw-r--r-- 1 root root 1.4G Oct 3 08:18 20.04-x86_64.iso
-rw-r--r-- 1 root root 1.4G Oct 3 08:20 22.04-x86_64.iso
20.04-x86_64:
total 12K
drwxr-xr-x 3 root root 4.0K Oct 3 06:59 .
drwxr-xr-x 4 root root 4.0K Oct 3 08:20 ..
drwxr-xr-x 2 root root 4.0K Oct 3 08:15 casper
22.04-x86_64:
total 12K
drwxr-xr-x 3 root root 4.0K Oct 3 08:28 .
drwxr-xr-x 4 root root 4.0K Oct 3 08:20 ..
drwxr-xr-x 2 root root 4.0K Oct 3 08:29 casper
This saves nearly 3GB of space and if only Ubuntu would make them available at consistent locations of the mirror file systemâŚ
I also used the variables within the Install Media definition to allow me to use the same install media for 22.04 and 20.04
I just tried this method.
Instead of linking the user-data file as a provisioning-template for which I copied the content of the file in the pub-directory, I linked it to a userdata-template
So now there is no provisioning template configured for host, but instead the userdata template.
menuentry âInstall Ubuntu Server jammyâ {
set gfxpayload=keep
linux ubuntu/jammy/vmlinuz nomodeset ip=dhcp url=http://< ip forman server >:80/pub/installation_media/ISO/ubuntu-22.04-live-server-amd64.iso autoinstall ds=nocloud-net;s=http://< ip forman server >:80/userdata/ root=/dev/ram0 ramdisk_size=1500000 fsck.mode=skip
initrd ubuntu/jammy/initrd
Your template configuration sounds alright - when assigning the user-data template you end up with 3 templates for your host: Finish, Boot (PXE/Grub), and the user data template. The finish template might be optional for your setup.
When calling the userdata API endpoint, it takes the request IP to determine the template it has to return. This means, calling the API from a ârandomâ machine is just going to result in a âNot Foundâ because no template can be associated.
Still, you can check whether the template is rendered correctly in your Foreman UI at the hosts page:
If you want to check whether the template is requested correctly during provisioning, just have a look at your log file in /var/log/foreman/production.log. It should print Started GET "/userdata/user-data" for <host ip> shortly after the deployment started. If this message is not printed, your host does not reach this stage and might have an error running the boot files.
From what you are saying, it sounds like your host fails at this first boot stage. And, I think the problem might be in your template. We found out, during the Grub2 setup, that it needs quotes around the â;â. Moreover, I would suggest adding the cloud-config-url=/dev/null part as I just mentioned here. So, your template would look like the following:
menuentry âInstall Ubuntu Server jammyâ {
set gfxpayload=keep
linux ubuntu/jammy/vmlinuz nomodeset ip=dhcp url=http://< ip forman server >:80/pub/installation_media/ISO/ubuntu-22.04-live-server-amd64.iso autoinstall "ds=nocloud-net;s=http://< ip forman server >:80/userdata/" root=/dev/ram0 ramdisk_size=1500000 fsck.mode=skip cloud-config-url=/dev/null
initrd ubuntu/jammy/initrd
Let me know if this helps or if you find any other hint in your error logs!
one cannot use the same Operating System Entry to provision an Image Based or Boot Disk Based (and possibly also network based) installation
the auto install template has partition based config which causes the template to fail to render due to no partition data present which is quite correct considering you cannot specify the partition layout with an image based install anyway. Iâve worked around this by leaving my default Ubuntu 20.04 OS entry for bootdisk, then created a cloned entry with an appropriate name to include image and selected the plain userdata template - this works but i do need to maintain 2 entries - not sure how this could be improved
Im still having issues getting Ubuntu 20.04 or 22.04 to PXE install. So Im wondering if Im missing something.
Foreman (non ketello): 3.4.0
OS Hosting Foreman: AlmaLinux 8.6
Single server setup
Hereâs what I did based on the docs written so far by various people.
## SSH to Foreman Server
ssh user@foremanserver
## Elevate to root
sudo su -
## make temp folder
mkdir prep_ubuntu_autoinstall
## Change Dir to prep folder
cd prep_ubuntu_autoinstall
## Download Ubuntu ISO - In my case Desktop Version
wget https://releases.ubuntu.com/20.04.5/ubuntu-20.04.5-desktop-amd64.iso
## Mount ISO image
mount ubuntu-20.04.5-desktop-amd64.iso /mnt
## Make folder for extracted contents of ISO file
mkdir -p /var/www/html/pub/installation_media/ubuntu/20.04-x86_64/
## Copy entire ISO file to the 'ubuntu' folder
cp ubuntu-20.04.5-desktop-amd64.iso /var/www/html/pub/installation_media/ubuntu/20.04-x86_64.iso
## Extract ISO file contents to '20.04-x86_64' folder
cp -a /mnt/* /var/www/html/pub/installation_media/ubuntu/20.04-x86_64/
## Unmount ISO File
umount /mnt/
Once I had the ISO contents in place. I created the installation media in Foreman as follows:
The templates above are the templates that came with Foreman 3.4.0. However, Im not sure If Im missing any templates, or need to make modifications to the above templates.
In anycase I go to PXE boot the machine and get the following error that Im not sure how to fixed. And when I check the production.log or the proxy.log there is no input. Even with logging set to debug level.
I would like to add that I just tried doing the same steps above but with 20.04.5 live server. and get the same error in the PXE booting screen shot. I also checked /var/log/httpd/foreman_access.log and see the following:
I managed to make some progress. For what ever reason during PXE the VM can not download the ISO from the foreman server. So I tried moving the ISO to a external webserver. Verified I can download the ISo file from the external server. Than updated the installation media path to piont to the external webserver where the ISO is located. Than proceeded to boot the VM. Sure enough the VM booted this time and was able to download the ISO. HOwever. it never auto provisions. I do not think its sees the userdata file.
So I guess Im wondering is there anything we need to change in the apache configuration, or settings I need to change on foreman to allow the download the ISO directly from foreman?
@langesmalle Thank you for the response. I ended up figuring it out. Basically the http path for downloading the ISO is different in mine than what the published instructions say. I had to look at the httpd.conf to figure out where to place the ISO. Once I placed the ISO where the httpd.conf said. It all started working. I also had to fix several default templates to get things to work.
My next big issue to figure out and hope someone can lead me down the correct path is how to get Foreman to Provision baremetal with SecureBoot enabled.
Secureboot enabled with Redhat 8.6 == works
Secureboot enabled with Ubuntu 22.04 == invalid signature
I think I have to replace some files in /var/lib/tftpboot/grub2/ but Im not 100% sure. Anyways has anyone gotten secureboot to work with ubuntu 20.04/22.04 and point me in the right direction?
Sorry for the late response.
Idk whether this is helpful anymore since you got your setup working. Still, I had a look at your initial configuration and I assume Foreman did not configure your tftpboot directory properly:
In your operating system config (figure os_os_tab), you set â20â as major and â04â as minor version. But, â20.04â must be the major and â5â the minor version since you are using 20.04.5. Depending on this version, Foreman decides on how to extract the boot files from your Installation Media.
Since this is not configured properly, the boot files are not set up as itâs intended. You can verify this by checking your /var/lib/tftpboot/boot folder. It should contain the boot files for Ubuntu 20.04 and the size must be ~100MB for the initrd and ~11MB for vmlinuz. If this is not the case, change your operating system config as Iâve described earlier, delete the existing ubuntu boot files in /var/lib/tftpboot/boot and trigger a host deployment again. Now, Foreman is going to re-trigger the boot file download and they should be identified correctly.
If your httpd confg is different, you should have to adapt this path in the PXELinux Autoinstall template only and it shoudnât be necessary to adapt any other default templates.
Regarding grub2 configuration: We are currently in the process of adding a GRUB2 template. Moreover, we adapt the existing PXELinux template and introduce a snippet which takes all Autoinstall configurations. This should make the deployment process more intuitive. You can have a look here.
@langesmalle the manual setup of the boot files is not necessary anymore. Since Foreman 3.3, it can identify the boot files automatically when the Operating System is configured properly (be aware of the major/minor issue mentioned earlier).
Hi,
Does anybody know why it is not asking for OTP (one time password) from IPA using this cloud-init method.
I have finish template and â$HOST[OTP]â is not populated there as one time password is not asked from IDM/Freeipa server for some reason. Tried build/cancel build, even new host creation etcâŚ
i still face this issue when trying to download the full image of an ubuntu server. i donât see the below path in âPreseed default PXELinux Autoinstallâ , not sure where it comes from!
As mentioned here, Foreman uses a different boot files path on the Installation Media depending on the Operating System version (major/minor). It seems like you want to install Ubuntu 22.04, but Foreman uses the boot files path from 20.04.1/2 (preseed/debian installer).
Please, check that your operating system is configured properly (22.04 as major, none or a specific version as minor).
@bastian-src That definitely helped! thanks for that.
Now struggling to make automated installation working after successful boot and downloading the iso before the installation. here is my templates. instead of starting installation, it started interactive OS installation. my foreman setup is rocky 8.8 and foreman 3.7:
Your PXELinux template looks fine to me - the .iso and userdata paths should be correct.
The change youâve made to your preseed_kernel_options_autoinstall snippet is only important if you want to deploy your host through a Smart Proxy - the Smart Proxy does currently not support the mac-based userdata interface. (Even if you donât provision through a Smart Proxy, you can leave it like that for now - just pay attention to use the default snippet again as soon as the Smart Proxy supports the mac-based approach such that you donât miss any updates on the snippet)
Ubuntu usually switches to the interactive installation if it encounters an error with the cloud-init/userdata setup. Please, have a look at the Preseed Autoinstall cloud-init user data template and verify that it is a valid YAML.
Thereby, it could be an issue that you didnât choose the Preseed default autoinstall partition table during the host deployment process (or in your host group).
If that hasnât been the issue, please post that template here (after masquerading any sensitive information).
I am new to Foreman, I was able to provision CentOS however still facing in installing Ubuntu 20.04. I am using the updated templates âPreseed Autoinstall cloud-init user dataâ but when I try to open the provisioning link(http://foreman.example.com/userdata/ on the foreman master) updated in tftp, the webpage doesnât exists. Also the files updated under /var/lib/tftpboot/boot are not as per the ISO & in Kb size.
Kindly suggest what could be the issue & If possible pls share any link having complete steps to be followed for provisioning Ubuntu 20.04 and above machines?
Did you follow the documentation for creating an OS and the Installation Media as mentioned here?
The URL is not supposed to be opened from your browser. The host calls the API and depending on the hostâs IP, Foreman returns the corresponding Userdata template.
But, the latest Foreman supports calling http://foreman.example.com/userdata/<host MAC>/user-data. You can call that API also from other machines like your browser to validate the template.
It seems like your boot files are not extracted correctly from the Installation Media:
Currently, the default provisioning method if you just define your OS as Ubuntu with Major <20.04> and Minor empty or 1 or 2, Foreman supposes you want to use Preseed debian-installer. Accordingly, it tries a distinct path to set up the Installation Media.
You have to define explicitly Minor <3> or higher, so Foreman will assume that you want to use Autoinstall. Then, it will also use the corresponding path for extracting the boot files from the Installation Media.
Yes I have tried with mentioning the major & minor version, it is still the same and following the documentation.
http://foreman.example.com/userdata/<host MAC>/user-data this webpage also doesnât exist.
Since the files were not get downloaded in /var/lib/tftpboot/boot, I have manually downloaded the initrd & vmlinuz from the ISO. The endpoint started the booting from PXE however it got stuck post âRunning /scripts/caser-premountâ with error âcanât open /dev/sr0: No medium foundâ.
Sharing the below information if it helps:
Foreman Version: 3.3
Templates used:
Partition table: Preseed default autoinstall
Finish template: Preseed default finish
Host initial configuration template: Linux host_init_config default
PXELinux template: Preseed default PXELinux Autoinstall
User data template: Preseed Autoinstall cloud-init user data
Ubuntu ISO is hosted on a separate machine and no http logs are getting generated on that machine when starting the installation from Foreman.