Child pages
  • Automated Installer and Networked Installation
Skip to end of metadata
Go to start of metadata

Instead of using interactive LiveCD or LiveUSB installers, it is possible to streamline and standardize your OpenIndiana installations using the Automated Installer media (CD/USB images). It is just another product made by the Distribution Constructor, and related technology is also available in Solaris 11.

This page details how the AI media can be created (optionally) and used to set up an installation server to automatically install OpenIndiana onto your networked computers with PXE boot capability with tools available on almost any platform (so that this described install server does not have to be running on Solaris-related OS).

Information on this page draws heavily on blog posts by Joshua M. Clulow and those of some brave people walking in his steps (Jason Matthews and "Rich" "rincebrain"):

Other documentation about Automated Installer is available on the internet, including these resources about older OpenSolaris and rival Solaris 11 (Express):

This page is a work in progress, currently transferring content from blogs and revising the two-year-old info.

I (Jim Klimov) am not the author of the texts below, but I revised and commented some sentences as compared to original blog posts.

Original post by Joshua Clulow (17 October, 2010; oi_147, + new OI 151a3 updates)

OpenIndiana Automated Install Server

This is a draft set of steps for getting an automated install server configured on almost any platform using only Apache, DHCP and TFTP. It's very rough at this point but it functions well enough to PXE boot and install a copy of OpenIndiana (OI).

NOTE: The steps bellow assume all work is done in rpool; change accordingly if you have other, perhaps larger, pools.

First up, you should make a directory /export/install and get some scripts and configuration files:

git clone git:// /export/install

If you don't have git, you can grab a tarball of the repository at github's web interface.

If an OI bootable Automated Install (AI) ISO is not available, you can use the distro constructor to create your own. (NOTE: these are provided experimentally with oi_151a and in main download source with oi_151a3

I've made a few modifications to the AI ISO build descriptor that comes with OpenIndiana. You should grab the distro_const/ai_x86_image_JMC.xml file from the github repository and (on an OI host) run:

distro_const build ai_x86_image_JMC.xml

After a while you'll get a usable ISO in /rpool/dc/media that you can use to set up the rest of your environment.

You should extract the contents of the ISO (either of your own construction or downloaded from some other source) into /export/install/ai_image. Assuming your TFTP server is rooted in /tftpboot, you'll want to:

cp -rpH /export/install/ai_image/boot /tftpboot/oi

You'll also want a local IPS repository containing the current OI packages. Fetch this 2GB tarball (for OI 151a3): oi_151a_prestable2_repo.tar.bz2. Extract it into /export/install/repo.

You can use rsync to bring the repo seed files you got from the tarball up to date, thus:

rsync -a /export/install/repo/

TODO: Rewrite for (optional) use of pkg.depotd SMF service?

In order to simulate parts of the automated install server that ships with OI, I'm using a few CGI shell scripts. There are two ksh scripts and a list of packages to be installed (cgi-bin/PACKAGES_LIST) in the git repository which you can customize to your liking. I've also prepared some responses to the /versions/0 and /publisher/[01] methods of a real IPS repository server. As these responses are essentially static I'm just using regular text files.

Configure Apache (I used version 2.2 from pkgsrc) on your system. You'll need two virtual hosts, each listening on a different port (e.g. 5555 and 10000). These vhosts will map the various service URLs onto local repository content and the CGI scripts. They should be configured as per the sample in the git repo: doc/apache_vhost_config.txt.

Make sure you set the correct URL to the IPS repository vhost in environment variable $REPO_URL_MAIN in cgi-bin/ai-manifest.ksh. This tells the AI client to use your new local repository instead of the one on the Internet. Unlike the public URL, yours will not end in /dev if you've used the exact vhost configuration I've provided. Note that the additional /legacy repository is, by all accounts, incredibly large and you don't really need many packages from it so I'm just using the public remote copy.

You should also create a GRUB menu.lst from the example in the git repository using the IP address and port numbers of your Apache vhosts and put it in /tftpboot/oi.

Finally, configure DHCP (I use ISC dhcpd) to answer your host's PXE requests. If you're also using ISC dhcpd then something like this snippet should suffice (use your host name, MAC and IP addresses instead of those in the example):

option grubmenu code 150 = text;
# Force grubmenu to appear in the request list...
if exists dhcp-parameter-request-list {
       option dhcp-parameter-request-list = concat(option dhcp-parameter-request-list,96);
host odin {
   hardware ethernet 00:13:72:17:39:d2;
   filename "oi/grub/pxegrub";
   option grubmenu "oi/menu.lst";

With all this together you should be able to PXE boot a host with OI 151a3! Feedback and corrections welcome.

NB: Credit where it's due, I started with this page on the OpenIndiana Wiki.

Follow-up post by "rincebrain" (August 26, 2011; oi_148)

Using AI to do an unaided install on OpenIndiana b148


If you have any questions, comments, concerns, corrections, etc, feel free to email me. I'd love to know what I did horribly wrong. :)

So, I was looking into how to automatically install OpenIndiana on systems in a manner similar to the Kickstart mechanism for RHEL-alikes or Jumpstart for Solaris proper.

I received instructions that I should not go down this road unless I enjoyed pain and suffering.

I got it working anyway, so here's how so you can too (without having OpenIndiana or any Solaris system already running).

I started out with the instructions by Joshua found here. His instructions were very helpful, but ultimately, they were incomplete – whether this is because of differences in version or something else, I do not know.

Start out as his instructions do – make an /export/install (or your favorite path; I'll refer to it as $INSTALL_BASE from here on), and get the scripts:

git clone git:// $INSTALL_BASE

(I forked his repository. At present, my changes are mostly cosmetic, though I changed the root password in the generated ai_instance to be "jack" as well. Feel free to pull his original repo instead; things may just require more tweaking.)

You're going to need:

  • an Apache-like webserver (you need CGI support for the scripts in the above, and you'll ideally be using it to serve a local mirror of the OpenIndiana repo as well);
  • A working DHCP setup with PXE capability, which includes...
  • ...The ability to serve a couple of files over TFTP (I'm going to refer to the base of your TFTP path as $TFTP_BASE – for me, that's /tftproot; YMMV);
  • About 4 GB for an OI local package repo, according to my current copy;
  • An OpenIndiana Automated Installer CD (in Joshua's guide above, he explains how to make one; since then, OI has started providing prebuilt ones, so I used the b148 CD available here);
  • The CGI scripts in this example use /bin/ksh – you can probably use another shell with them with not too much work, but I didn't need to.
Got everything mentioned above? Great.

First, loopback-mount the OI AI CD you grabbed above somewhere – I'll use $INSTALL_BASE/ai_image, like the guide I'm basing this on did, and copy the required boot files off into a convenient place to serve them (I used $TFTP_BASE/oi):

mkdir $INSTALL_BASE/ai_image
mount -F hsfs -o ro `lofiadm -a /path/to/oi_ai.iso` $INSTALL_BASE/ai_image
cp -r $INSTALL_BASE/ai_image/boot $TFTP_BASE/oi

As I said, you'd also probably like a local OI package repo – it'll save you a fair amount of time on install.

I'm making one at $INSTALL_BASE/repo – again, feel free to change it and change instructions appropriately. :)

rsync -a $INSTALL_BASE/repo/

Configure Apache with vhost directives appropriately to serve this up – the example would be here, and that'll work if you've used all of the paths mentioned in this example.

Feel free to find and replace /export/install with whatever you used for $INSTALL_BASE instead, but be sure to do it consistently here and in PXEgrub (later).

Now the most customization you'll probably want to do – the Automated Installer manifest file.

Joshua has nicely provided a CGI script which serves up the manifest to our target machine. My modifications do a few things – they add git to the default installed package list (NBD), make it diff more cleanly against the stock example (which was helpful to me for debugging), and most importantly, in my opinion, makes it partition and install to the root disk:

            <disk_keyword key="boot_disk" />
            <partition name="1" action="delete" />
            <partition name="2" action="delete" />
            <partition name="3" action="delete" />
            <partition name="4" action="delete" />
            <partition name="0" action="create" part_type="191" />
            <slice name="0" action="create" is_root="true" force="true" />

As a warning: it forcibly nukes the partitions on the existing disk that it detects as the "boot disk" (caveat: some BIOSes lie, and you'll need to provide more explicit criteria – warning, the syntax on things that aren't just disk specification have changed, so that post's fuller examples won't work for you), and creates a single full-disk slice as root, which AI then defaults to using as the root for rpool. You might want some other setup on your systems.

Configure your DHCP daemon like so (this is for ISC dhcpd; if you use something else and have the correct syntax, share it, by all means):

# before any shared-network or similar statements; e.g. the first few lines
    option grubmenu code 150 = text;

# Inside of whatever group or shared-network or similar "set" that you want this to apply to:
        if exists dhcp-parameter-request-list {
               option dhcp-parameter-request-list = concat(option dhcp-parameter-request-list,96);

# And now an example host:
        host nosuch1 {
           hardware ethernet 00:11:22:33:44:55;
           fixed-address nosuch1;
           next-server whatever_dhcp_server_does_tftp;
           filename "oi/grub/pxegrub";
           option grubmenu "oi/menu.lst"; 

And now all you need to do is boot the PXE-enabled target host, and wait!

Errata and oddities

  • On the system I did this on (a Dell R815), the BMC would drop and entirely stop responding on the network once the OI kernel started.
    Someone suggested this was fastreboot's fault, but this happens on a cold boot of the network install too, not just fastreboot.
  • I did not figure out how to make it such that it would automagically reconfigure to NOT network install on reboot, so either manually force a PXEboot on the machine and have your root disk higher in boot order (ugh!) or edit the file it gets on PXE to produce a "boot to first hard drive" response (either PXEgrub with boot first hard drive chainloader, or just remove its PXE response entirely).
  • If your webserver is not running correctly or your manifest is incorrect, and you have the console redirected using console=, NO OTHER DISPLAYS WILL RECEIVE NOTIFICATION THAT IT FAILED - they will just print "...................." and never progress to the "OpenIndiana oi_148 ..." banner.
  • My example configuration has livessh=enable on the boot line, allowing you to remotely SSH in using jack:jack – you probably want to disable this once you're sure the installation is working, or at least change the password. :)


Thanks to everyone in #openindiana who put up with my uninformed questions and occasional ranting, and to Joshua Clulow for doing most of the hard work required. :)

Follow-up post by Jason Matthews (October 19, 2011; oi_151)

This post adds little new information except confirming that things still work as described for oi_151, and giving a screenshot of distro construction process.

Creating automated installer for OpenIndiana 151


After a brief consultation from Joshua Clulow via the OI discussion mail list I was able to build an automated installer (AI) image using Joshua's XML config file. Here is how I did it.


  1. Install the illumos Distribution Constructor package:

    # pkg install install/distribution-constructor
  2. Get Joshua's XML manifest for AI:

    # curl -k \ \
     > /var/tmp/ai_x86_image_JMC_151a.xml
  3. Run the Distribution Constructor to create a disk image:

    # distro_const build /var/tmp/ai_x86_image_JMC.xml
    /usr/share/distro_const/DC-manifest.defval.xml validates
     /tmp/ai_x86_image_JMC_151a_temp_2978.xml validates
     Simple Log: /rpool/dc/logs/simple-log-2011-10-12-10-57-04
     Detail Log: /rpool/dc/logs/detail-log-2011-10-12-10-57-04
     Build started Wed Oct 12 10:57:04 2011
     Distribution name: OpenIndiana_AI_X86_151a
     Build Area dataset: rpool/dc
     Build Area mount point: /rpool/dc
     ==== im-pop: Image area creation
     Initializing the IPS package image area: /rpool/dc/build_data/pkg_image
     Setting preferred publisher:
     Origin repository:
     Verifying the contents of the IPS repository
     Installing the designated packagesUninstalling the designated packages
     Setting post-install preferred publisher:
     Origin repository:
     Setting post-install alternate publisher:
     Origin repository:
     ==== im-mod: Image area modifications
     ==== ai-im-mod: Auto Install Image area modifications
     128 blocks
     ==== ba-init: Boot archive initialization
     252736 blocks
     2816 blocks
     35552 blocks
     0 blocks
     86288 blocks
     4752 blocks
     0 blocks
     0 blocks
     32 blocks
     176 blocks
     15808 blocks
     64 blocks
     0 blocks
     48 blocks
     0 blocks
     0 blocks
     ==== ba-config: Boot archive configuration
     /usr/share/distro_const/boot_archive_configure[80]: -p: not found [No such file or directory]
     /usr/share/distro_const/boot_archive_configure[80]: -p: not found [No such file or directory]
     ==== ai-ba-config: Auto Install boot archive configuration
     ==== ba-arch: Boot archive archiving (64-bit)
     454816 blocks
     331040 blocks
     ==== ba-arch-32: Boot archive archiving (32-bit)
     454816 blocks
     253952 blocks
     ==== post-mod-custom: Post boot archive image area custom modification
     ==== grub-setup: Grub menu setup
     ==== post-mod: Post boot archive image area modification
     Warning: creating filesystem that does not conform to ISO-9660.
     Warning: creating filesystem that does not conform to ISO-9660.
     ==== ai-publish-pkg: Publish Package
     ==== iso: ISO image creation
     Warning: creating filesystem that does not conform to ISO-9660.
     Setting input-charset to 'UTF-8' from locale.
     Size of boot image is 4 sectors -> No emulation
     2.90% done, estimate finish Wed Oct 12 12:02:17 2011
     5.79% done, estimate finish Wed Oct 12 12:02:17 2011
     98.42% done, estimate finish Wed Oct 12 12:02:18 2011
     Total translation table size: 2048
     Total rockridge attributes bytes: 38135
     Total directory bytes: 264192
     Path table size(bytes): 1710
     Max brk space used 86000
     172733 extents written (337 MB)
     ==== usb: USB image creation
     /dev/rlofi/2: 828600 sectors in 1381 cylinders of 1 tracks, 600 sectors
     404.6MB in 87 cyl groups (16 c/g, 4.69MB/g, 2240 i/g)
     super-block backups (for fsck -F ufs -o b=#) at:
     32, 9632, 19232, 28832, 38432, 48032, 57632, 67232, 76832, 86432,
     739232, 748832, 758432, 768032, 777632, 787232, 796832, 806432, 816032, 825632
     690416 blocks
     Build completed Wed Oct 12 12:03:30 2011
     Build is successful.

That's it, you have the ISO and USB image files.

  • No labels