Add a second PXE Boot Option
-
@george1421 you code works fine I added a new menu entry! But now i have still the problem with the different rooms/clients. I will try to check if i can change the GRUB_FIRST_HDD option.
-
@FritzBox360 Iām not sure I understand. If there is nothing for fog to do, it should chain load to your other pxe server. Its not clear where an exit mode would come into play here.
-
@george1421 okay, no problem i will explain
We have here two rooms ( A and B ) on the same subnet with the same DHCP settings.
Both rooms are managed via one FOG-Server and have a local WIN7 image.
Now, we would like to use room B for OpenSLX virtualization. Therefore we need another next-server entry via DHCP. But this is not cool because we have to decide between FOG and OpenSLX. As a fact, OpenSLX uses a PXE boot too. So i thought there could be a way to use both.
Sure, i could add a new image to FOG with boots to OpenSLX but therefore i need to re-image the room all the time if someone needs WIN7.
I am thinking of managing both rooms via FOG and be able to start OpenSLX individually on a client.
Thanks to @george1421 i could add an option to the BootMenu. But the problem is, we are not using this menue at the time and it is not individually for the clients.
For example: Room B has 64 Clients - if i would like to boot into OpenSLX i need to boot manually each client into the FOG BootMenu to start OpenSLX. If i select the ādefaultā option as @Wayne-Workman mentioned - all other clients - e.g. room A - would be affected.
So i was lokking for an option - sth. like a flag " Boot OpenSLX " - for each client and i found the āHost Bios Exit Typeā option with is nearly what i need. But i do not need grub, i need sth. like a PXE boot to another IP.
I am new to the whole PXE Grub boot topic. As @Sebastian-Roth mentioned there is a way to edit the /var/www/html/fog/lib/fog/bootmenu.class.php for āotherā grub commands.
So i am stuck at the point to connect grub to load from another server. I am not sure if booting into grub.exe is a step to far because i did not found a working way to connect grub to pxe. Something like @george1421 mentioned to chainload from another IP would be great. But i am not familar with that topic.
Would be nice if someone could help here. If there are any kind of questions feel free to ask!
Thanks a lot!
-
@FritzBox360 said in Add a second PXE Boot Option:
s a PXE boot too. So i thought there could be a way to use both.
Thank you for your detailed information. I do see a path forward from here with a few potential failures.
FOG uses a number of other technologies to allow their magic to work. One of those technologies is from the iPXE project. iPXE gives fog the dynamic pxe boot capabilities. The FOG management code can build the iPXE boot menus and actions dynamically based on what the client should be doing at a specific point in time. While FOG can create iPXE menus dynamically, iPXE canāt directly interact with FOG so there is no way for the iPXE kernel (undionly.kpxe or ipxe.efi) to know what FOG knows about the target computers. The iPXE kernel can only know about what it finds out about via dhcp or what its been told by FOG creating the iPXE menu in a certain way.
Now to the issue.
From your post you have 2 rooms of computers. Both rooms (sets) of computers will be managed by FOG. One should boot through to the local hard drive and the second room should booth through to OpenSLX via an iPXE chain command. These computers are on the same subnet. During the iPXE mode, iPXE doesnāt know how to interact with FOG.So the question is how can iPXE know which set a pxe booting computer belongs in? Remember we are dealing with computers so intrinsic knowledge is not possible. iPXE only has these commands avaialble: http://ipxe.org/cmd
The one answer I can think of is by the deviceās mac address. You would have to maintain a list of mac addresses that a pxe booting computer would be tested against to identify which group the target computer falls in. If a mac address match is found then the pxe booting computer then could be redirected to OpenSLX.
<I need to pause here for a while>
-
@FritzBox360 said in Add a second PXE Boot Option:
For example: Room B has 64 Clients - if i would like to boot into OpenSLX i need to boot manually each client into the FOG BootMenu to start OpenSLX. If i select the ādefaultā option as @Wayne-Workman mentioned - all other clients - e.g. room A - would be affected.
As I already said:
@Wayne-Workman said in Add a second PXE Boot Option:
This would apply to everything though.
I donāt think FOG is the tool you should be using for this, I think you would do better with syslinux.
-
any reason you donāt want to set it for āhide menuā and a 1 second timeout?
your custom default menu item (which will be chosen even if the user doesnāt see it) can have a collection of conditions to test against to only make the relevant hosts boot to the OpenSLX server -
@Junkhacker to clarify, your new ādefaultā menu item would contain something like this:
iseq ${serial} <labSerial1> && goto chainboot || iseq ${serial} <labSerial2> && goto chainboot || goto fog.local :chainboot set net0/next-server <otherPXEbootServerIP> && set filename <whateverFile> && chain tftp://<otherPXEbootServerIP>/<whateverFile> || exit
-
@Junkhacker This is exactly what I was thinking when I had to pause earlier.
At the top you will have a major test for hardware inclusuion in this group
iseq ${serial} <labSerial1> && goto chainboot || iseq ${serial} <labSerial2> && goto chainboot || ... iseq ${serial} <labSerial64> && goto chainboot ||
If there isnāt a match then the original (old default) menu is selected.
goto fog.local
If there is a match then the flow jumps down to the label
:chainboot
Sets the next server (dhcp option 66) and boot filename (dhcp option 67) to the new values required for OpenSLX and then chain boots (fwiw that should be on one line, its a bit deceiving because of the line wrap, that is all one line) into the new environment.
@Junkhacker Simply Brillant!!
-
@george1421 yuck, youāre right about the line wrap. it would look better and work just as well to make that:
set net0/next-server <otherPXEbootServerIP> set filename <whateverFile> chain tftp://<otherPXEbootServerIP>/<whateverFile> ||
-
Nice! Thank you @Junkhacker and @george1421
I just changed it to work with the clients MAC address and it seems to work like a charm!
So now, i have this config:
iseq ${net0/mac} XX:XX:XX:XX:XX:XX && goto chainboot || goto fog.local :chainboot set pxeserver:ipv4 XXX.XX.XXX.XXX set next-server ${pxeserver} chain tftp://${pxeserver}/pxelinux.0 exit
I will do some testing but i am verry optimistic
Thanks!