From Wikipedia, Solaris Containers (including Solaris Zones) is an implementation of operating system-level virtualization technology first made available in 2005 as part of Solaris 10.
A Solaris Container is the combination of system resource controls and the boundary separation provided by zones. Zones act as completely isolated virtual servers within a single operating system instance. By consolidating multiple sets of application services onto one system and by placing each into isolated virtual server containers, system administrators can reduce cost and provide all the same protections of separate machines on a single machine.
Zones provide a new isolation primitive for the Solaris OS, which is secure, flexible, scalable and lightweight: virtualized OS services which look like different Solaris instances. Together with the existing Solaris Resource management framework, Solaris Zones forms the basis of Solaris Containers.
Watch this Science Notes for Solaris 10 Containers:
Solaris 8 containers on top of Solaris 10 host.
Here the Solaris Zone creation example:
—————————————————-
bash-3.00# mkdir -m 700 /zones/zone1
bash-3.00# zonecfg -z zone1
zone1: No such zone configured
Use ‘create’ to begin configuring a new zone.
zonecfg:zone1> create
zonecfg:zone1> set zonepath=/zones/zone1
zonecfg:zone1> set autoboot=true
zonecfg:zone1> add inherit-pkg-dir
zonecfg:zone1:inherit-pkg-dir> set dir=/opt
zonecfg:zone1:inherit-pkg-dir> end
zonecfg:zone1> add net
zonecfg:zone1:net> set address=10.32.16.10/24
zonecfg:zone1:net> set physical=e1000g0
zonecfg:zone1:net> set defrouter=10.32.16.1
zonecfg:zone1:net> end
zonecfg:zone1> add attr
zonecfg:zone1:attr> set name=comment
zonecfg:zone1:attr> set type=string
zonecfg:zone1:attr> set value=”first zone”
zonecfg:zone1:attr> end
zonecfg:zone1> verify
zonecfg:zone1> commit
zonecfg:zone1> exit
————————
bash-3.00# zonecfg -z zone1 info
zonename: zone1
zonepath: /zones/zone1
brand: native
autoboot: true
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
inherit-pkg-dir:
dir: /opt
net:
address: 10.32.16.10
physical: e1000g0
defrouter: 10.32.16.1
attr:
name: comment
type: string
value: “first zone”
bash-3.00#
—————————-
bash-3.00# zoneadm -z zone1 install
/zones/zone1 must not be group readable.
/zones/zone1 must not be group executable.
/zones/zone1 must not be world readable.
/zones/zone1 must not be world executable.
could not verify zonepath /zones/zone1 because of the above errors.
zoneadm: zone zone1 failed to verify
{if you got an error like above, please make sure directory mode of your zone:
bash-3.00# ls -ld /zones/zone1/
drwxr-xr-x 2 root root 512 Aug 8 22:31 /zones/zone1/
bash-3.00# chmod 700 /zones/zone1
bash-3.00# ls -ld /zones/zone1/
drwx—— 2 root root 512 Aug 8 22:31 /zones/zone1/
bash-3.00#
{Run again the ‘zone install’ command.
bash-3.00# zoneadm -z zone1 install
Preparing to install zone <zone1>.
Creating list of files to copy from the global zone.
Copying <2901> files to the zone.
Initializing zone product registry.
Determining zone package initialization order.
Preparing to initialize <1122> packages on the zone.
Initialized <1122> packages on zone.
Zone <zone1> is initialized.
Installation of these packages generated errors: <SUNWpostgr-82-libs SUNWpostgr-82-client SUNWpostgr-82-server-data-root SUNWpostgr-82-server SUNWpostgr-82-contrib SUNWpostgr-82-devel SUNWpostgr-83-server-data-root>
The file </zones/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
- zone1 installed /zones/zone1 native shared
bash-3.00#
bash-3.00# zoneadm -z zone1 boot
bash-3.00# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
1 zone1 running /zones/zone1 native shared
bash-3.00#
bash-3.00# zlogin -C zone1
[Connected to zone 'zone1' console]
{then press ENTER
{follow on screen instruction untill System identification is completed.
————————————————
Select a Locale
0. English (C – 7-bit ASCII)
1. U.S.A. (UTF-8)
2. Go Back to Previous Screen
Please make a choice (0 – 2), or press h or ? for help: 1
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
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:.
—Host Name——————————————————————
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 zone1
F2_Continue F4_Change F6_Help
–Confirm Information———————————————————
> Confirm the following information. If it is correct, press F2;
to change any information, press F4.
Host name: zone1
–Time Zone ——————————————————————-
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
————————————-
- [ ] Africa
x [ ] Americas
x [ ] Antarctica
x [ ] Arctic Ocean
x [X] Asia
x [ ] Atlantic Ocean
x [ ] Australia
x [ ] Europe
v [ ] Indian Ocean
——————————————————————————
F2_Continue F6_Help
–Country or Region———————————————————–
> To make a selection, use the arrow keys to highlight the option and
press Return to mark it [X].
Countries and Regions
————————
^ [ ] Cambodia
x [ ] China
x [ ] Cyprus
x [ ] East Timor
x [ ] Georgia
x [ ] Hong Kong
x [ ] India
x [X] Indonesia
x [ ] Iran
x [ ] Iraq
x [ ] Israel
x [ ] Japan
v [ ] Jordan
——————————————————————————-
F2_Continue F6_Help
[NOTICE: Zone rebooting]
————————————————
SunOS Release 5.10 Version Generic_139556-08 32-bit
Copyright 1983-2009 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
Hostname: zone1
Reading ZFS config: done.
rebooting system due to change(s) in /etc/default/init
zone1 console login: root
Password:
—————————————————
OTHER USEFUL COMMAND:
# zoneadm -z zone1 halt
# zoneadm -z zone1 boot
remove net address=10.32.16.10/24 >>will delete ip address & network physical
SOURCE:
http://dlc.sun.com/pdf//817-1592/817-1592.pdf >>system admin guide – Solaris Containers
http://dlc.sun.com/pdf/817-7551/817-7551.pdf >>Installing and Administering Solaris Container Manager 1.1













No Comments Yet