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:
- AI boot media e.g. “sol-11_2-beta-ai-sparc.iso” from oracle.com
- 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
- Basic DHCP server which just serves temporary IP addresses for installation time
- 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:
1 | <?xml version="1.0" encoding="UTF-8"?> |
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.
1 | <service_bundle type="profile" name="sysconfig"> |
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.