Site icon UnixArena

How to create sparse root zone in Solaris

Solaris 10 offers many virtualization technologies and zones are one among them.Here we are going to see about sparse root zone.Sparse root zone shares as a read-only file system from the global zone of the /usr, /lib, /sbin and /platform directories.So compare to whole to root zone ,it will consume very less disk space.But you can’t modify the those shared directories since its shared on read only mode from global zone level.Performance wise,there is no difference compare to whole root zone according to oracle.
Here we are going to see how to create new sparse root zone. Beginning the zone creation with the zone name of zarena.

Creating new zone:
Arena-Node1#zonecfg -z zarena
zarena: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:zarena> create
zonecfg:zarena> info
zonename: zarena
zonepath:
brand: native
autoboot: false
bootargs:
pool:
limitpriv:
scheduling-class:
ip-type: shared
hostid:
inherit-pkg-dir:
       dir: /lib
inherit-pkg-dir:
        dir: /platform
inherit-pkg-dir:
        dir: /sbin
inherit-pkg-dir:
        dir: /usr
zonecfg:zarena> set zonepath=/zoravol1
zonecfg:zarena> add net 
zonecfg:zarena:net> set address=192.168.2.8
zonecfg:zarena:net> set physical=e1000g0
zonecfg:zarena:net> end
zonecfg:zarena> info
zonename: zarena
zonepath: /zoravol1
brand: native
autoboot: false
bootargs:
pool:
limitpriv:
scheduling-class:
ip-type: shared
hostid:
inherit-pkg-dir:
        dir: /lib
inherit-pkg-dir:
        dir: /platform
inherit-pkg-dir:
        dir: /sbin
inherit-pkg-dir:
        dir: /usr
net:
        address: 192.168.2.8
        physical: e1000g0
        defrouter not specified
zonecfg:zarena> verify
zonecfg:zarena> commit
zonecfg:zarena> exit

Checking the new zone status using the below command.

Arena-Node1#zoneadm list -cv
   ID NAME   STATUS    PATH     BRAND IP
   0  global running    /      native shared
   - zarena  configured /zoravol1 native shared

Modifying the zone’s root directory permission.

Arena-Node1#chmod 700 /zoravol1

Installing the zone.

Arena-Node1#zoneadm -z zarena install
Preparing to install zone .
Creating list of files to copy from the global zone.
Copying <5623> files to the zone.
Initializing zone product registry.
Determining zone package initialization order.
Preparing to initialize <1112> packages on the zone.
Initialized <1112> packages on zone.
Zone  is initialized.
Installation of <3> packages was skipped.
The file 
contains a log of the zone installation.

Arena-Node1#zoneadm list -cv
  ID NAME    STATUS PATH       BRAND IP
   0 global running   /      native shared
   - zarena i nstalled /zoravol1 native shared

Booting the zone

Arena-Node1#zoneadm -z zarena boot

Login in to zone’s console to complete the post installation steps.

Arena-Node1#zlogin -C zarena
[Connected to zone 'zarena' console]
Reading ZFS config: done.
What type of terminal are you using?
 1) ANSI Standard CRT
 2) DEC VT52
 3) DEC VT100
 4) Heathkit 19
 5) Lear Siegler ADM31
 6) PC Console
 7) Sun Command Tool
 8) Sun Workstation
 9) Televideo 910
 10) Televideo 925
 11) Wyse Model 50
 12) X Terminal Emulator (xterms)
 13) CDE Terminal Emulator (dtterm)
 14) Other
Type the number of your choice and press Return: 3
Creating new rsa public/private host key pair
Creating new dsa public/private host key pair
Configuring network interface addresses: e1000g0.

- Host Name for e1000g0:1 ---------------------------
  Enter the host name which identifies this system on the network. The name
  must be unique within your domain; creating a duplicate host name will           cause problems on the network after you install Solaris.
A host name must have at least one character; it can contain letters,
  digits, and minus signs (-).
             Host name for e1000g0:1 zarena
----------------------------------------------------
    F2_Continue F6_Help
What type of terminal are you using?
 1) ANSI Standard CRT
 2) DEC VT52
 3) DEC VT100
 4) Heathkit 19
 5) Lear Siegler ADM31
 6) PC Console
 7) Sun Command Tool
 8) Sun Workstation
 9) Televideo 910
 10) Televideo 925
 11) Wyse Model 50
 12) X Terminal Emulator (xterms)
 13) CDE Terminal Emulator (dtterm)
 14) Other

Type the number of your choice and press Return: 3
Creating new rsa public/private host key pair
Creating new dsa public/private host key pair
Configuring network interface addresses: e1000g0.

Complete the rest of the post installation steps by selecting default and selecting the proper time zone .
To terminate the zone’s console , use ~.

From global zone,verifying the zone status.

Arena-Node1#zoneadm list -cv
  ID NAME STATUS PATH BRAND IP
   0 global running / native shared
   2 zarena running /zoravol1 native shared

your zone is ready.Now you can Login in to zone using zlogin.

Arena-Node1#zlogin zarena
[Connected to zone 'zarena' pts/3]
Last login: Mon Jul 30 01:17:39 on pts/4
Oracle Corporation SunOS 5.10 Generic Patch January 2005
# bashbash-3.00# ifconfig -a
lo0:1: flags=2001000849 mtu 8232 index 1 inet 127.0.0.1 netmask ff000000
e1000g0:1: flags=1000843 mtu 1500 index 2 inet 192.168.2.8 netmask ffffff00 broadcast 192.168.2.255
For your information ,from Solaris 11 onwards we do not have sparse root zone .we will have only whole root zone in order to manage system individually.


Thank you for reading this article.Please leave a comment if you have any doubt ,i will get back to you as soon as possible.

Exit mobile version