Wise people learn when they can; fools learn when they must - Arthur Wellesley

Thursday, 18 September 2014

JumpStart on x86 (VMware) -- Solaris


                                        JUMPSTART On x86 (VMware)

Well… sometimes thought that why it is named as Jump-Start?

Does somebody have performed this while jumping or he/she started jumping after performing this?

Or… might be he/she was jumping from this system to that system to perform all steps so that it is named as Jumpstart….. 

Wow… If this is the answer then what do you say about Linux KICK-START?

Ok… Jokes apart…

This is the automated Solaris Installation method by which we can install the system remotely… mind the word “automated”

SO… here the steps to perform Jumpstart…
1.      Create a dir / mount point with at least 5gb
2.      Spool OS image to this dir / mount point
3.      Share the dir / mount point
4.      Create “susidcfg” file
5.      Create “profile” & “rules.ok” file

Extra Headache for x86

= Configure DHCP Server with PXE Boot

1…Created a 5gb slice
  0 unassigned    wm       0 -  652        5.00GB    (653/0/0)  10490445
root@sol-test-2:>/# mkdir /jumpstart
root@sol-test-2:>/# newfs /dev/rdsk/c1t1d0s0
newfs: construct a new file system /dev/rdsk/c1t1d0s0: (y/n)? y

root@sol-test-2:>/# mount -f ufs /dev/dsk/c1t1d0s0 /jumpstart/

Good… Now the 5 GB dir is created and mounted on /jumpstart folder

Now I will create 2 more directories…
root@sol-test-2:>/# mkdir /jumpstart/install
root@sol-test-2:>/# mkdir /jumpstart/config

2…Well… move to step 2… to spool the os image

root@sol-test-2:>/# cd /cdrom/sol_10_811_x86/
root@sol-test-2:>/cdrom/sol_10_811_x86# ls -l
total 0

cdrom is not recognizing…

root@sol-test-2:>/# /etc/init.d/volmgt stop
root@sol-test-2:>/# /etc/init.d/volmgt start

root@sol-test-2:>/# cd /cdrom/sol_10_811_x86/Solaris_10/
root@sol-test-2:>/cdrom/sol_10_811_x86/Solaris_10# cd Tools/

root@sol-test-2:>/cdrom/sol_10_811_x86/Solaris_10/Tools# ls -l
total 210
dr-xr-xr-x   3 root     root        2048 Aug 24  2011 Boot
dr-xr-xr-x   3 root     root        2048 Aug 24  2011 Installers
-r-xr-xr-x   1 root     root       64970 Mar 31  2011 add_install_client
-r-xr-xr-x   1 root     root        1325 Mar 31  2011 dial
-r-xr-xr-x   1 root     root       18380 Mar 31  2011 rm_install_client
-r-xr-xr-x   1 root     root       18328 Mar 31  2011 setup_install_server

Here we find a script setup_install_server and we need to run it to spool os image


root@sol-test-2:>/cdrom/sol_10_811_x86/Solaris_10/Tools# ./setup_install_server /jumpstart/install/
Verifying target directory...
Calculating the required disk space for the Solaris_10 product
Calculating space required for the installation boot image
Copying the CD image to disk...
Copying Install Boot Image hierarchy...
Copying /boot netboot hierarchy...
Install Server setup complete

Fine… the os image spooling has been done…

3… Now Share it…

root@sol-test-2:>/# vi /etc/dfs/dfstab
share -F nfs -o ro,anon=0 /jumpstart/install
share -F nfs -o ro,anon=0 /jumpstart/config

root@sol-test-2:>/# shareall
root@sol-test-2:>/# share
-               /jumpstart/config   ro,anon=0   ""
-               /jumpstart/install   ro,anon=0   ""

                        [here I am going for x86 … later we see SPARC]

4… Now Create “sysidcfg”

root@sol-test-2:>/jumpstart/config# vi sysidcfg
"sysidcfg" [New file]
network_interface=e1000g0 { primary protocol_ipv6=no
hostname=Jumpstart-test
netmask=255.255.255.0
default_route=192.168.234.2 }
security_policy=none
name_service=none
root_password= uQdMeYHuX47s2                 [I had copied it from current server’s /etc/shadow]
timezone=Asia/Calcutta
system_locale=en_US
timeserver=localhost
nfs4_domain=dynamic

We need to put all system related info in this file

5… Now Create “profile” file & rules.ok

root@sol-test-2:>/jumpstart/config# vi profile
"profile" [New file]
install_type initial_install
system_type standalone
# format the entire disk for Solaris
fdisk all solaris all
# define how the disk is partitioned
partitioning explicit
filesys rootdisk.s0 8000 /
filesys rootdisk.s1 1024 swap
filesys rootdisk.s7 free /partition7
========================================================
fdisk directive in profile file (only for x86 client)

fdisk = defines how fdisk partitions are setup on x86 system 
all = this should be disk name, so do it on all disks  
solaris = this is type of OS
all = this is size, so fdisk partition will take whole disk
=========================================================
This file contain installation related info … now rules.ok
root@sol-test-2:>/jumpstart/config# vi rules
"rules" [New file]
hostname Jumpstart-test - profile -

root@sol-test-2:>/# cp /jumpstart/install/Solaris_10/Misc/jumpstart_sample/check /jumpstart/config/

root@sol-test-2:>/jumpstart/config# ./check
Validating rules...
Validating profile profile...
The custom JumpStart configuration is ok.

Now the rules.ok file has been created as a result of this ./check



root@sol-test-2:>/jumpstart/config# ls -l
total 134
-r-xr-xr-x   1 root     root       64357 Sep 17 19:15 check
-rw-r--r--   1 root     root         264 Sep 17 19:07 profile
-rw-r--r--   1 root     root          60 Sep 17 19:22 rules
-rw-r--r--   1 root     root          63 Sep 17 19:22 rules.ok
-rw-r--r--   1 root     root         271 Sep 17 19:04 sysidcfg
root@sol-test-2:>/jumpstart/config# cat rules.ok
hostname Jumpstart-test - profile -
# version=2 checksum=3316

GREAT…

TRAVELLED TOO FAR… BUT THE REAL SHIT STARTS FROM HERE…
(ONLY FOR X86… FOR SPARC IT IS VERY FRIENDLY)


root@sol-test-2:>/# svcs -a |grep -i dhcp
disabled       17:23:15 svc:/network/dhcp-server:default

root@sol-test-2:>/# dhcpconfig -D -r SUNWfiles -p /var/dhcp
Created DHCP configuration file.
Created dhcptab.
Added "Locale" macro to dhcptab.
Added server macro to dhcptab - sol-test-2.
DHCP server started.

-D                    config files
-r                     data resources
-p                     path where to store these resources

root@sol-test-2:>/# svcs -a |grep -i dhcp
online         19:29:16 svc:/network/dhcp-server:default

root@sol-test-2:>/# dhcpconfig -S -q
DHCP server enabled.
DHCP server running.


For TFTP…

root@sol-test-2:>/# mkdir -m 711 /tftpboot
root@sol-test-2:>/# chown root:root /tftpboot

root@sol-test-2:>/# dhcpconfig -N 192.168.234.0 -t 192.168.234.2
Added network macro to dhcptab - 192.168.234.0.
Created network table.

-N                    for Network
-t                      for default router

root@sol-test-2:>/# pntadm -L
192.168.234.0

If nothing shows then add it manually…
Pntadm –C 192.168.234.0

root@sol-test-2:>/# pntadm -A 192.168.234.140 -c "testing on vmware" -f 00 -h jumpstart-test -i 000C29FC6E7B -m 192.168.234.0 -y -s 192.168.234.134 192.168.234.0
pntadm: Warning - No hosts resource value found in DHCP configuration file.
Operation succeeded, but hosts table was not updated.

-A         add client with ip
-c         comment
-f          flag say 00 or DYNAMIC
-h         hostname of client
-I          client’s mac id (always type in capital)
-m        macro (network)
-s         server’s ip from where the installation will performed
In last again the network

root@sol-test-2:>/# cd /jumpstart/install/Solaris_10/Tools/

root@sol-test-2:>/jumpstart/install/Solaris_10/Tools# ./add_install_client \
> -d \
> -c 192.168.234.134:/jumpstart/config \
> -p 192.168.234.134:/jumpstart/config \
> -e 00:0C:29:FC:6E:7B i86pc
enabling tftp in /etc/inetd.conf
Converting /etc/inetd.conf
enabling network/tftp/udp6 service
copying boot file to /tftpboot/pxegrub.I86PC.Solaris_10-1

If not already configured, enable PXE boot by creating
a macro named 01000C29FC6E7B with:
  Boot server IP (BootSrvA) : 192.168.234.134
  Boot file      (BootFile) : 01000C29FC6E7B

-d         means it is a dhcp client
-c         where the rules.ok is
-p         where the sysidcfg is
-e         mac address of client


root@sol-test-2:>/# svcs '*tftp*'
STATE          STIME    FMRI
online         20:06:17 svc:/network/tftp/udp6:default

root@sol-test-2:>/# cd /tftpboot/
root@sol-test-2:>/tftpboot# vi menu.lst.01000C29FC6E7B
"menu.lst.01000C29FC6E7B" 6 lines, 321 characters
default=0
timeout=30
min_mem64 1024
title Solaris_10 Jumpstart
kernel$ /I86PC.Solaris_10-1/multiboot kernel/$ISADIR/unix -B install_config=192.168.234.134:/jumpst
art/config,sysid_config=192.168.234.134:/jumpstart/config,install_media=192.168.234.134:/jumpstart/install
        module$ /I86PC.Solaris_10-1/$ISADIR/x86.miniroot

Well … consider the red line… we need to make some changes in this line,


We need to insert – install dhcp in between
kernel$ /I86PC.Solaris_10-1/multiboot kernel/$ISADIR/unix –B
and
install_config=192.168.234.134:/jumpst

like…
kernel$ /I86PC.Solaris_10-1/multiboot kernel/$ISADIR/unix - install dhcp -B install_config=192.168.234.134:/jumpstart/config

then save & quit

We also need macro about client to be added in dhcptab table.

root@sol-test-2:>/var/dhcp# dhtadm -A -m 01000C29FC6E7B -d ":BootSrvA=192.168.234.134::BootFile=pxegrub.I86PC.Solaris_10-1:"

-A             add macro 
-m            macro name, say same as hostname 
-d             must be between ", like "symbol=value:symbol=value:"
 
The Boot File pxegrub.I86PC.Solaris_10-1 is generated by command add_install_client
Client gets this file from TFTP server and executes by Preboot execution Environment (PXE). 

We can see the O/p’s by cat the files in /var/dhcp
root@sol-test-2:>/var/dhcp# ls –l
-rw-r--r--   1 root     root         218 Sep 18 11:15 SUNWfiles1_192_168_234_0
-rw-r--r--   1 root     root         450 Sep 18 11:15 SUNWfiles1_dhcptab

root@sol-test-2:>/tftpboot# dhtadm -P
Name                    Type            Value
==================================================
192.168.234.0           Macro        :Subnet=255.255.255.0:Router=192.168.234.2:Broadcst=192.168.234.255:
sol-test-2              Macro           :Include=Locale:Timeserv=192.168.234.134:LeaseTim=86400:LeaseNeg:
Locale                  Macro           :UTCoffst=19800:
This is the o/p before adding macro to the dhcptab file….
Below one is after adding macro… we can see in 1st line where info about boot file

root@sol-test-2:>/# dhtadm -P
Name                    Type            Value
==================================================
01000C29FC6E7B       Macro   :BootFile=pxegrub.I86PC.Solaris_10-1:BootSrvA=192.168.234.134:
192.168.234.0               Macro           :Subnet=255.255.255.0:Router=192.168.234.2:Broadcst=192.168.234.255:
sol-test-2              Macro           :Include=Locale:Timeserv=192.168.234.134:LeaseTim=86400:LeaseNeg:
Locale                  Macro           :UTCoffst=19800:

root@sol-test-2:>/tftpboot# svcs '*dhcp*'
STATE          STIME    FMRI
online         19:49:22 svc:/network/dhcp-server:default

root@sol-test-2:>/tftpboot# svcadm restart '*dhcp*'
root@sol-test-2:>/tftpboot# svcadm restart '*tftp*'

root@sol-test-2:>/# svcadm restart nfs/server

Well… all look good… now go to client and reboot it … then press Ctrl + N  or  press f12…
And great!!!

Booting has started…

It asked me 3 times to enter… then it is doing all on its own

Now … Lets have some Info that what we did… & … what happened


For Reference we have sample files of each configuration, provided by Jumpstart at this location

root@sol-test-2:>/jumpstart/install/Solaris_10/Misc/jumpstart_sample#

First of all we need some info about Systems
JS Server- IP
JS Client – IP  +  Hostname  +  MAC address

Then we need to spool the OS image in our JS Server
After that we need to create sysidcfg file
Sysidcfg           [SYSTEM IDENTIFICATION CONFIGURATION FILE]
Sysidcfg file contains all info about the System which is going to be install
Like,
System locale, time zone, terminal, name services, net interface, root password, etc.
 
Profile     [it is also called CLASS  file]
 
It contains the installation configuration info
Like,
File system layout , Disk Partitioning , Packages to install , If svm need to apply, If flar is to 
 be use ..etc…
 
Means It defines how to install the Software
 
Now… about “rules”  file…
 
Rules…
syntax
Match-key match-value begin profile finish
 
Match-key             predefined keywords that describes an attribute of the system which is about 
                                to install
                               (any , hostname , model , arch , installed , network……..) are some keywords

Match-value          value that matches the keyword

Begin                      bourne shell script to be run before installation (/var/sadm/system/begin.log)
                                If no script to run then use –

Profile                    the name of profile (class) file

Finish                     bourne shell script which meant to run after installation
 
Hostname              jumpstart-test5      -              profile5   -
[match-key]           [match-value]        [begin]    [profile]  [finish]
 
 
 
 
 
 
JUMPSTART USES 4 STEPS FOR ACCOMPLISHION OF TASKS
 
n  BOOT SERVICE
n  IDENTIFICATION SERVICE
n  CONFIGURATION SERVICE
n  INSTALLATION SERVICE
 
1.      BOOT SERVICE          client requires boot info about him, means there should be a place from where
                                  Clients can gather info about their booting,
                                  Client  ……>……. RARP ………>……..BC
                                  Boot Server receives that RARP BC …….>……..ARP ………>…….Client
                                  *Boot server must resides on same subnet,
                                  files that configured / used for boot service
                                  /etc/ethers | /etc/hosts  |  /tftpboot  | /etc/bootparams   | /etc/dfs/dfstab
 
2.      IDENTIFICATION       info about the system – sysidcfg file
 
3.      CONFIGURATION      it is about how the solaris installation proceed on client, it contains info                                      about Installation type / system type / disk partitioning info … means 
                                            Profile file is Implemented in this stage
 
4.      INSTALLATION          OS image is spooled to the client in this stage
                                              
 
 
 







No comments:

Post a Comment