0% found this document useful (0 votes)
66 views

Zones

Solaris zones allow system administrators to partition a single Solaris operating system instance into multiple isolated virtual servers called zones. Each zone has its own isolated environment with its own processes, configuration, and administration. System resources like CPU, memory, and disk are allocated to each zone. The global zone manages system-wide services and resources and non-global zones are isolated environments that can only access resources allocated to them by the global zone. Common zone types include whole root zones that have their own file systems and sparse root zones that share file systems with the global zone. Zones have different states during their lifecycle like configured, installed, ready, running, and shutting down.

Uploaded by

vishavanath vk
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views

Zones

Solaris zones allow system administrators to partition a single Solaris operating system instance into multiple isolated virtual servers called zones. Each zone has its own isolated environment with its own processes, configuration, and administration. System resources like CPU, memory, and disk are allocated to each zone. The global zone manages system-wide services and resources and non-global zones are isolated environments that can only access resources allocated to them by the global zone. Common zone types include whole root zones that have their own file systems and sparse root zones that share file systems with the global zone. Zones have different states during their lifecycle like configured, installed, ready, running, and shutting down.

Uploaded by

vishavanath vk
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 20

Solaris Zones

====================

Q. Whats is solaris zones ?


Ans. Solaris zones enables software partitioning of solaris OS to support multiple
independent OS process space allocated resources and directory. Zones are idols for
environment that concolidate in a multiple numbers of application on a single
system.

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.

Non-global zones are three types.

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.

Types of zone states : There is a Seven states of 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.

Ready -->> The virtual platform has been stablish.

Running -->> The zone boot successfully and is now running.

Shutting -->> This is the state zone going down and transitional state that are
visible while the zone is being halt.

Configuration file of zone :


=============================

/etc/zones/zonename.xml

Q. How to hide and unhide the zones ?

Q. What is the diff between global and non global zone ?


Ans. Based on solaris OS by default present OS is called global zone.
Solaris OS which is hosted by global zone is called non global zones.

Q. Where zone current state stored ?


Ans. /etc/zone/index.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:
==========

bash-3.00# mkdir -p /zone/zone1


bash-3.00#
bash-3.00# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
bash-3.00#
bash-3.00#
bash-3.00# chmod 700 /zone/zone1
bash-3.00# zonecfg -z ravindra
ravindra: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:ravindra> create
zonecfg:ravindra> set zonepath = /zone/zone1
zonecfg:ravindra> set autoboot = true
zonecfg:ravindra> verify
zonecfg:ravindra> commitn
zonecfg:ravindra> exit
bash-3.00#
bash-3.00#
bash-3.00# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
- ravindra configured /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
bash-3.00#
bash-3.00# zoneadm -z ravindra install
Preparing to install zone <ravindra>.
Creating list of files to copy from the global zone.
Copying <9520> files to the zone.
Initializing zone product registry.
Determining zone package initialization order.
Preparing to initialize <1096> packages on the zone.
Initialized <1096> packages on zone.
Zone <ravindra> is initialized.
Installation of <2> packages was skipped.
The file </zone/zone1/root/var/sadm/system/logs/install_log> contains a log of the
zone installation.
bash-3.00#
bash-3.00# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
- ravindra installed /zone/zone1 native shared
bash-3.00#
bash-3.00# zoneadm -z ravindra ready
bash-3.00# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
1 ravindra ready /zone/zone1 native shared
bash-3.00#
bash-3.00# zoneadm -z ravindra boot
bash-3.00#
bash-3.00#
bash-3.00# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
1 ravindra running /zone/zone1 native shared
bash-3.00#
bash-3.00# zlogin -C ravindra
[Connected to zone 'ravindra' console]

You did not enter a selection.


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:.
q Host Name qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq

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 ravindra


qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
Esc-2_Continue Esc-6_Help
q Confirm Information qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq

> Confirm the following information. If it is correct, press F2;


to change any information, press F4.

Host name: ravindra

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].

Continents and Oceans


qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
- [ ] Africa
x [ ] Americas
x [ ] Antarctica
x [ ] Arctic Ocean
x [X] Asia
x [ ] Atlantic Ocean
x [ ] Australia
x [ ] Europe
v [ ] Indian Ocean
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
Esc-2_Continue Esc-6_Help
q Country or Region qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq

> To make a selection, use the arrow keys to highlight the option and
press Return to mark it [X].

Countries and Regions


qqqqqqqqqqqqqqqqqqqqqqqq
^ [ ] Georgia
x [ ] Hong Kong
x [X] India
x [ ] Indonesia
x [ ] Iran
x [ ] Iraq
x [ ] Israel
x [ ] Japan
x [ ] Jordan
x [ ] Kazakhstan
x [ ] Korea (North)
x [ ] Korea (South)
v [ ] Kuwait

qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
Esc-2_Continue Esc-6_Help
q Confirm Information qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq

> Confirm the following information. If it is correct, press F2;


to change any information, press F4.

Time zone: Asia/Calcutta

qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
Esc-2_Continue Esc-4_Change Esc-6_Help
q Root Password qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq

Please enter the root password for this system.

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

System identification is completed.

rebooting system due to change(s) in /etc/default/init

[NOTICE: Zone rebooting]

SunOS Release 5.10 Version Generic_139556-08 64-bit


Copyright 1983-2009 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
Hostname: ravindra
Reading ZFS config: done.

ravindra console login: Dec 28 11:04:45 ravindra sendmail[16492]: My unqualified


host name (localhost) unknown; sleeping for retry

ravindra console login: root


Password:
Dec 28 11:04:59 ravindra login: ROOT LOGIN /dev/console
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
#
#bash
#
# bash

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#

Now we have added file system under non global zone.


=======================================================

bash-3.00# zoneadm list -cv


ID NAME STATUS PATH BRAND IP
0 global running / native shared
2 ravindra running /zone/zone1 native shared
bash-3.00#
bash-3.00#
bash-3.00#
bash-3.00# uname -a
SunOS unix 5.10 Generic_139556-08 i86pc i386 i86pc
bash-3.00#
bash-3.00#
bash-3.00# zoneadm -z ravindra halt
bash-3.00# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
- ravindra installed /zone/zone1 native shared
bash-3.00#
bash-3.00# echo | format
Searching for disks...done

AVAILABLE DISK SELECTIONS:


0. c0d0 <DEFAULT cyl 10440 alt 2 hd 255 sec 63>
/pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0
1. c0d1 <DEFAULT cyl 10440 alt 2 hd 255 sec 63>
/pci@0,0/pci-ide@7,1/ide@0/cmdk@1,0
2. c2t0d0 <drive type unknown>
/pci@0,0/pci15ad,1976@10/sd@0,0
3. c2t1d0 <VMware,-VMwareVirtualS-1.0 cyl 1704 alt 2 hd 128 sec 48>
/pci@0,0/pci15ad,1976@10/sd@1,0
4. c2t2d0 <drive type unknown>
/pci@0,0/pci15ad,1976@10/sd@2,0
5. c2t3d0 <drive type unknown>
/pci@0,0/pci15ad,1976@10/sd@3,0
6. c2t4d0 <drive type unknown>
/pci@0,0/pci15ad,1976@10/sd@4,0
7. c2t5d0 <VMware,-VMwareVirtualS-1.0 cyl 1704 alt 2 hd 128 sec 48>
/pci@0,0/pci15ad,1976@10/sd@5,0
8. c2t6d0 <drive type unknown>
/pci@0,0/pci15ad,1976@10/sd@6,0
9. c2t8d0 <drive type unknown>
/pci@0,0/pci15ad,1976@10/sd@8,0
10. c2t9d0 <drive type unknown>
/pci@0,0/pci15ad,1976@10/sd@9,0
Specify disk (enter its number): Specify disk (enter its number):
bash-3.00#
bash-3.00# format -e c2t5d0
selecting c2t5d0
[disk formatted]

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:

a 100% "SOLARIS System" partition

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)

Part Tag Flag Cylinders Size Blocks


0 unassigned wm 0 0 (0/0/0) 0
1 unassigned wm 0 0 (0/0/0) 0
2 backup wu 0 - 2554 4.99GB (2555/0/0) 10465280
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0
8 boot wu 0 - 0 2.00MB (1/0/0) 4096
9 unassigned wm 0 0 (0/0/0) 0

partition> 0
Part Tag Flag Cylinders Size Blocks
0 unassigned wm 0 0 (0/0/0) 0

Enter partition id tag[unassigned]:


Enter partition permission flags[wm]:
Enter new starting cyl[0]: 1
Enter partition size[0b, 0c, 1e, 0.00mb, 0.00gb]: 500m
partition> l
[0] SMI Label
[1] EFI Label
Specify Label type[0]: 0
Ready to label disk, continue? y

partition> p
Current partition table (unnamed):
Total disk cylinders available: 2555 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks


0 unassigned wm 1 - 250 500.00MB (250/0/0) 1024000
1 unassigned wm 0 0 (0/0/0) 0
2 backup wu 0 - 2554 4.99GB (2555/0/0) 10465280
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0
8 boot wu 0 - 0 2.00MB (1/0/0) 4096
9 unassigned wm 0 0 (0/0/0) 0

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

[Connection to zone 'ravindra' pts/7 closed]


bash-3.00#
bash-3.00#
bash-3.00# uname -a
SunOS unix 5.10 Generic_139556-08 i86pc i386 i86pc
bash-3.00#

Q. How to hide and unhide the zone ?

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# zoneadm -z ravindra halt
bash-3.00#
bash-3.00# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
- ravindra installed /zone/zone1 native shared
bash-3.00#
bash-3.00#
bash-3.00# vi index
"index" 10 lines, 353 characters
B
B
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# ident "@(#)zones-index 1.2 04/04/01 SMI"
#
# DO NOT EDIT: this file is automatically generated by zoneadm(1M)
# and zonecfg(1M). Any manual changes will be lost.
#
global:installed:/
#ravindra:installed:/zone/zone1:8e8a0990-f76d-61fa-892b-c389007c5560
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
"index" 10 lines, 354 characters
bash-3.00#
bash-3.00#
bash-3.00#
bash-3.00# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
bash-3.00#
bash-3.00# pwd
/etc/zones
bash-3.00#
bash-3.00# vi index
"index" 10 lines, 354 characters
B
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# ident "@(#)zones-index 1.2 04/04/01 SMI"
#
# DO NOT EDIT: this file is automatically generated by zoneadm(1M)
# and zonecfg(1M). Any manual changes will be lost.
#
global:installed:/
ravindra:installed:/zone/zone1:8e8a0990-f76d-61fa-892b-c389007c5560
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
"index" 10 lines, 353 characters
bash-3.00#
bash-3.00#
bash-3.00#
bash-3.00# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
- ravindra installed /zone/zone1 native shared
bash-3.00#
bash-3.00# zoneadm -z ravindra boot
bash-3.00#
bash-3.00#
bash-3.00# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
4 ravindra running /zone/zone1 native shared
bash-3.00#

Q. How to add IP in non global zones ?


=========================================
=========================================

bash-3.00# zoneadm list -cv


ID NAME STATUS PATH BRAND IP
0 global running / native shared
4 ravindra running /zone/zone1 native shared
bash-3.00#
bash-3.00#
bash-3.00# zoneadm -z ravindra halt
bash-3.00#
bash-3.00#
bash-3.00# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
- ravindra installed /zone/zone1 native shared
bash-3.00#
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# zonecfg -z ravindra
zonecfg:ravindra> add net
zonecfg:ravindra:net> set physical = e1000g0
zonecfg:ravindra:net> set address = 192.168.1.33
zonecfg:ravindra:net> set defrouter = 192.168.1.1
zonecfg:ravindra:net> end
zonecfg:ravindra> verify
zonecfg:ravindra> commit
zonecfg:ravindra> exit
bash-3.00#
bash-3.00#
bash-3.00#
bash-3.00# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
- ravindra installed /zone/zone1 native shared
bash-3.00#
bash-3.00#
bash-3.00#
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: []
net:
address: 192.168.1.33
physical: e1000g0
defrouter: 192.168.1.1
bash-3.00#
bash-3.00#
bash-3.00# zoneadm -z ravindra boot
zoneadm: zone 'ravindra': WARNING: e1000g0:1: no matching subnet found in
netmasks(4) for 192.168.1.33; using default of 255.255.255.0.
bash-3.00#
bash-3.00#
bash-3.00# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
5 ravindra running /zone/zone1 native shared
bash-3.00#
bash-3.00#
bash-3.00#
bash-3.00# zlogin ravindra
[Connected to zone 'ravindra' pts/8]
Last login: Wed Dec 28 11:22:03 on pts/7
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
# bash
bash-3.00#
bash-3.00#
bash-3.00# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
5 ravindra running / native shared
bash-3.00#
bash-3.00#
bash-3.00# Dec 28 12:28:32 ravindra sendmail[19078]: [ID 702911 mail.alert] unable
to qualify my own domain name (localhost) -- using short name
Dec 28 12:28:32 ravindra sendmail[19095]: [ID 702911 mail.alert] unable to qualify
my own domain name (localhost) -- using short name

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#

How to clone a zone ?


=======================
========================

bash-3.00# zoneadm -z ravindra halt


bash-3.00#
bash-3.00#
bash-3.00# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
- ravindra installed /zone/zone1 native shared
bash-3.00#
bash-3.00#
bash-3.00# zonecfg -z ravindra export -f /zone/zone2
bash-3.00#
bash-3.00#
bash-3.00# zonecfg -z ravindra_clone -f /zone/zone2
bash-3.00#
bash-3.00#
bash-3.00# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
- ravindra installed /zone/zone1 native shared
- ravindra_clone configured /zone/zone1 native shared
bash-3.00#
bash-3.00#
bash-3.00#
bash-3.00# mkdir -p /zone/zone3
bash-3.00#
bash-3.00# chmod 700 /zone/zone3
bash-3.00# zonecfg -z ravindra_clone
zonecfg:ravindra_clone> set zonepath = /zone/zone3
zonecfg:ravindra_clone> verify
zonecfg:ravindra_clone> commit
zonecfg:ravindra_clone> exit
bash-3.00#
bash-3.00#
bash-3.00# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
- ravindra installed /zone/zone1 native shared
- ravindra_clone configured /zone/zone3 native shared
bash-3.00#
bash-3.00#
bash-3.00# zoneadm -z ravindra_clone clone ravindra
WARNING: ufs file-system on '/dev/dsk/c2t5d0s0' is configured in both zones.
WARNING: network address '192.168.1.33' is configured in both zones.
Copying /zone/zone1...
grep: can't open /a/etc/dumpadm.conf
bash-3.00#
bash-3.00#
bash-3.00# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
- ravindra installed /zone/zone1 native shared
- ravindra_clone installed /zone/zone3 native shared
bash-3.00#
bash-3.00#
bash-3.00#
bash-3.00#
bash-3.00# zoneadm -z ravindra_clone boot
zoneadm: zone 'ravindra_clone': WARNING: e1000g0:1: no matching subnet found in
netmasks(4) for 192.168.1.33; using default of 255.255.255.0.
bash-3.00#
bash-3.00#
bash-3.00# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
7 ravindra_clone running /zone/zone3 native shared
- ravindra installed /zone/zone1 native shared
bash-3.00#
bash-3.00#
bash-3.00# zlogin ravindra_clone
[Connected to zone 'ravindra_clone' pts/5]
Last login: Wed Dec 28 12:28:08 on pts/8
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
#
# bash
bash-3.00#
bash-3.00#
bash-3.00# df -h
Filesystem size used avail capacity Mounted on
/ 19G 5.8G 13G 31% /
/dev 19G 5.8G 13G 31% /dev
/lib 19G 5.8G 13G 31% /lib
/platform 19G 5.8G 13G 31% /platform
/sbin 19G 5.8G 13G 31% /sbin
/shivam 470M 1.0M 422M 1% /shivam
/usr 19G 5.8G 13G 31% /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 374M 224K 373M 1% /etc/svc/volatile
/usr/lib/libc/libc_hwcap2.so.1
19G 5.8G 13G 31% /lib/libc.so.1
fd 0K 0K 0K 0% /dev/fd
swap 373M 4K 373M 1% /tmp
swap 373M 0K 373M 0% /var/run
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#
bash-3.00#
bash-3.00#
bash-3.00# exit
exit
# exit

[Connection to zone 'ravindra_clone' pts/5 closed]


bash-3.00#
bash-3.00# bash
bash-3.00#
bash-3.00#
bash-3.00# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
7 ravindra_clone running /zone/zone3 native shared
- ravindra installed /zone/zone1 native shared
bash-3.00#
bash-3.00#
bash-3.00#
bash-3.00# zoneadm -z ravindra boot
zoneadm: zone 'ravindra': fsck of '/dev/rdsk/c2t5d0s0' failed with exit status 33;
run fsck manually
zoneadm: zone 'ravindra': call to zoneadmd failed
bash-3.00#
bash-3.00#
bash-3.00# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
7 ravindra_clone running /zone/zone3 native shared
- ravindra installed /zone/zone1 native shared
bash-3.00#
bash-3.00#
bash-3.00# zoneadm -z ravindra_clone halt
bash-3.00#
bash-3.00# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
- ravindra installed /zone/zone1 native shared
- ravindra_clone installed /zone/zone3 native shared
bash-3.00#
bash-3.00#
bash-3.00# zoneadm -z ravindra boot
zoneadm: zone 'ravindra': WARNING: e1000g0:1: no matching subnet found in
netmasks(4) for 192.168.1.33; using default of 255.255.255.0.
bash-3.00#
bash-3.00#
bash-3.00# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
9 ravindra running /zone/zone1 native shared
- ravindra_clone installed /zone/zone3 native shared
bash-3.00#
bash-3.00#
bash-3.00# zlogin ravindra
[Connected to zone 'ravindra' pts/5]
Last login: Wed Dec 28 12:28:08 on pts/8
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
# bash
bash-3.00#
bash-3.00#
bash-3.00# df -h
Filesystem size used avail capacity Mounted on
/ 19G 5.8G 13G 31% /
/dev 19G 5.8G 13G 31% /dev
/lib 19G 5.8G 13G 31% /lib
/platform 19G 5.8G 13G 31% /platform
/sbin 19G 5.8G 13G 31% /sbin
/shivam 470M 1.0M 422M 1% /shivam
/usr 19G 5.8G 13G 31% /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 275M 308K 275M 1% /etc/svc/volatile
/usr/lib/libc/libc_hwcap2.so.1
19G 5.8G 13G 31% /lib/libc.so.1
fd 0K 0K 0K 0% /dev/fd
swap 275M 36K 275M 1% /tmp
swap 275M 12K 275M 1% /var/run
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#
bash-3.00#
bash-3.00# exit
exit
# exit

[Connection to zone 'ravindra' pts/5 closed]


bash-3.00#
bash-3.00#

You might also like