There are some HOWTOs out there in the net which describe some automatic network based install via PXE-booting a machine from a server which has a specific FreeBSD release in the PXE-booting area and a non-interactive config for sysinstall to install this FreeBSD version on the machine which PXE-boots this.
The setup of this is completely manual and only allows to netboot one FreeBSD version. The server-side setup for the clients is also completely manual (and only allows to install one client at a time, it seems). This is not very user-friendly, and far away from the power of Jumpstart/JET for Solaris where you create a template (maybe from another template with automatic value (IP, name, MAC) replacement) and can specify different OS releases for different clients and then just run a command to generate a good config for this.
I thought a little bit how it could be done and decided to write down all the stuff (so far 160 lines, 830 words) to not forget some details. All in all I think this could be done (at least a sensible subset) in a week or two (fulltime) if you have the hardware, motivation, and time. As always, the problems are within the details, so I may be off with my estimation a little bit (also depends upon the knowledge-level (shell, tftp, dhcpd, install-software) of the person doing this).
Unfortunately I do not know if I have the hardware at home to do something like this. I have some unused harddisks which could be used in a machine which is used temporary as a test-install-client (normally I use this machines as my Desktop… if I do not use my little Netbook instead, as I do not do much at home currently), but I’ve never checked if this machine is PXE-booting-capable (VIA KT133 chipset with a 3Com 3c905C-TX Fast Etherlink XL). I also do not have the time to do this (with the current rate of free time I would expect to need about a year), except maybe someone would call my boss and negotiate something.
I can not remember any request to have something 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 nearly nobody is interested in something like this, or are the current possibilities enough for your needs? Do you work at a place where this would be welcome (= directly used when it would be done)? If you use a simple solution to make a net-install, what is your experience with this (pros/cons)?
I haven’t used netbooting, but the main reason for that seems to be the very same reason that made you look into this.
Every time I’ve looked up how to do it I’ve abandoned the idea because it seems troublesome and inflexible. Indeed, if something like this would be included in FreeBSD I would likely use it at my place of employment.
I guess what I’m trying to say is that just because noone requested it doesn’t mean noone would use it. Perhaps noone really knew netbooting could be made a lot more flexible with a weeks work. I certaintly didn’t 🙂
Can’t you select different OS versions to boot via PXE in your dhcpd configuration?
Sort of related: there were some useful changes made to tftpd in dragonfly (to allow for larger boot images etc) that applied cleanly to FreeBSD tftpd.
It is not that you can not do it somehow by hand (I think this is just a matter of config files, and the 1 – 2 weeks of work I describe is not about extending tftpd or dhcpd), it is about simplification so that you can let even a juinior-admin add new versions / machines. So instead of a day or two (for someone who really knows what he does) to setup something like this, it will only need maybe half an hour. And instead of an hour or two to add another OSVERSION, it could be just 5 – 10 minutes to add a new one. And instead of one machine-install at a time (with config changes in-between), you could install as many machines in parallel as your network/server bandwith allows it.
I hacked up something like this a couple of years back. The result was a system where I could install any FreeBSD version on any netboot-capable machine in a couple of minutes.
dhcpd first: it seems a bit like a hack to build extra fields onto the DHCP message, but DHCP is really the only sensible way to distribute “boot from here” information. Typing the correct incantations in the dhcpd config file is a separate tutorial worthy.
Since the possibilities of the FreeBSD non-interactive installscript really sucked and were entirely inadequate for my needs, I ended up creating a full distribution (make distribution) beforehand, opening as a chroot and installing any ports, and making all relevant changes to configuration files, and then archiving the distribution files on my file server. The archive would then contain a tarball for every FreeBSD version + configuration combination I needed.
I then pointed the pxeloader at a stripped-down ramdisk FreeBSD installation with the sole task of running a custom rc.local script which would format the harddisk, fetch the distribution tarball from the file server via NFS and write the tarball to the disk. For my lightweight distribution this took ca. 2 minutes, MUCH faster than running through a traditional non-interactive install process. The rc.local script contained the logic to select the the correct distribution (version + config) on the file server, although I had to change the script when I wanted another version (unless I always wanted HEAD). The config was chosen automatically based on the MAC address of the machine.
I ended up setting up a TFTP server only for the ramdisk installation. It would be really nice if the pxeloader supported fetching via HTTP too, in addition to NFS and TFTP.
As these were throw-away installations intended to run tests, I needed to also be able to nuke the installation and install a new version automatically. I did this by setting the harddisk as primary boot option in the BIOS and netboot as second option. When I needed to reinstall the machine, I just nuked the MBR and let the machine reboot.
If you find the time for your project, consider hacking up an easy way of creating custom, fully-functional distributions fast on a build machine. Something like NanoBSD. The installation process would then only involve creating a ramdisk-based FreeBSD distribution and writing a simple rc.local installation script that prepares the system disk, selects a distribution based on some logic and pipes the files to the disk.
PXE HTTP support: this was a Google Summer of Code project in 2007.
Regarding your suggestion: My idea is a little bit more complex than wat you have in mind. It would only work for suitable releases – ones which come with pc-sysinstall (and maybe the netinstall rc scripts… which have to be written first off-course) – but then you have something like the Solaris JET out-of-the-box (except for the dhcpd) in FreeBSD. I try to get some time next week to write a blog post of what I have in mind.
You will find the people looking for proper netinstall mechanisms – i.e. on freebsd-isp this is a topic to come up more regularly.
Some friends and I used scripted sysinst back in 2001 and I’m surprised how rarely it is being used, and even more that it wasn’t replaced by now.
Nonetheless it worked like a charm, PXE boot, disk setup, freebsd install.
I think most people are just not aware of the option and by today it’s of course outdated. No ZFS root with that. 😉
But I think bsdinstaller has some networking, at least some guy from the project asked for my old notes…
Anyway, I don’t wanna go into technical options here, just saying there are always people interested in PXE and some jumpstart-ish capabilities.