A Pluggable Solaris IPS Repository
By Karim Berrah on May 17, 2013
Many of the nice features of Solaris 11, like Zones, IPS updates, resources management applied to zones, that we usually want to demo require, most of the time, a working IPS repository. Many people are actually using Virtual Box on their kaptop to do such demo. The only issue is that you either need a fast Internet connection while running your demo (rarely the case), or you need a big Virtual Machine where you have setup a local IPS repository (which can be time consuming), so I'm proposing a kind of mix of the two.
Repo on an SD card:
The idea is to have an SD card that we will used on a baremetal Solaris 11 machine, to create a zfs pool (called here sdpool): we will
copy all the files from a repo ISO image to the SD card, and then make
this device available to a VirtualBox VM through the shared folder features,
available in Virtual Box.
Insert the SD card (16GB is OK) in your Solaris laptop. Use the GParted Partition Editor, from the Solaris System tools, to erase any existing partition, and I write down the device name of my SD card (in this particular context /dev/dsk/c9t0d0p0 )
- Create a zfs pool with the SD card, called here sdpool : # zpool create sdpool /dev/dsk/c9t0d0p0
- Create a file system for this IPS repository: # zfs create sdpool/repoS11dot1
- As the SD card is a slow device, activate zfs compression # zfs set compression=on sdpool/repoS11dot1
- Improve access time by removing any access time updates after each read operation # zfs set atime=off sdpool/repoS11dot1
- Download the Solaris 11 iso repo Image and make it available on /sol-11_1-repo-full.iso
- Mount the iso image with # mount -F hsfs /sol-11_1-repo-full.iso /mnt
- Copy all the packages images on the sdcard with # cd /mnt/repo; tar cf - . | (cd /sdpool/repoS11dot1; tar xfp -)
- Check with: # df -k /sdpool/repoSol11dot1
- Check the actual used capacity can be checked (approx. 6GB) with # zfs list
With our repo on an SD card, we can:
- make it available to our Solaris laptop: #pkg set-publisher -G '*' -M '*' -g /sdppol/repoS11dot1 solaris. Be aware that this command remove the previous "solaris" publisher. Do not forget to refresh the local catalog with #pkgrepo -s /sdpool/repoS11dot1 refresh
- make it available to other solaris laptops by physically moving the SD card: zpool export sdpool (before removing the sd card) / zfs import sdpool (after inserting the SD card in the new laptop)
- make it available to any other VBox Solaris Virtual Machine image from the
laptop. We can use the "shared folders" settings of any Solaris 11 VBox
Virtual Machine, to automatically mount the SD card IPS repo inside the
VM, and point to it. If you activate the "shared folders" and
allow automount, you will have access to the content of your SD card
(repository packages) from the automounted /mnt/sf_repoS11dot1. You then need inside the VM to point to the right IPS repository with # pkg set-publisher -G '*' -M '*' -g /mnt/sf_repoS11dot1 solaris.
The good thing is that your Virtual machine is not containing the 6GB
of packages, and you don't need to set up a local IPS repo server.
- Of course, the SD card can be also any other USB based disk drive.