Thursday, February 23, 2012

Solaris 11 Automated Install without a network boot

After my last blog about Solaris 11 Automated Installer quick setup guide in a zone I did some more reading and I realised that you don't require to boot the client with DHCP, but boot it from a local device (CD or USB).

If you check out the download page for solaris down you will see Automated Installer can be downloaded as an ISO or USB version. If you download this and put it on to a CD or USB you can boot your client with it. When you boot it you see

Oracle Solaris 11 11/11 Automated Install custom
Oracle Solaris 11 11/11 Automated Install
Oracle Solaris 11 11/11 Automated Install custom ttya
Oracle Solaris 11 11/11 Automated Install custom ttyb
Oracle Solaris 11 11/11 Automated Install ttya
Oracle Solaris 11 11/11 Automated Install ttyb
  • Picking Oracle Solaris 11 11/11 Automated Install custom means you will be prompted for a URL where your manifest is located on the network
  • Picking Oracle Solaris 11 11/11 Automated Install will install Solaris using a default manifest

Modifying the default settings:
If you have placed the AI image onto a USB then you can edit it and change the default manifest.

  • Mount the USB image (USB)
# ls /media/DataTraveler 2.0
.                        .volsetid                  jack                      sbin
..                       auto_install             lost+found               solaris.zlib
.catalog                 bin                      mnt                      solarismisc.zlib
.cdrom                   boot                     platform                 system
.image_info              dev                      proc                     tmp
.liveusb                 devices                  reconfigure
.SELF-ASSEMBLY-REQUIRED  export                   root
.transfer-manifest.xml   home                     save
Edit the default.xml file:
# vi /media/DataTraveler 2.0/auto_install/manifest/default.xml

You would think you could edit the default profile as well, but you can't since it uses the default one located at /usr/share/auto_install/sc_profiles/enable_sci.xml which is not accessible, since /usr is a lofi mount. I think this should be classed as a bug, since you would expect it to use /auto_install/sc_profiles.

I have just filed a BUG report with Oracle for this
This is the way it should be done, if this BUG did not exist!!!

Edit default system configuration file:
# cd /media/DataTraveler 2.0/auto_install/sc_profiles/
# vi enable_sci.xml

Or use the sample one:
# cd /media/DataTraveler 2.0/auto_install/sc_profiles/
# cp sc_sample.xml enable_sci.xml

This is the way you have to do it now. Long way!!! We have to replace the solaris.zlib on the image
As before we mount the USB image
# cd /media/DataTraveler 2.0

Mount the image
# lofiadm -a solaris.zlib
# mount -F hsfs /dev/lofi/1 /mnt

Now copy the whole image
# mkdir /export/newsolaris
# cd /mnt
# find . -depth -print | cpio -pdm /export/newsolaris
# cd /export/newsolaris

Now we finally get to making are changes
# cd ./share/auto_install/sc_profiles/
# ls -l
total 27
-r--r--r--   1 root     sys         3104 Feb 23 17:39 enable_sci.xml
-r--r--r--   1 root     sys         3104 Oct 21 00:04 sc_sample.xml
-r--r--r--   1 root     sys         4656 Oct 21 00:04 static_network.xml
# cp -ip sc_sample.xml enable_sci.xml

Now re-create the solaris.zlib image
# mkisofs -o /tmp/solaris.zlib -quiet -N -l -R -U -allow-multidot -no-iso-translate -cache-inodes -d -D -V "compress" /export/newsolaris
Warning: creating filesystem that does not conform to ISO-9660.

It needs to be compressed
# lofiadm -C lzma /tmp/solaris.zlib

Copy it back to the USB image
# cp /tmp/solaris.zlib /media/DataTraveler 2.0

If you want to create an ISO so that you can test it on VirtualBox. Try:
# /usr/bin/mkisofs -d -D -J -l -r -U -relaxed-filenames -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -c .catalog -V "my_volume_name" -o /var/tmp/output.iso "/media/DataTraveler 2.0"
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
Size of boot image is 4 sectors -> No emulation
3.59% done, estimate finish Mon Feb 27 13:03:22 2012
7.17% done, estimate finish Mon Feb 27 13:03:22 2012
96.77% done, estimate finish Mon Feb 27 13:03:33 2012
Total translation table size: 2048
Total rockridge attributes bytes: 45685
Total directory bytes: 290816
Path table size(bytes): 1864
Max brk space used 7e000
139507 extents written (272 MB)

Save it and try it out!
You still require a network since the install still uses a network IPS repository

I have tested it with VirtualBox booting of an iso file I created from the USB image.


Anonymous said...

Fantastic post!
My group has used this method to build ISOs with customized manifest and profiles to great success.
I was wondering if you ever get around to playing with the SPARC version of the ISO. I think everything will work the same, but what we can't crack is modifying the boot menu. SPARC's boot menu doesn't have a time out or a way to customize it that I can find. If you have any words of wisdom, please let me know. Off to read your "no repo" post now...great stuff!

Andrew Watkins said...

Thanks for your comment. I have not looked at SPARC, but let me dig out a SPARC machine and have a play. Andrew

Andrew Watkins said...

May be I am not understanding your question, but I thought the boot process is controlled by the OBP prompt:

ok> boot cdrom - install aimanifest=prompt
ok> boot cdrom - install

or are you refering to this one?
ok> boot cdrom

Anonymous said...

Thanks for the reply Andrew. One of the other fellas in my group agrees with your post about the aimanifest switch and thinks we may be able to manipulate that into doing what we need. We very much appreciate what you are contributing to the community!

Paul said...

Do you have to use the default repo? I'm testing an install and it is taking *forever* versus using the text installer. The text installer takes <20 minutes. Love talk to more about it, you can find me @pauljrob on twitter.

Anonymous said...

Great post!
I wonder if there's a posibility to use the same image with different manifests chosen at boot time. Basically, we would need to have a list of grub menu entries, each one pointing to different ai_manifests that can be picked from the same directory as the default one.

Kevin said...

Very good article, but i hâve one question please. Since solaris 11 is using grub 2 for booting, boot file eltorito does not currently exist.
Could You please tell us what boot image we hâve to use ?

I did not find a solution exept the distrib constructor ...

Thank you. Kevin

Andrew Watkins said...


Well, I guess you are talking about how to boot your own pre-defined version of Solaris. Have you looked at Solaris 11.2 Unified Archive so that you take your solaris system then archive it and then deploy it to another system via a bootable media.

I have not used it but it looks what you are looking for.