Simple and fast Solaris installation with Unified Archives

In the last post I discussed that the Golden Image approach still has its advantages even if you use configuration management frameworks like Puppet. But the success and the quality of this approach depends heavily on the available tools. Solaris 11.2 ships with the new “Unified Archives” technology, which was newly developed from scratch. Therefore it should be a much better solution compared to “Flash Archives” from Solaris 10. I assume it was easier to build a better tool on Solaris 11, because base technologies like IPS, ZFS and SMF could be fully leveraged.

A nice introduction of “Unified Archives” (“UAs”) can be found on the Oracle blog of Jesse Butler.

With AI (Automated Installer) Solaris 11 already has an install service with many great features. But if you don’t use AI very often, it can easily look complex. In this post I will show, how to deploy global zones with a simpler method.

Creating a Unified Archive file

UAs are very easy to use. After installing Solaris with your preferred installation procedure (ISO, AI, etc) you can customize the installation. When your are finished with your configuration you can create a single archive file with the following command:

# archiveadm create /data/gold-image-v1.uar

Infrastructure Setup

Unified archives are fully supported from Automated Installer (AI), you can just add the archive to AI. If you can’t use AI for whatever reason, you can just use the very handy AI boot media. This boot media is basically the boot image which is downloaded from the AI server during netboot, with the additional support to fetch the manifest files and sysconfig profiles from a web server.

You only need the following simple infrastructure:

  1. AI boot media e.g. “sol-11_2-beta-ai-sparc.iso” from oracle.com
  2. A Unified Archive file, in this example we will use “sol-11_2-beta-sparc.uar” from oracle.com, but of course you can use your own
  3. Basic DHCP server which just serves temporary IP addresses for installation time
  4. A static webserver which hosts the archive file, the AI manifest and the sysconfig profile

In this example the web server is a solaris host with the IP 192.168.0.20, you just need to start the web server and copy the files to /var/apache2/2.2/htdocs:

# svcadm enable http:apache22
# tree -ug /var/apache2/2.2/htdocs
/var/apache2/2.2/htdocs
├── [root     bin     ]  testserver1.xml
├── [root     bin     ]  sol-11_2-beta-sparc.uar
└── [root     bin     ]  archive-manifest.xml

The used AI manifest is a simple XML file:

AI Manifestarchive-manifest.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?xml version="1.0" encoding="UTF-8"?>
<auto_install>
  <ai_instance name="default" auto_reboot='true' >
    <target>
      <logical>
        <zpool name="rpool" is_root="true">
          <filesystem name="export" mountpoint="/export"/>
          <filesystem name="export/home"/>
        </zpool>
      </logical>
    </target>
    <software type="ARCHIVE">
      <source>
        <file uri="http://192.168.0.20/sol-11_2-beta-sparc.uar"/>
      </source>
    <software_data action="install">
      <name>global</name>
    </software_data>
    </software>
  </ai_instance>
</auto_install>

This AI manifest simple defines how to layout the rpool and where it can find the archive file.

As we don’t use a traditional AI server in this example we also need to place the sysconfig profile of the server which will be installed as XML file on the webserver.

Part of sysconfig profiletestserver1.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<service_bundle type="profile" name="sysconfig">

  <service version="1" type="service" name="system/identity">
    <instance enabled="true" name="node">
      <property_group type="application" name="config">
        <propval type="astring" name="nodename" value="testserver1"/>
      </property_group>
    </instance>
  </service>

  <service version="1" type="service" name="network/physical">
    <instance enabled="true" name="default">
      <property_group type="application" name="netcfg">
        <propval type="astring" name="active_ncp" value="Automatic"/>
      </property_group>
    </instance>
  </service>

  <service version="1" type="service" name="system/config-user">
    <instance enabled="true" name="default">
      <property_group type="application" name="root_account">
        <propval type="astring" name="type" value="normal"/>
        <propval type="astring" name="login" value="root"/>
        <propval type="astring" name="password" value="$5$s3Hwm8H2$D/ML9rrhT04znA.IhQxvorYbGxosOsc3.zbgeW2x1h4"/>
      </property_group>
    </instance>
  </service>
...
</service_bundle>

In this example profile the basic stuff like the hostname (“testserver1”), the root password (“solaris1”) and networking is definied. In the profile we use DHCP but you can also definie static IPs.

If you have all files on the web server you can start the installation.

Initiate non-interactive installation

Now you just need to boot the server which you like to install with the ai boot media. The boot media has the important parameters aimanifest and profile which need to point to the files on the webserver.

Especially the installation of SPARC systems is easy, because you can boot the system with the following command from OBP:

boot /virtual-devices@100/channel-devices@200/disk@1 - install aimanifest=http://192.168.0.20/archive-manifest.xml profile=http://192.168.0.20/testserver1.xml

In this example the AI boot media is presented as the ldom vdev /virtual-devices@100/channel-devices@200/disk@1. But you can also boot up for example a Virtualbox Intel VM and type the parameters into the GRUB command line. Just select the “Automated Install custom” GRUB menu entry, press e for edit and add the aimanifest and profile parameter like shown in the following example:

$multiboot $kern $kern -B install=true,aimanifest=http://192.168.0.20/archive-manifest.xml,profile=http://192.168.0.20/testserver1.xml

With F10 you can kick-off non-interactive installation by booting the VM. If you test on Intel don’t forget to use the x86 AI boot media and archive files.

09:30:28    Starting installation.
09:30:29    1% Preparing for Installation
09:30:32    8% target-discovery completed.
09:30:36    Selected Disk(s) : c1d0
09:30:37    9% target-selection completed.
09:30:37    10% ai-configuration completed.
09:30:37    9% var-share-dataset completed.
09:30:43    10% Beginning archive transfer
09:30:43    Commencing transfer of stream: e5128cac-a66c-657c-9332-bd0ea414d8a6-0.zfs to rpool
09:30:51    12% Transferring contents
09:31:44    Completed transfer of stream: 'e5128cac-a66c-657c-9332-bd0ea414d8a6-0.zfs' from http://192.168.0.20/sol-11_2-beta-sparc.uar
09:31:48    Archive transfer completed
09:31:51    Setting boot devices in firmware
09:31:51    91% boot-configuration completed.
09:31:52    92% setup-swap completed.
09:31:53    92% device-config completed.
09:31:59    92% apply-sysconfig completed.
09:32:00    98% boot-archive completed.
09:32:03    100% create-snapshot completed.
09:32:03    Automated Installation succeeded.
09:32:03    System will be rebooted now
Automated Installation finished successfully
Auto reboot enabled. The system will be rebooted now

As you can see on this (shortend) console output, the deployment of the 1.3 GB archive file needs less than 2 minutes. After the reboot the sysconfig profile is applied and the installation is finished.

Do you also think this method is easier to use than a full AI infrastructure? Feel free to share your comment or ping me.

Share Comments