I had the situation at work where I wanted to run Clearcase under a Solaris 10 zone. With a bit of coercing it’s possible to do, and doesn’t impact much of the global zone at all. If you don’t know what Clearcase is, then this still may be handy information to know. Undoubtedly, there are other applications that rely on loadable modules.
Pre-requisites
You need a stock Solaris 10 install.
You need to have a Clearcase release repository with at least patch 2003.06.00-29 applied.
Clearcase zone
If you don’t know how to setup a Solaris 10 zone, then you can start off with a basic one by doing the following. Take particular note of the LOFS mounting of /kernel. That’s important.
% zonecfg -z zone-clearcase
zone-clearcase: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:zone-clearcase> create
zonecfg:zone-clearcase> set autoboot=true
zonecfg:zone-clearcase> set zonepath=/mnt/zone/zone-clearcase
zonecfg:zone-clearcase> add net
zonecfg:zone-clearcase:net> set address=10.0.0.5
zonecfg:zone-clearcase:net> set physical=hme0
zonecfg:zone-clearcase:net> end
zonecfg:zone-clearcase> add fs
zonecfg:zone-clearcase:fs> set dir=/kernel
zonecfg:zone-clearcase:fs> set special=/kernel
zonecfg:zone-clearcase:fs> set type=lofs
zonecfg:zone-clearcase:fs> set options ro,nosuid
zonecfg:zone-clearcase:fs> end
zonecfg:zone-clearcase> info
zonepath: /mnt/zones/zone-clearcase
autoboot: true
pool:
inherit-pkg-dir:
dir: /lib
inherit-pkg-dir:
dir: /platform
inherit-pkg-dir:
dir: /sbin
inherit-pkg-dir:
dir: /usr
fs:
dir: /kernel
special: /kernel
raw not specified
type: lofs
options: [ro,nosuid]
net:
address: 10.0.0.5
physical: hme0
zonecfg:zone-clearcase> verify
zonecfg:zone-clearcase> commit
zonecfg:zone-clearcase> exit
%
Now install the zone, that has just been configured.
% mkdir -p /mnt/zones/zone-clearcase
% chmod 700 /mnt/zones/zone-clearcase
% zoneadm -z zone-clearcase install
Preparing to install zone .
Creating list of files to copy from the global zone.
Copying <143885> files to the zone.
Initializing zone product registry.
Determining zone package initialization order.
Preparing to initialize <1025> packages on the zone.
Initialized <1025> packages on zone.
Zone is initialized.
Installation of <1> packages was skipped.
Installation of these packages generated warnings:
The file contains a log of the zone installation.
Now you can boot up the zone, login to it’s console, and finish off the install.
% zoneadm list -cv % zoneadm list -cv
ID NAME STATUS PATH
0 global running /
- zone-clearcase installed /mnt/zones/zone-clearcase
% zoneadm -z zone-clearcase boot
% zlogin -C zone-clearcase
[Connected to zone 'zone-clearcase' console]
100/100
What type of terminal are you using?
1) ANSI Standard CRT
2) DEC VT52
3) DEC VT100
etc etc etc
Now you need to setup the clearcase repository. I gather you have done this before, so I won’t spell it out here. Everything is standard issue – install what you want leave out the bits you don’t want.
Once you have your clearcase repository you will need to install clearcase first in the global zone. Don’t worry – you will be disabling this later on. I also gather that you have performed this before, so I’ll leave that out as well.
Now the fun begins. Shutdown clearcase in the global zone.
% /etc/init.d/clearcase stop
Edit the /etc/init.d/clearcase and put the following entries right at the start.
% /usr/sbin/modload /opt/rational/clearcase/sun5/kvm/5.10/sparcv9/mvfs
% exit
Now startup ‘clearcase’ in the global zone. All this will do is load up the kernel module ‘mvfs’
Next you will have to restart your clearcase zone. This will ensure that this zone will be able to see the mvfs module loaded up.
% zoneadm -z zone-clearcase reboot
Now you can install clearcase into the zone you have created above. Do the normal things, install what you want leave out the bits you don’t. However, right at the end of the install you will possibly get some errors. You can ignore these.
And that’s it! You have one working clearcase server in a zone. You can setup as many as you want as well.