Zones
Zones
====================
Resource Sharing :
==================
Zones allow the root user of the global zones to dedicated system resources to
individual zones from
other zones and the global system. Each zone exist with separate process and file
system space and can only
monitor and interact with local process.
Zone concepts:
===============
1> Zone types.
2> Zone daemon.
3> Zone file system.
4> Zone networking.
5> Zone command scope.
6> Zone states.
Types of zones:
===============
1> Global zone -->> Every installed OS acts like a global zone. which is present by
default. ALl non-global zones can only be installed configured and administered
from global zones.
2> Non-global zone -->> They share the functioning of kernal booted under the
global zone. All the software and other resources are initiated from the global
zones.
2.1> Whole root zone -->> It gets their own writable copy of all file system
like /opt, /usr. it takes more disk space.
2.2> Sparse root zone -->> File system like /opt, /usr are shared from global zone
as loopback file-system (You only have a read-only access to those directories in
non-global zone) it takes very less disk space.
2.3> Branded zone -->> These are solaris 8 & 9 zones on solaris 10 global zones.
Zone Daemons :
===============
There are two daemon of the zone
1> zoneadmd --> is the primary process for managing the zone's virtual platform.The
daemon is also responsible for managing zone booting and shutting down.There is one
zoneadmd process running for each active (ready, running, or shutting down) zone on
the system.
2> zonesched --> a system scheduling process similar to sched, is used to track
kernel resources associated with the zone.
1> Undefined
2> Configured
3> incomplete
4> Installed
5> Ready
6> Running
7> Shutting
Undefined -->> In this state the zone configuration has not complete and commited
to stable storage.
Configured -->> In this state zone configuration complete and commited to storage.
Incomplete -->> This is trasitional state during install and uninstall operation
zone.
Installed -->> During this state zone configuration is installed on the system,
the package has been successful installed on the system.
Shutting -->> This is the state zone going down and transitional state that are
visible while the zone is being halt.
/etc/zones/zonename.xml
If file store the non global zone configuration do not edit this file.
Q. WHat is diff. between whole root zone and spare root zone ?
Ans. Whole root zones have all their binaries of their own zone root file system.
While spare root zone mount /usr, /lib, /platform bin from global zone.
Q. How to indentify the which whole root zone or spare root zone ?
Ans . # zonecfg -z zonename
You can determine weather it is whole root zone or sparse root zone.
If spare root zone we can see inherit package of /usr /bin /platform.
Where as in whole root zone you would not see these.
Q. How many zones we can create in one global zone ?
Ans. Max. of 8191 local zones we can create in a single OS.
Practical:
==========
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 (-).
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
Esc-2_Continue Esc-4_Change Esc-6_Help
q Time Zone qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
On this screen you must specify your default time zone. You can specify a
time zone in three ways: select one of the continents or oceans from the
list, select other - offset from GMT, or other - specify time zone file.
> To make a selection, use the arrow keys to highlight the option and
press Return to mark it [X].
> To make a selection, use the arrow keys to highlight the option and
press Return to mark it [X].
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
Esc-2_Continue Esc-6_Help
q Confirm Information qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
Esc-2_Continue Esc-4_Change Esc-6_Help
q Root Password qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
The root password may contain alphanumeric and special characters. For
security, the password will not be displayed on the screen as you type it.
> If you do not want a root password, leave both entries blank.
Root password: ****
Root password: ****
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
Esc-2_Continue Esc-6_Help
bash-3.00#
bash-3.00#
bash-3.00#
bash-3.00#
bash-3.00#
bash-3.00# uname -a
SunOS ravindra 5.10 Generic_139556-08 i86pc i386 i86pc
bash-3.00#
bash-3.00#
bash-3.00#
bash-3.00#
bash-3.00# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
2 ravindra running / native shared
bash-3.00#
bash-3.00#
FORMAT MENU:
disk - select a disk
type - select (define) a disk type
partition - select (define) a partition table
current - describe the current disk
format - format and analyze the disk
fdisk - run the fdisk program
repair - repair a defective sector
label - write label to the disk
analyze - surface analysis
defect - defect list management
backup - search for backup labels
verify - read and display labels
save - save new disk/partition definitions
inquiry - show vendor, product and revision
scsi - independent SCSI mode selects
cache - enable, disable or query SCSI disk cache
volname - set 8-character volume name
!<cmd> - execute <cmd>, then return
quit
format> p
format> fdisk
No fdisk table exists. The default partition for the disk is:
Type "y" to accept the default partition, otherwise type "n" to edit the
partition table.
y
format> p
PARTITION MENU:
0 - change `0' partition
1 - change `1' partition
2 - change `2' partition
3 - change `3' partition
4 - change `4' partition
5 - change `5' partition
6 - change `6' partition
7 - change `7' partition
9 - change `9' partition
select - select a predefined table
modify - modify a predefined partition table
name - name the current table
print - display the current table
label - write partition map and label to the disk
!<cmd> - execute <cmd>, then return
quit
partition> p
Current partition table (original):
Total disk cylinders available: 2555 + 2 (reserved cylinders)
partition> 0
Part Tag Flag Cylinders Size Blocks
0 unassigned wm 0 0 (0/0/0) 0
partition> p
Current partition table (unnamed):
Total disk cylinders available: 2555 + 2 (reserved cylinders)
partition>
partition>
partition> q
FORMAT MENU:
disk - select a disk
type - select (define) a disk type
partition - select (define) a partition table
current - describe the current disk
format - format and analyze the disk
fdisk - run the fdisk program
repair - repair a defective sector
label - write label to the disk
analyze - surface analysis
defect - defect list management
backup - search for backup labels
verify - read and display labels
save - save new disk/partition definitions
inquiry - show vendor, product and revision
scsi - independent SCSI mode selects
cache - enable, disable or query SCSI disk cache
volname - set 8-character volume name
!<cmd> - execute <cmd>, then return
quit
format> q
bash-3.00# newfs /dev/rdsk/c2t5d0s0
newfs: construct a new file system /dev/rdsk/c2t5d0s0: (y/n)? y
/dev/rdsk/c2t5d0s0: 1024000 sectors in 250 cylinders of 128 tracks, 32 sectors
500.0MB in 16 cyl groups (16 c/g, 32.00MB/g, 15360 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 65600, 131168, 196736, 262304, 327872, 393440, 459008, 524576, 590144,
655712, 721280, 786848, 852416, 917984, 983552
bash-3.00#
bash-3.00#
bash-3.00#
bash-3.00# mkdir /shivam
bash-3.00#
bash-3.00# zonecfg -z ravindra
zonecfg:ravindra> add fs
zonecfg:ravindra:fs> set dir = /shivam
zonecfg:ravindra:fs> set special = /dev/dsk/c2t5d0s0
zonecfg:ravindra:fs> set raw = /dev/rdsk/c2t5d0s0
zonecfg:ravindra:fs> set type = ufs
zonecfg:ravindra:fs> end
zonecfg:ravindra> verify
zonecfg:ravindra> commit
zonecfg:ravindra> exit
bash-3.00#
bash-3.00#
bash-3.00# zoneadm -z ravindra boot
bash-3.00#
bash-3.00# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
3 ravindra running /zone/zone1 native shared
bash-3.00# zonecfg -z ravindra info
zonename: ravindra
zonepath: /zone/zone1
brand: native
autoboot: false
bootargs:
pool:
limitpriv:
scheduling-class:
ip-type: shared
inherit-pkg-dir:
dir: /lib
inherit-pkg-dir:
dir: /platform
inherit-pkg-dir:
dir: /sbin
inherit-pkg-dir:
dir: /usr
fs:
dir: /shivam
special: /dev/dsk/c2t5d0s0
raw: /dev/rdsk/c2t5d0s0
type: ufs
options: []
bash-3.00#
bash-3.00#
bash-3.00# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
3 ravindra running /zone/zone1 native shared
bash-3.00#
bash-3.00#
bash-3.00# zlogin ravindra
[Connected to zone 'ravindra' pts/7]
Last login: Wed Dec 28 11:04:59 on console
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
#
#
# bash
bash-3.00#
bash-3.00#
bash-3.00# uname -a
SunOS ravindra 5.10 Generic_139556-08 i86pc i386 i86pc
bash-3.00#
bash-3.00# df -h
Filesystem size used avail capacity Mounted on
/ 19G 5.3G 14G 28% /
/dev 19G 5.3G 14G 28% /dev
/lib 19G 5.3G 14G 28% /lib
/platform 19G 5.3G 14G 28% /platform
/sbin 19G 5.3G 14G 28% /sbin
/shivam 470M 1.0M 422M 1% /shivam
/usr 19G 5.3G 14G 28% /usr
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 287M 312K 287M 1% /etc/svc/volatile
/usr/lib/libc/libc_hwcap2.so.1
19G 5.3G 14G 28% /lib/libc.so.1
fd 0K 0K 0K 0% /dev/fd
swap 287M 36K 287M 1% /tmp
swap 287M 16K 287M 1% /var/run
bash-3.00#
bash-3.00# exit
exit
# exit
bash-3.00#
bash-3.00#
bash-3.00#
bash-3.00# ifconfig -a
lo0:1: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index
1
inet 127.0.0.1 netmask ff000000
e1000g0:1: flags=201000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4,CoS> mtu 1500 index
2
inet 192.168.1.33 netmask ffffff00 broadcast 192.168.1.255
bash-3.00#