Jumstart/JET for FreeB­SD (brain­storm­ing)

There are some HOW­TOs out there in the net which describe some auto­mat­ic net­work based install via PXE-booting a machine from a serv­er which has a spe­cif­ic FreeB­SD release in the PXE-booting area and a non-interactive con­fig for sysin­stall to install this FreeB­SD ver­sion on the machine which PXE-boots this.

The set­up of this is com­plete­ly man­u­al and only allows to net­boot one FreeB­SD ver­sion. The server-side set­up for the clients is also com­plete­ly man­u­al (and only allows to install one client at a time, it seems). This is not very user-friendly, and far away from the pow­er of Jumpstart/JET for Solaris where you cre­ate a tem­plate (maybe from anoth­er tem­plate with auto­mat­ic val­ue (IP, name, MAC) replace­ment) and can spec­i­fy dif­fer­ent OS releas­es for dif­fer­ent clients and then just run a com­mand to gen­er­ate a good con­fig for this.

I thought a lit­tle bit how it could be done and decid­ed to write down all the stuff (so far 160 lines, 830 words) to not for­get some details. All in all I think this could be done (at least a sen­si­ble sub­set) in a week or two (full­time) if you have the hard­ware, moti­va­tion, and time. As always, the prob­lems are with­in the details, so I may be off with my esti­ma­tion a lit­tle bit (also depends upon the knowledge-level (shell, tftp, dhcpd, install-software) of the per­son doing this).

Unfor­tu­nate­ly I do not know if I have the hard­ware at home to do some­thing like this. I have some unused hard­disks which could be used in a machine which is used tem­po­rary as a test-install-client (nor­mal­ly I use this machines as my Desk­top… if I do not use my lit­tle Net­book instead, as I do not do much at home cur­rent­ly), but I’ve nev­er checked if this machine is PXE-booting-capable (VIA KT133 chipset with a 3Com 3c905C-TX Fast Ether­link XL). I also do not have the time to do this (with the cur­rent rate of free time I would expect to need about a year), except maybe some­one would call my boss and nego­ti­ate something.

I can not remem­ber any request to have some­thing like this on the freebsd-current, freebsd-arch or freebsd-hackers list since I read them (and that is since about at least 3.0‑RELEASE). Is this because near­ly nobody is inter­est­ed in some­thing like this, or are the cur­rent pos­si­bil­i­ties enough for your needs? Do you work at a place where this would be wel­come (= direct­ly used when it would be done)? If you use a sim­ple solu­tion to make a net-install, what is your expe­ri­ence with this (pros/cons)?

6 thoughts on “Jumstart/JET for FreeB­SD (brain­storm­ing)”

  1. tykling says:

    I haven’t used net­boot­ing, but the main rea­son for that seems to be the very same rea­son that made you look into this.
    Every time I’ve looked up how to do it I’ve aban­doned the idea because it seems trou­ble­some and inflex­i­ble. Indeed, if some­thing like this would be includ­ed in FreeB­SD I would like­ly use it at my place of employment.
    I guess what I’m try­ing to say is that just because noone request­ed it does­n’t mean noone would use it. Per­haps noone real­ly knew net­boot­ing could be made a lot more flex­i­ble with a weeks work. I cer­taint­ly didn’t 🙂

  2. BSDr says:

    Can’t you select dif­fer­ent OS ver­sions to boot via PXE in your dhcpd configuration?

    Sort of relat­ed: there were some use­ful changes made to tft­pd in drag­on­fly (to allow for larg­er boot images etc) that applied clean­ly to FreeB­SD tftpd.

    1. netchild says:

      It is not that you can not do it some­how by hand (I think this is just a mat­ter of con­fig files, and the 1 – 2 weeks of work I describe is not about extend­ing tft­pd or dhcpd), it is about sim­pli­fi­ca­tion so that you can let even a juinior-admin add new ver­sions / machines. So instead of a day or two (for some­one who real­ly knows what he does) to set­up some­thing like this, it will only need maybe half an hour. And instead of an hour or two to add anoth­er OSVERSION, it could be just 5 – 10 min­utes to add a new one. And instead of one machine-install at a time (with con­fig changes in-between), you could install as many machines in par­al­lel as your network/server band­with allows it.

  3. Erik Cederstrand says:

    I hacked up some­thing like this a cou­ple of years back. The result was a sys­tem where I could install any FreeB­SD ver­sion on any netboot-capable machine in a cou­ple of minutes.

    dhcpd first: it seems a bit like a hack to build extra fields onto the DHCP mes­sage, but DHCP is real­ly the only sen­si­ble way to dis­trib­ute “boot from here” infor­ma­tion. Typ­ing the cor­rect incan­ta­tions in the dhcpd con­fig file is a sep­a­rate tuto­r­i­al worthy.

    Since the pos­si­bil­i­ties of the FreeB­SD non-interactive installscript real­ly sucked and were entire­ly inad­e­quate for my needs, I end­ed up cre­at­ing a full dis­tri­b­u­tion (make dis­tri­b­u­tion) before­hand, open­ing as a chroot and installing any ports, and mak­ing all rel­e­vant changes to con­fig­u­ra­tion files, and then archiv­ing the dis­tri­b­u­tion files on my file serv­er. The archive would then con­tain a tar­ball for every FreeB­SD ver­sion + con­fig­u­ra­tion com­bi­na­tion I needed.

    I then point­ed the pxe­loader at a stripped-down ramdisk FreeB­SD instal­la­tion with the sole task of run­ning a cus­tom rc.local script which would for­mat the hard­disk, fetch the dis­tri­b­u­tion tar­ball from the file serv­er via NFS and write the tar­ball to the disk. For my light­weight dis­tri­b­u­tion this took ca. 2 min­utes, MUCH faster than run­ning through a tra­di­tion­al non-interactive install process. The rc.local script con­tained the log­ic to select the the cor­rect dis­tri­b­u­tion (ver­sion + con­fig) on the file serv­er, although I had to change the script when I want­ed anoth­er ver­sion (unless I always want­ed HEAD). The con­fig was cho­sen auto­mat­i­cal­ly based on the MAC address of the machine.

    I end­ed up set­ting up a TFTP serv­er only for the ramdisk instal­la­tion. It would be real­ly nice if the pxe­loader sup­port­ed fetch­ing via HTTP too, in addi­tion to NFS and TFTP.

    As these were throw-away instal­la­tions intend­ed to run tests, I need­ed to also be able to nuke the instal­la­tion and install a new ver­sion auto­mat­i­cal­ly. I did this by set­ting the hard­disk as pri­ma­ry boot option in the BIOS and net­boot as sec­ond option. When I need­ed to rein­stall the machine, I just nuked the MBR and let the machine reboot.

    If you find the time for your project, con­sid­er hack­ing up an easy way of cre­at­ing cus­tom, fully-functional dis­tri­b­u­tions fast on a build machine. Some­thing like NanoB­SD. The instal­la­tion process would then only involve cre­at­ing a ramdisk-based FreeB­SD dis­tri­b­u­tion and writ­ing a sim­ple rc.local instal­la­tion script that pre­pares the sys­tem disk, selects a dis­tri­b­u­tion based on some log­ic and pipes the files to the disk.

    1. netchild says:

      PXE HTTP sup­port: this was a Google Sum­mer of Code project in 2007.

      Regard­ing your sug­ges­tion: My idea is a lit­tle bit more com­plex than wat you have in mind. It would only work for suit­able releas­es – ones which come with pc-sysinstall (and maybe the netinstall rc scripts… which have to be writ­ten first off-course) – but then you have some­thing like the Solaris JET out-of-the-box (except for the dhcpd) in FreeB­SD. I try to get some time next week to write a blog post of what I have in mind.

  4. darkfader says:

    You will find the peo­ple look­ing for prop­er netinstall mech­a­nisms – i.e. on freebsd-isp this is a top­ic to come up more regularly.
    Some friends and I used script­ed sysinst back in 2001 and I’m sur­prised how rarely it is being used, and even more that it was­n’t replaced by now.
    Nonethe­less it worked like a charm, PXE boot, disk set­up, freeb­sd install.

    I think most peo­ple are just not aware of the option and by today it’s of course out­dat­ed. No ZFS root with that. 😉

    But I think bsdin­staller has some net­work­ing, at least some guy from the project asked for my old notes…
    Any­way, I don’t wan­na go into tech­ni­cal options here, just say­ing there are always peo­ple inter­est­ed in PXE and some jumpstart-ish capabilities.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.