Friday, March 21, 2014

How to create and install whole root zone on Solaris10

A whole root zone contains a read/write copy of the file system . When a whole root zone is created, from GLOBAL all packages are copied onto the whole root zone, it will create a dedicated copy of all files.

Steps to create Whole root zone with exclusive IP-address:

Some of the pre-request tasks.

1). Collect global server network details. 
2). Decide zone name what you want to create it 
3). Create zone directory with absolute path 
4). Change zone patch permission to 700 
5). Decide NIC/IP-address which you want to use for zone 

My GLOBAL zone network details:
[root@ivm01~]# ifconfig -a
lo0: flags=2001000849 mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
e1000g0: flags=1000843 mtu 1500 index 2
        inet 192.168.10.21 netmask ffffff00 broadcast 192.168.10.255
        ether 0:c:29:1d:c0:ff
[root@ivm01~]#dladm show-dev
e1000g0         link: up        speed: 1000  Mbps       duplex: full
e1000g1         link: unknown   speed: 0     Mbps       duplex: half
[root@ivm01~]#

To create simple whole root zone with exclusive IP, screenshot for same.

Note : For exclusive IP setup, we should not provide IP address while creating zone we have to configure IP address in OS level.

Create zone path and change permission:
[root@ivm01~]# mkdir /zonepool/tpt02
[root@ivm01~]# chmod 700 /zonepool/tpt02
[root@ivm01~]# ls -ld /zonepool/tpt02
drwx------   2 root     root           2 Mar 12 00:52 /zonepool/tpt02
[root@ivm01~]#
Procedure to create whole root zone: 
Note: To create whole root zone we must & should use -b option along with create command, else it will be a spare root zone.
[root@ivm01~]# zonecfg -z tpt02
tpt02: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:tpt02> create -b
zonecfg:tpt02> set zonepath=/zonepool/tpt012
zonecfg:tpt02> set zonename=tpt02
zonecfg:tpt02> set ip-type=exclusive
zonecfg:tpt02> add net
zonecfg:tpt02:net> set physical=e1000g1
zonecfg:tpt02:net> end
zonecfg:tpt02> info
zonename: tpt02
zonepath: /zonepool/tpt012
brand: native
autoboot: false
bootargs:
pool:
limitpriv:
scheduling-class:
ip-type: exclusive
hostid:
net:
        address not specified
        physical: e1000g1
        defrouter not specified
zonecfg:tpt02> commit
zonecfg:tpt02> verify
zonecfg:tpt02> exit
[root@ivm01~]#
Installation of whole root zone:
[root@ivm01~]# zoneadm -z tpt02 install
A ZFS file system has been created for this zone.
Preparing to install zone .
Creating list of files to copy from the global zone.
Copying <189370> files to the zone.
Initializing zone product registry.
Determining zone package initialization order.
Preparing to initialize <\> packages on the zone.
Initializing package <0> of <1466>: percent complete: 0%         
Initializing package <1> of <1466>: percent complete: 0%
Initializing package <1463> of <1466>: percent complete: 99%         
Initializing package <1464> of <1466>: percent complete: 99%         
Initializing package <1465> of <1466>: percent complete: 99%         
Initialized <1466> packages on zone.                                
Zone  is initialized.
The file (/zonepool/tpt02/root/var/sadm/system/logs/install_log) contains a log of the zone installation.
[root@ivm01~]#
To check zone status:
[root@ivm01~]# zoneadm list -cv
ID NAME          STATUS     PATH                        BRAND    IP    
0 global        running    /                              native   shared
- tpt02         installed  /zonepool/tpt02                native   excl  
[root@ivm01~]#
Boot the zone and login to the zone console, provide all the details to complete the zone installation:
[root@ivm01~]# zoneadm -z tpt02 boot
[root@ivm01~]# zlogin -C tpt02
[Connected to zone 'tpt02' console]
Select a Language

  0. English
  1. Japanese
  2. Korean
  3. Simplified Chinese
  4. Traditional Chinese

Please make a choice (0 - 4), or press h or ? for help: 0
rebooting system due to change(s) in /etc/default/init


[NOTICE: Zone rebooting]


SunOS Release 5.10 Version Generic_147441-01 64-bit
Copyright (c) 1983, 2011, Oracle and/or its affiliates. All rights reserved.
Hostname: tpt02
tpt02 console login: root
Password: Mar  5 23:08:59 tpt02 sendmail[13000]: My unqualified host name (tpt02) unknown; sleeping for retry Mar  5 23:08:59 tpt02 sendmail[13012]: My unqualified host name (tpt02) unknown; sleeping for retry 
Mar  5 23:09:00 tpt02 login: ROOT LOGIN /dev/console Oracle Corporation      SunOS 5.10      Generic Patch   January 2005
# bash
[root@ivm01~]#
Login to the zone:
[root@ivm01~]# zlogin tpt02
[Connected to zone 'tpt02' pts/4]
Last login: Wed Mar  5 00:45:10 on pts/4
Oracle Corporation      SunOS 5.10      Generic Patch   January 2005
# bash
[root@tpt02~]# df -h
Filesystem             size   used  avail capacity  Mounted on
/                       19G   4.6G    14G    25%    /
/dev                    19G   4.6G    14G    25%    /dev
proc                     0K     0K     0K     0%    /proc
ctfs                     0K     0K     0K     0%    /system/contract
mnttab                   0K     0K     0K     0%    /etc/mnttab
objfs                    0K     0K     0K     0%    /system/object
swap                   601M   316K   601M     1%    /etc/svc/volatile
/usr/lib/libc/libc_hwcap1.so.1
                        19G   4.6G    14G    25%    /lib/libc.so.1
fd                       0K     0K     0K     0%    /dev/fd
swap                   601M    36K   601M     1%    /tmp
swap                   601M    20K   601M     1%    /var/run
[root@tpt02~]#

1 comment:

  1. Hello There,

    Brilliant article, glad I slogged through the oracle it seems that a whole lot of the details really come back to from my past project.


    Just read a PC World article that I might be able to run Linux along side Windows XP:I'd like to try but how should I start and should I even attempt it? Someone give me some direction,please?
    Thanks a lot. This was a perfect step-by-step guide. Don’t think it could have been done better.


    Shukran,
    Radhey

    ReplyDelete