Chain fog PXE with another one



  • Hi,

    I’m trying to integrate fog’s PXE server in my organization one’s.
    What I want to do is : my PXE server first chains to fog to query about a pending task.
    If a task’s pending for the host, it boots on it, if not, it chains back to our organization’s PXE server.
    I took a look at boot.php, but didn’t really understood where to add the “go back to my PXE server” in the newboot() function.
    (I know how to query for a pending task, it works if a task exists for the host, but I don’t know what to do to automatically go back (without delay nor prompt) if there’s not.

    Bonus question (just for curiosity) : What do the -ar option of your chain ipxe command ? I found nothing about that, wherever I searched on the net (I looked at ipxe doc pages, of course).

    Thanks for your help.
    E.T.


  • Moderator

    @zeltron80 Well you might have to do it that way. I can’t speak for the developers, but you are using FOG not in the way it was intended. So they might say its working as designed.

    But what you have found is one of the great features of FOSS based software. If you don’t like it you have the control to change it. What I would do is create a diff file of the original to the modified file, then you can reapply your changes by just patching any update with the diff file. You won’t need to hand code anything that way.



  • @george1421 Thanks for your answers , indeed i have found a similar solution for to force what i want but it’s not great if i need to do it at every futur update.
    I have edit line 157 in /var/www/html/fog/lib/fog/bootmenu.class.php :

     'exit' => 'exit'     to   'exit' => 'chain tftp://xxx.xxx.xxx.xxx/menu.ipxe'
    

    And i change Boot Exit settings in fog
    0_1522852756258_boot-exit-setting.jpg


  • Moderator

    I’m just shooting in the dark here. But it looks like a simple edit to replace the sanboot option with your chain command. I’m not saying it will work but its a hack you can try.

    Edit /var/www/html/fog/lib/fog/bootmenu.class.php then goto line 130 which says says:
    $sanboot = 'sanboot --no-describe --drive 0x80';
    Change the text between the single quotes to your chain command.
    Save and exit your editor. Hide the menu and see if it chains correctly.

    As aways make backups of files before you change them so you can reset them when it breaks.


  • Moderator

    @zeltron80 Just for clarity you must have a description field entered. I have request the developers change the title description to “Menu Title” to make it a bit clearer for the FOG Admin.

    As for your hidden menu issue. I’ll need to look at the code to see if its hard coded or not. From the sounds of it, the answer is yes.



  • @george1421 Yes, if the menu displayed and if there is no task, after x second i am chain to my pxe server because my menu in fog is as default. But if the no menu option is activate, it boot from first device. I send a picture :
    0_1522848799606_ipxe-fog.jpg

    0_1522848815120_menu-fog.jpg


  • Moderator

    @zeltron80 Understand that you are doing something the developers did not imagine when they created the iPXE menu stuff. We will not get help from the developers with non-designed issues.

    So if you have the no menu option, but you create a default menu to chain back it doesn’t work?

    To ask the question the other way. If you do have the menu displayed, and have the default set to chain back to your pxe server does that work?

    I want to identify if the problem is only when hidden menu is selected and not with your menu item.



  • @george1421

    Hello,
    Thanks for your answer. It’s most clear, but i have always a problem.
    The No Menu option is interessting because if there is no task it will boot from the first device.
    But i would like if there is no task, chain to my ipxe menu (i create a new menu in fog but i can’t use it if there is not a task, it’s all time sanboot --no-describe --drive 0x80 ).
    How i can use my chain instead of sanboot --no-describe --drive 0x80 ?
    Thanks



  • This post is deleted!

  • Moderator

    The short answer for this is to create a custom fog iPXE menu (using the web gui). This will chain back to your organization’s pxe server. Then from FOG you would set this new menu item as the default.

    So the idea is your default pxe server chains to fog’s ipxe. If FOG has something to do it will do it, if not the default action for the FOG menu is to chain back to your organization’s pxe server. Just be aware you will need to chain back to a point where the pxe client won’t turn around and chain back to the FOG server again creating a chain loop.


 

526
Online

5.4k
Users

12.6k
Topics

118.6k
Posts