A place for Unix Thoughts and Ideas

Creating a derived profile jumpstart Installation

As a matter of philosophy, I worked with having a single profile/manifest for all of my Solaris baselines, and this has worked well for me for many years across sparc/x86 w/numerous updates and a couple major releases.

With the release of the T3/T4 based systems with their WWN based naming, my reliance on the rootdisk variable in my profile went out the window as I no longer could simply double-check with confidence that it had installed to the correct internal disks.

This lead me to creating a derived jumpstart profile which re-writes the jumpstart profile to specify the correct boot devices.

In my previous post I outlined my disk_slot.sh script which translates disk slot numbers to disk id’s on T3 & T4 based systems.

I’m going to use that script with a derived jumpstart profile to specify the proper disk(s) for installing Solaris 10.

Creating my begin script.
This script assumes that the disk_slot.sh has been placed in the install_config directory which also has the rules.ok file.

This script copies a existing profile I have, to the jumpstart profile defined by the already defined $SI_PROFILE variable.
My script then strips out the rootdisk.s0 line of my profile, so I can re-specify it.

Note, The s10_derived_profile used in my script is actually a symbolic link that points to the current profile that I’m using to deploy to my systems.

After that I will determine how many sas devices I have on my system.

If there is only 1, I will let the system proceed with using the “rootdisk”. Otherwise I launch into a case statement that specifies my desired disk slots.
This logic is here because on the Tx-1 or Tx-4 server, I want my boot disks in slots 0 & 4 which is the first position on each controller.

The script then calls my disk_slots.sh script and defines the disk mirror used for the root pool.

You can download  begin_derived.sh here

# Begin Script
# Create derived jumpstart profile for T3/T4 based systems with WWN disk devices
CNT=`prtconf -v | sed -e :a -e '$!N;s/\n[ ]*value=/ /;ta' -e 'P;D' | sed -n '/mpt_sas#/!d;n;p' | cut -d\' -f4  | wc -l | awk '{print $1}'`
echo "Found the following $CNT Disks"
prtconf -v | sed -e :a -e '$!N;s/\n[ ]*value=/ /;ta' -e 'P;D' | sed -n '/mpt_sas#/!d;n;p' | cut -d\' -f4 | tr '[:lower:]' '[:upper:]'

cp /tmp/install_config/profiles/s10_derived_profile ${SI_PROFILE}
perl -ni -e 'print if ! /rootdisk.s0/'  ${SI_PROFILE}

#if more then 2 disks, create a zfs mirror
if [ $CNT -ge 2 ]; then
        PLT=`prtconf -pv | head | egrep " name:" | cut -d\' -f2`
        if [ "$PLT" = "" ]; then
                PLT=`prtconf  | egrep '^SUNW|^ORCL'`

        case "$PLT" in
                echo "`echo $PLT | cut -d\, -f2` System"
                echo "Selecting disk Slots 0 and 4"
                echo "`echo $PLT | cut -d\, -f2` System"
                echo "Select disk Slots 0 and 1"

        DISK1="`/tmp/install_config/disk_slots.sh $FS`s0"
        DISK2="`/tmp/install_config/disk_slots.sh $SS`s0"

        echo "Selecting $DISK1 and $DISK2 for ZFS Mirror"
        echo "boot_device $DISK1 update" >> ${SI_PROFILE}
        echo "pool rpool auto 16384 auto mirror $DISK1 $DISK2" >> ${SI_PROFILE}
        WWN=`prtconf -v | sed -e :a -e '$!N;s/\n[ ]*value=/ /;ta' -e 'P;D' | sed -n '/mpt_sas#/!d;n;p' | cut -d\' -f4 | head -1 | tr '[:lower:]' '[:upper:]'`
        echo "Selecting $DEV for ZFS Filesystem"
        echo "boot_device $DEV update" >> ${SI_PROFILE}
        echo "pool rpool auto 16384 auto rootdisk.s0" >> ${SI_PROFILE}


Adding to Rules file

After I create my script, I will then add a rule for my new derived profile.

For a derived jumpstart profile, instead of specify a named profile, I’m going to specifying a = in the field

model ORCL,SPARC-T4-4 - begin_dervice.sh = finish.sh
model ORCL,SPARC-T3-1 - begin_derived.sh = finish.sh
any - begin.sh profiles/solaris_10_custom_zfs finish.sh

Then generating my rules.ok file, it is time to image my server.

Here is sample of the output from one of my T4-4

Checking rules.ok file...
Using begin script: begin_derived.sh
Using derived profile: begin_derived.sh
Using finish script: finish.sh
Executing JumpStart preinstall phase...
Executing begin script "begin_derived.sh"...
Found the following 2 Disks
SPARC-T4-4 System
Selecting disk Slots 0 and 4
Selecting c0t5000CCA02517FBF4d0s0 and c0t5000CCA0251F05ACd0s0 for ZFS Mirror
Begin script begin_derived.sh execution completed.

Updated 9/18/2012 – Fixed issue with Pltform detection on T4-1


2 responses to “Creating a derived profile jumpstart Installation

  1. Tim Wright January 8, 2013 at 12:42 am

    Since you are doing the probe model, why not use $SI_MODEL rather than getting this information again from prtconf?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: