Being inspired by Solaris 11 and the fact that I have some down time between development activities, I thought some of you may be interested in a mini-series of posts (3 parts) on the topic of IPS in Solaris 11. IPS is the ‘Image Packaging System’ designed to replace the current packaging methods that have existed in Solaris for well over a decade. This more modern approach to packaging has some great benefits for both developers and system administrators alike combined with a learning curve (especially if you are not familiar with ZFS and SMF). While Oracle has released documentation on IPS for Solaris 11 Express, it currently lacks some solid examples, which I hope to assist with here. As this topic can stray in many directions, I plan to cover the following in order:
- How to Create the Solaris 11 IPS Repository (local copy of the repository) – post #1
- How to Create an AI Server (automated installation server which is a replacement of JumpStart) – post #2
- How to Publish Your Own IPS Packages – post #3
As background information I will be using the bits from Solaris 11 Express (snv_167) which is currently only available to those who have a valid Oracle Solaris support contract and who are participating in the Solaris Platinum Program. However, the tasks should not change too much, if any, for the GA version slated to come out this year (aside from ISOs/locations). Note also that I am not covering the installation of Solaris 11 on my server (an LDom), refer to the admin guides if you need help installing using the text installer.
To begin, I start off with a fresh install of Solaris 11 (snv_167) using the text installer. Now that my system is installed, I have to obtain the ISO images from Oracle.
# cd /var/tmp/ # export http_proxy=<your http proxy> # export https_proxy=<your https proxy> # wget --user=<email> --ask-password <URI to md5sums.txt> # wget --user=<email> --ask-password <URI to README.txt> # wget --user=<email> --ask-password <URI to sol-11-dev-167-ai-sparc.iso> # wget --user=<email> --ask-password <URI to sol-11-dev-167-repo-p01.iso-a> # wget --user=<email> --ask-password <URI to sol-11-dev-167-repo-p01.iso-b> # wget --user=<email> --ask-password <URI to sol-11-dev-167-repo-p02.iso-a> # wget --user=<email> --ask-password <URI to sol-11-dev-167-repo-p02.iso-b>
Now we concatenate the ISO images following the instructions in the README.txt file. This may take some time since each ISO is approximately 1.5g.
# cat sol-11-dev-167-repo-p01.iso-a sol-11-dev-167-repo-p01.iso-b > \ sol-11-dev-167-repo-p01.iso # cat sol-11-dev-167-repo-p02.iso-a sol-11-dev-167-repo-p02.iso-b > \ sol-11-dev-167-repo-p02.iso
Now that we’ve created the ISOs properly, we need to validate the md5 checksums to ensure the bits are good. Simply verify visually the md5sums are identical as below.
# cat md5sums.txt | egrep "ai-sparc|p01.iso$|p02.iso$" 235326ebe3753b6fcc4acb5dc6f256d1 sol-11-dev-167-ai-sparc.iso 0eaedb33bdcb77c188094047981eadc6 sol-11-dev-167-repo-p01.iso d17885413f6ea60047198ce167547d82 sol-11-dev-167-repo-p02.iso # md5sum sol-11-dev-167-ai-sparc.iso sol-11-dev-167-repo-p01.iso \ sol-11-dev-167-repo-p02.iso 235326ebe3753b6fcc4acb5dc6f256d1 sol-11-dev-167-ai-sparc.iso 0eaedb33bdcb77c188094047981eadc6 sol-11-dev-167-repo-p01.iso d17885413f6ea60047198ce167547d82 sol-11-dev-167-repo-p02.iso #
We have finally finished the tedious and very long process of obtaining the bits. Now we can move ahead create our first local Solaris 11 IPS repository. The first step is to create a ZFS file system to hold the repository packages.
# zfs create -o mountpoint=/IPS rpool/IPS # zfs create rpool/IPS/s11-167 # zfs list -r rpool/IPS NAME USED AVAIL REFER MOUNTPOINT rpool/IPS 63K 8.26G 32K /IPS rpool/IPS/s11-167-repo 31K 8.26G 31K /IPS/s11-167 #
Now we need to mount the first repository ISO image and copy it’s contents to the ZFS file system we created (/IPS/s11-167).
# lofiadm -a /var/tmp/sol-11-dev-167-repo-p01.iso # mount -F hsfs /dev/lofi/1 /mnt # rsync -aP /mnt/repo /IPS/s11-167-repo # umount /mnt # lofiadm -d /dev/lofi/1
Note there should not be a trailing slash (“/”) on the directory paths above or the rsync command will not copy the data properly and your repository will not function.
Now we need to repeat the steps above for the second ISO image for the repository.
# lofiadm -a /var/tmp/sol-11-dev-167-repo-p02.iso # mount -F hsfs /dev/lofi/1 /mnt # rsync -aP /mnt/repo /IPS/s11-167-repo # umount /mnt # lofiadm -d /dev/lofi/1
Both of the above rsync processes take quite some time since we are copying approximately 5.9g worth of data. Once the rsync is finished we can then move on to create the IPS repository using SMF. The advantage of using SMF allows one to disable/enable the service as needed as well as providing a quick way to re-point to another ZFS file system containing a possibly newer repository.
# svccfg -s pkg/server setprop pkg/inst_root=/IPS/s11-167/repo # svccfg -s pkg/server setprop pkg/readonly=true # svccfg -s pkg/server setprop pkg/port=10000
Verify your changes.
# svccfg -s pkg/server listprop | egrep "inst_root|readonly|port" pkg/inst_root astring /IPS/s11-167/repo pkg/readonly boolean true pkg/port count 10000 #
Now we can enable our new repository.
# svcadm refresh pkg/server # svcadm enable pkg/server # svcs pkg/server STATE STIME FMRI online 16:55:13 svc:/application/pkg/server:default #
Now that our repository has been successfully created, we need to validate it is accessible via HTTP. Simply open up a web browser and point to your new Solaris 11 IPS repository. As we configured it in SMF the URI is http://localhost:10000/. The webpage displayed should be similar to http://pkg.oracle.com/solaris/release. In the sample output below, I used the IP Address of my server to connect.
Success! Now let’s do some minor cleanup. By default, the Solaris 11 text installer will add the
solaris publisher your list of publishers which can be verified with
pkg publisher. Since the default publisher points back to Oracle, and we only want to use our local copy of the Solaris 11 repository, we need to change the publisher information. This is done as follows.
# pkg set-publisher -G http://pkg.oracle.com/solaris/release -g \ /IPS/s11-167/repo solaris
All finished! Our local Solaris 11 repository has been created via SMF, made available via HTTP and via local ZFS to our hosting server, and our future searches via
pkg search will only look at our repository instead of trying Oracle’s first.
In the next post I will cover how to use this Solaris 11 repository as the basis for creating an AI Server for remote installation (via HTTP) to SPARC based systems.