OpenBSD Journal

PXE OpenBSD Network Installs

Contributed by jose on from the automated-installs dept.

Darren askss: "I would like to automate the install of OpenBSD via PXE for rapid over the network server "deployment".

There was a very interesting post to misc that has information on scripting the initial installation part, although i've yet to look into this to see how well it works on OpenBSD 3.3-release.

http://marc.theaimsgroup.com/?l=openbsd-misc&m=104313392300688&w=2

One question in particular I wondered about is if there a faster method than running cvsup to go from from -release to -stable by recompiling everything which becomes a bottleneck in terms of speed when you need to setup/install a server quickly. Of course you could create a package for these changes in the system (source and binary changes), but I don't think that's such a good idea.

One method would be to remotely install the system, cvsup, recompile everything and then take a system image, possibly using "System Installation Suite" and then use that system image to install all other systems, which as far as I can tell, would be the quickest method. With so few OpenBSD security updates, that appears a pretty good system "in theory"." Anyone have any suggestions on this? PXE booting looks really useful, I need to learn how to do this.

(Comments are closed)


Comments
  1. By Ed () on


    cd /usr/src
    make obj
    make build
    setenv DESTDIR /tmproot
    setenv RELEASEDIR /release
    cd etc
    make release

    Something like this...

  2. By G () on

    PXE is just another bootloader like MBR, rest is served by other protocols like NFS.

  3. By Sava () sava@KEINSPAM.iki.fi on mailto:sava@KEINSPAM.iki.fi

    Things you need are DHCP, TFTP and PXE patch for GRUB .

    With TFTP and PXE you can deliver bootloaders and kernels easily via your DHCP server. Set up TFTP server to share files from e.g. /tftpboot directory, and add something like following lines to your dhcpd.conf:

    host mybox {

    hardware ethernet 00:11:22:33:44:55;
    fixed-address 192.168.1.123;
    option host-name "mybox";
    filename "/tftpboot/pxegrub";
    }

    Note that PXE-patched grub works differently than pxelinux because pxelinux delivers straight the kernel (and ramdisk) image, but grub is only a bootloader.

    When the PXE finds DHCP server, it gets the grub bootloader image and executes it. Because the newly launched grub does not know about IP address, kernel image, or anything, they have to be told manually.

    Get IP address dynamically:

    grub> dhcp

    Tell where the kernel is (depending of your TFTP configuration):

    grub> kernel (nd)/tftpboot/bsd.rd

    Boot the loaded kernel:

    grub> boot

    I have not tried to fully automatise the OpenBSD booting process via network. If someone has, please share your configuration :)

Credits

Copyright © - Daniel Hartmeier. All rights reserved. Articles and comments are copyright their respective authors, submission implies license to publish on this web site. Contents of the archive prior to as well as images and HTML templates were copied from the fabulous original deadly.org with Jose's and Jim's kind permission. This journal runs as CGI with httpd(8) on OpenBSD, the source code is BSD licensed. undeadly \Un*dead"ly\, a. Not subject to death; immortal. [Obs.]