Solaris 10 Zone

Zone is a virtual operating system environment created within a single instance of the Solaris operating system.
Zone allow virtual environments to run on the same physical system. If you are familliar with VMWare or SUN xVM Virtual box then you know the concept.

1. login to a terminal as root

root@ultra60 #

2. check the current status of the zones using zoneadm command

root@ultra60 # zoneadm list -v
ID NAME STATUS PATH BRAND IP
0 global running / native shared

As you can see, the box has non-global zone installed

3. I'll create a non-global zone called zone1

root@ultra60 # zonecfg -z zone1

zone1: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:zone1> create
zonecfg:zone1> set zonepath=/export/zone/1
zonecfg:zone1> set autoboot=true
zonecfg:zone1> add net
zonecfg:zone1:net> set address=192.168.1.179
zonecfg:zone1:net> set physical qfe0
zonecfg:zone1:net> end
zonecfg:zone1>
zonecfg:zone1> verify
zonecfg:zone1> commit
zonecfg:zone1> exit


4. After the 'exit' step, the zone1 zone is now in 'configured' state.

root@ultra60 # zoneadm list -vc
ID NAME STATUS PATH BRAND IP
0 global running / native shared
- zone1 configured /export/zone/1 native shared


5. You can see the information about the zone

root@ultra60 # zonecfg -z zone1 info
zonename: zone1
zonepath: /export/zone/1
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
net:
address: 192.168.1.179
physical: hme1
defrouter not specified


6. The next step is to install the zone.

root@ultra60 # zoneadm -z zone1 install
Preparing to install zone .
Creating list of files to copy from the global zone.
Copying <7753> files to the zone.
Initializing zone product registry.
Determining zone package initialization order.
Preparing to initialize <1189> packages on the zone.
Initializing package <0> of <1189>: percent complete: 0%
Initializing package <1> of <1189>: percent complete: 0%
Initializing package <2> of <1189>: percent complete: 0%
Initializing package <3> of <1189>: percent complete: 0%
.
.
.
Initializing package <1187> of <1189>: percent complete: 99%
Initializing package <1188> of <1189>: percent complete: 99%
Initialized <1189> packages on zone.
Zone is initialized.
Installation of <2> packages was skipped.
Installation of these packages generated warnings:
The file contains a log of the zone installation.


7. Check the status

root@ultra60 # zoneadm list -vc
ID NAME STATUS PATH BRAND IP
0 global running / native shared
- zone1 installed /export/zone/1 native shared

8. Boot the zone

root@ultra60 # zoneadm -z zone1 boot

9. Login into the zone

root@ultra60 # zlogin -C zone1

10. Since this is the first time that this zone is being booted up, some initial configurations needs to be performed

------------------------------------------Begin------------------------------------------------

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: qfe0.

Host Name for qfe0:1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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 qfe0:1 zone
F2_Continue F6_zone
Confirm Information for qfe0:1


... and so on...
------------------------------------------End----------------------------------------------------

11. After the reboot, the root prompt will appear and ready for login

[NOTICE: Zone rebooting]
SunOS Release 5.10 Version Generic_137137-09 64-bit
Copyright 1983-2008 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
Hostname: zone1
Reading ZFS config: done.


zone1 console login: root
Password:
Jun 11 12:42:41 zone login: ROOT LOGIN /dev/console

Sun Microsystems Inc. SunOS 5.10 Generic January 2005
#


12. Close the session using 'tilde' then 'dot'

zone1 console login: ~.

[Connection to zone 'zone1' console closed]

13. To shutdown the zone, issue the command (assuming from global zone):

root@ultra60# zlogin zone1 shutdown -y -i0 -g0

root@ultra60# zlogin -C zone1

[Connected to zone 'zone1' console]

svc.startd: The system is coming down. Please wait.

svc.startd: 58 system services are now being stopped.

Jun 11 12:58:58 zone1-zone syslogd: going down on signal 15

svc.startd: The system is down.

[NOTICE: Zone halted]


2 comments:

  1. Its nice Info and good blog,
    Thaks and visit back me,..
    Good Luck..!

    ReplyDelete
  2. Thank you...
    Have been visiting your blog as well..

    -cheers-

    ReplyDelete