Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pxe menu variables #572

Open
johnwc opened this issue Aug 14, 2023 · 4 comments
Open

pxe menu variables #572

johnwc opened this issue Aug 14, 2023 · 4 comments

Comments

@johnwc
Copy link

johnwc commented Aug 14, 2023

Other than fog-ip, what all other variables are able to be used? We specifically are looking to use hostname of the registered host.

@George1422
Copy link

I have a tutorial here in the FOG forums that talk about post install scripts. This post should show you the available variables: https://forums.fogproject.org/topic/7740/the-magical-mystical-fog-post-download-script/17?_=1692046939324

@johnwc
Copy link
Author

johnwc commented Aug 14, 2023

We're looking for preinstall variables that can be used during PXE booting. So I can tell the bootloader kernel arguments what config file to pull for this specific host that is booting.

Example: The is a PXE menu item parameters, we need to dynamically fill in the ${hostname} part. Similarly how it does the same for ${fog-ip}

kernel tftp://${fog-ip}/os/harvester/harvester-v1.1.2-vmlinuz-amd64 tftp://${fog-ip}/os/harvester/harvester-v1.1.2-initrd-amd64 ip=dhcp net.ifnames=1 rd.cos.disable rd.noverifyssl console=tty1 root=live:http://${fog-ip}/os/harvester/harvester-v1.1.2-rootfs-amd64.squashfs harvester.install.automatic=true harvester.install.config_url=http://${fog-ip}/os/harvester/config-${hostname}-join.yaml
initrd tftp://${fog-ip}/os/harvester/harvester-v1.1.2-initrd-amd64
boot

@George1422
Copy link

I don't know specifically if the hostname variable is set. The iPXE environment is a bit limited in regards to variables from FOG. The boot.php program does the variable replacement before the iPXE menu is created. It may be possible to add the required variables, but I don't know myself how its done.

If you want to see what variables are in the FOG iPXE menu you can with a browser make a call to http://<fog_server_ip>/fog/service/ipxe/boot.php?mac=00:00:00:00:00:00

That will show you the ipxe menu text. You should see how the variables are built.

Now I don't know your workflow, but you could do some call logic changes in the fog post init script. This script is run before any imaging starts. You will have access to the FOG variables in there too.

@johnwc
Copy link
Author

johnwc commented Aug 17, 2023

This is what we are following to get things booted. If there is a way to make this so that each registered host has its own config file set in kernel parameters, that is what we are looking for. From the docs it is all being loaded from preconfigured image files, do/should we be uploading those to fog instead, and using them that way. Any and all suggestions/help is needed and appreciated.

https://docs.harvesterhci.io/v1.1/install/pxe-boot-install/

Our expectations with using FOG was the following scenario

  1. Boot new server into PXE, registering it with FOG via PXE menu.
  2. Configure host in FOG with correct name along with kernel parameter with correct config file name.
  3. Boot server into PXE, using menu item to install harvester based on link.
  4. Server now boots from disk unless manually told to boot to PXE to reinstall harvester.

Can this scenario be done?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants