Consolidating FOG and AikenWorkbench to one subnet. One PXE for both.
-
Hi, thank you for taking the time to read this.
We have FOG on subnet 192.168.3.0/24, and we use it for imaging laptops that go for sale. On the subnet 192.168.2.0/24, we have AikenWorkbench that we use to test those laptops before imaging. Aiken has its own DHCP server and uses pxelinux.0 and grub if I understand correctly.
We would love to have both servers on a single subnet. So we won’t need to double the ethernet cables and unplug them every time a task is done.
What would be the approach to achieve that?
- Having them both running on Type 1 Hypevisor or Containers? If this is even possible.
- Having two servers on the same subnet pointing to each other?
- Having them on separate subnets pointing to each other?
AikenWorkbench has a lot of proprietary code they don’t share, and their customer support says this is not possible to have another PXE server working along with theirs.
I was trying to install FOG along with Aiken, but I ran into some problems with SQL and FOG installation failed. Aiken uses SQL, and I don’t have the password for it. Also, we have only one licence, so no staging is possible.I have also tried Aiken grub.cfg to point to FOG, which failed. Then I tried Chainloading PXE to iPXE using pxelinux.0 and that completely broke Aiken. Had to restore from backup (which is in Acronis, not FOG, as they conflict)
I know nothing about PXE, iPXE and pxelinux.0. I know very little about DHCP and more about grub. I’m willing to learn, though. So if you could point me in the right direction and docs, I would really appreciate that.
Here is a part of the dhcpd.conf:
class "pxeclients" { match if substring (option vendor-class-identifier, 0, 9) = "PXEClient"; next-server 192.168.2.1; if (option arch = 00:00) { filename "bios/pxelinux.0"; }elsif (option arch = 00:06) { filename "grub/bootx32.efi"; }elsif (option arch = 00:07) { filename "grub/bootx64.efi"; }
Regards
Damian -
@jatosaj I think I would approach this by having FOG as your PXE boot source. This will use iPXE as your boot loader. iPXE is a very powerful boot loader as compare to syslinux (pelinux). Both are capable of doing what you want, just you’ll have an easier time managing this setup from FOG.
The idea is to pxe boot into the FOG menu, then have FOG chain (load) the aikenwb environment.
Understand I’m just spitballing this configuration. But within the fog UI under FOG Configuration there is an iPXE menu manager. You will create a new iPXE menu using these settings.
Menu Item: os.chainaikenwb
Description: Boot AikenWorkbench
Parameters:
iseq ${platform} pcbios && set bootfname “bios/pxelinux.0” ||
iseq ${platform} efi && set bootfname “grub/bootx64.efi” ||
chain -ar tftp://192.168.2.1/${bootfname}
boot || goto MENU
Menu Show with: All HostsIf AikenWorkbench requires the dhcp settings to contain the exact values we will need to get a bit more creative with the FOG menu.
(this one I have about 60% confidence I created the menu correctly)Menu Item: os.chainaikenwb
Description: Boot AikenWorkbench
Parameters:
set next-server 192.168.2.1iseq ${platform} efi && goto is_awb_efi || goto is_awb_bios
:is_awb_efi
set bootfile “grub/bootx64.efi”
goto awb_boot:is_awb_bios
set bootfile “bios/pxelinux.0”:awb_boot
set filename ${bootfile}
set net0.dhcp/filename ${bootfile}
set proxydhcp/filename ${bootfile}
chain -ar tftp://${next-server }/${bootfile}
boot || goto MENU
Menu Show with: All HostsEven if I missed on the menu, using FOG and iPXE is the easiest answer to get what you need. You CAN do it with FOG. For full disclosure you can also create a menu in syslinux to chain load into iPXE too. So if you have a way to create customer menues in AikenWB you can pxe boot into AikenWB and then chain to fog, but you’ll lose out in some of the boot features of FOG.
-
Thank you for your detailed reply, @george1421
I have decided to run both servers on the same network. With DHCP switched off on AikenWorkbench, I’m able to boot intoFOG menu.
Your entries aren’t quite right, or I’m doing something wrong. If I use it as is, I’m getting something like "Could not boot: Not found (https://ipxe.org2d12618e)
I have decided to exclude some of the commands and narrowed it down to:
chain -ar tftp://192.168.2.1/grub/bootx64.efi boot || goto MENU
And I’m trying to run it on EFI EFI-capable machine, but I’m only getting to the grub console and no further.
I understand my best bet is to learn how iPXE works and study its documentation.
There is more config from Aken if this helps:
cat /etc/default/tftpd-hpa TFTP_USERNAME="tftp" TFTP_DIRECTORY="/awbcboot" TFTP_ADDRESS="192.168.2.1:69" TFTP_OPTIONS="--secure"
ls /awbcboot bios biso boot grub ls /awbcboot/grub biso boot bootx32.efi bootx64.efi grub.cfg grub.cfg.bak snap unicode.pf2
And grub.cfg
cat grub.cfg set default="0" set timeout=0 menuentry 'Aiken Workbench V2 UEFI ...' --class gnu-linux --class gnu --class os { linux (pxe)/boot/vmlinuz-awc root=/dev/nfs nfsroot=${pxe_default_server}:/awbclient ip=dhcp rw libata.allow_tpm=1 -- initrd (pxe)/boot/initrd.img-awc
And here is the whole dhcp.conf but we don’t use Apple class as they dropped PXE support.
ddns-update-style none; authoritative; allow booting; allow bootp; option domain-name-servers 208.67.222.222; option arch code 93 = unsigned integer 16; class "AppleNBI-i386" { match if substring (option vendor-class-identifier, 0, 14) = "AAPLBSDPC/i386"; option dhcp-parameter-request-list 1,3,17,43,60; if (option dhcp-message-type = 1) { option vendor-class-identifier "AAPLBSDPC/i386"; option vendor-encapsulated-options 08:04:81:00:00:67; } if (option dhcp-message-type = 8) { option vendor-class-identifier "AAPLBSDPC"; if (substring (option vendor-encapsulated-options, 0, 6) = 01:01:01:02:02:01) { option dhcp-parameter-request-list 60, 43; option vendor-encapsulated-options 01:01:01:03:04:C0:A8:02:01:04:02:80:00:07:04:81:00:00:89:09:2A:81:00:00:89:09:44:6f:45:2d:49:6d:61:67:65; } } if (substring (option vendor-class-identifier, 15, 7) = "iMac4,1") { filename "grub/bootx32.efi"; }elsif (substring (option vendor-class-identifier, 15, 7) = "iMac4,2") { filename "grub/bootx32.efi"; }elsif (substring (option vendor-class-identifier, 15, 7) = "iMac5,1") { filename "grub/bootx32.efi"; }elsif (substring (option vendor-class-identifier, 15, 7) = "iMac5,2") { filename "grub/bootx32.efi"; }elsif (substring (option vendor-class-identifier, 15, 7) = "iMac6,1") { filename "grub/bootx32.efi"; }elsif (substring (option vendor-class-identifier, 15, 10) = "MacBook1,1") { filename "grub/bootx32.efi"; }elsif (substring (option vendor-class-identifier, 15, 10) = "MacBook2,1") { filename "grub/bootx32.efi"; }elsif (substring (option vendor-class-identifier, 15, 13) = "MacBookPro1,1") { filename "grub/bootx32.efi"; }elsif (substring (option vendor-class-identifier, 15, 13) = "MacBookPro1,2") { filename "grub/bootx32.efi"; }elsif (substring (option vendor-class-identifier, 15, 13) = "MacBookPro2,1") { filename "grub/bootx32.efi"; }elsif (substring (option vendor-class-identifier, 15, 13) = "MacBookPro2,2") { filename "grub/bootx32.efi"; }elsif (substring (option vendor-class-identifier, 15, 13) = "MacBookAir1,1") { filename "grub/bootx32.efi"; }elsif (substring (option vendor-class-identifier, 15, 10) = "Macmini1,1") { filename "grub/bootx32.efi"; }elsif (substring (option vendor-class-identifier, 15, 9) = "MacPro1,1") { filename "grub/bootx32.efi"; }elsif (substring (option vendor-class-identifier, 15, 9) = "Xserve1,1") { filename "grub/bootx32.efi"; }else { filename "grub/bootx64.efi"; } } class "pxeclients" { match if substring (option vendor-class-identifier, 0, 9) = "PXEClient"; next-server 192.168.2.1; if (option arch = 00:00) { filename "bios/pxelinux.0"; }elsif (option arch = 00:06) { filename "grub/bootx32.efi"; }elsif (option arch = 00:07) { filename "grub/bootx64.efi"; } } subnet 192.168.2.0 netmask 255.255.255.0 { range dynamic-bootp 192.168.2.10 192.168.2.254; next-server 192.168.2.1; option subnet-mask 255.255.255.0; option broadcast-address 192.168.2.255; option routers 192.168.2.1; default-lease-time 600; max-lease-time 3600; }