Use http instead of tftp for fetching kernel and initrd

  • Hi there, I’m curious if I can use http instead of tftp in my ipxe menu settings, here is an example of what one menu item looks like

    kernel tftp://{fog-ip}/os/ubuntu/20.04/casper/vmlinuz
    initrd tftp://{fog-ip}]/os/ubuntu/20.04/casper/initrd
    imgargs vmlinuz initrd=initrd root=/dev/ram0 ramdisk_size=1800000 ip=dhcp url=http://{fog-ip}/os/20.04/ubuntu-20.04.1-live-server-amd64.iso net.ifnames=0 autoinstall ds=nocloud-net;s=http://{fog-ip}/os/20.04/server/ ro
    boot || goto MENU

    Am I able to use http in place of tftp? TFTP is just painfully slow. Thanks in advance!

  • Moderator

    @londonfog said in Use http instead of tftp for fetching kernel and initrd:

    and as long as directory above is in /var/www (ubuntu server here) it will work?

    Yes. Your actual files will need to be in /var/www/os/ubuntu/20.04/casper/ If all you are doing is changing the protocol.

    I agree that tftp over to a remote site will be painfully slow.

    If your remote site has a web server available, it may be faster to host this iso locally at the remote site:
    url=http://{fog-ip}/os/20.04/ubuntu-20.04.1-live-server-amd64.iso so you don’t have to copy that iso across your WAN link.

  • @londonfog as long as you don’t put any custom files in /var/www/fog you should be good. I have pmagic on my fog ipxe menu and put the files in /var/www/pm11_winpe and the permissions for the files are correct.

    This is what my ipxe menu item parameters look like:
    set tftp-path tftp://${fog-ip}
    set web-path http://${fog-ip}
    set pe-path ${web-path}/pm11_winpe
    kernel ${tftp-path}/wimboot gui
    imgfetch --name BCD ${pe-path}/BCD BCD
    imgfetch --name boot.sdi ${pe-path}/boot.sdi boot.sdi
    imgfetch --name bootmgr ${pe-path}/bootmgr bootmgr
    imgfetch --name boot.wim ${pe-path}/boot.wim boot.wim
    boot || goto MENU

  • @george1421
    So it would look like the following?

    kernel http://{fog-ip}/os/ubuntu/20.04/casper/vmlinuz
    initrd http://{fog-ip}]/os/ubuntu/20.04/casper/initrd

    and as long as directory above is in /var/www (ubuntu server here) it will work? Or, do I need to have kernel and initrd actually in root dir of /var/www not in sub directories? And you’re right tftp transfer is fast if I’m on the same site, we have some machines that need to image from a remote site which do not have a local fog node.

  • Moderator

    @londonfog yes you can use http:// for the protocol. You will need to move/link files under /var/www/html/ for centos/rhel or /var/www for debian family because that is the tree root for http, where tftp tree root is /tftpboot/

    Both vmlinuz and initrd should transfer pretty fast (< 15 seconds) using tftp. Once those are booted it loads the iso over http as part of the kernel args.