Tuesday, February 08, 2005

Automated Solaris installs

One of my friend asked me today how to JumpStart system so he can install Solaris 10. The reason? It's much faster to install system over a network using JumpStart technology then using CD/DVD. And it's non-interactive (depends on configuration) and fully repeatable which is really useful on servers.

I've just found nice BluePrint article on Configuring JumpStart Servers to Provision Sun x86-64 Systems.
You can find more BluePrint articles about JumpStart here.
And of course there's a documentation on http://docs.sun.com on Solaris 10 Installation Guide: Custom JumpStart and Advanced Installations.

Cookbook for JumpStart:

Below method is a quick summary only without explaining anything. For more info look at above URLs.
It works on SPARC using RARP. If you want to JumpStart x86 system you have to configure PXE
and DHCP (look at URLs at the beginning of this post).
It assumes that both install server and client are on the same local network.
There are probably more assumptions.
There are other options available - like Flash archives, Live Upgrade, etc.
These are really nice features - so if you are really serious about automated installing
lot of servers - go and read about these features at least.

First we have to mount DVD ISO with Solaris 10.
It's nice that now Sun provides both DVD and CD ISOs.
Now you can mount and setup install server on one architecture
for another - for example setup install server entirely on SPARC
for x86/x64 and SPARC platforms without x86/x64 platform.
Second I prefer using ISOs - it's just faster that way and don't
have to burn CD/DVD.

lofiadm -a `pwd`/s10-GA-DVD-ISO_IMAGE
mount -F hsfs -o ro /dev/lofi/1 /mnt/install # /dev/lofi/1 - look here
cd /mnt/install/Solaris_10/Tools
./setup_install_server /install/s10-ga-sparc
cd /install/s10-ga-sparc/Solaris_10/Tools
mkdir /install/jumpstart
./add_install_client -c js_server:/install/jumpstart -p si_server:/install/jumpstart client sun4u

where: js_server is a jumpstart server
si_server is a sysidcfg server
client - hostname for a client being to install

I usually have js_sevrver = si_server = some_ip

for example:
./add_install_client -c -p test sun4u

Above script will enable RARP, tftp and bootparams daemons. If you don't like it
you can set up all this manually of course - look at URLs I pointed out at
the beginning of this post.

Now you have to create sysidcfg file in /install/jumpstart
$ cat sysidcfg

Then create rules file in the same directory:
$ cat rules
arch sparc = s10_sparc_profile -

Now create file s10_sparc_profile, minimum would be:
$ cat s10_sparc_profile
install_type initial_install
system_type server
cluster SUNWCreq # Core system
partitioning explicit
filesys c0t0d0s0 2048 swap
filesys c0t0d0s1 2048 /
filesys c0t0d0s3 4096 /var
filesys c0t0d0s4 4096 /opt

This is minimal and will install Core distribution. Normally I add here:
package SUNWbash
package SUNWdoc
package SUNWatfsu delete

and so on

Now copy /install/s10-ga-sparc/Solaris_10/Misc/jumpstart_sample/check to /install/jumpstart
and run:
./check -r rules -p /install/s10-ga-sparc/
Validating rules...
Validating profile s10_sparc_profile...
The custom JumpStart configuration is ok.

Now on sparc client from OBP issue: boot net - install

If you want to get rid of NFSv4 domain question after restart then put in finish script:

touch /a/etc/.NFS4inst_state.domain

Or better use Misc/jumpstart_sample/set_nfs4_domain script.

Thanks to Trinisan from #solaris on irc.freenode.org for this NFSv4 trick.


Anonymous said...

when i try to launch ./setup_install_server /install/s10-ga-sparc i have this error: bash: ./setup_install_server: No such device or address

Rich said...

make sure you are in the Solaris/Tools directory on the DVD/CD and do an ls. You should see the setup_install_server file.