Tuesday, November 18, 2008

Solaris™ 10 Zones

A sneak preview into a feature of the block buster Operating System of Sun Microsystems Inc.
Solaris™ 10 Zones
Document Stage Name Date
Created R Rajesh 11/December/2005
Updated
Approved Gary Riseborough 23/December/2005
Delivered
Change Log
The following is a script that was run on Solaris™ 10 Operating System to
create a zone by name apple-store. The exercise mentioned in this document
was conducted during the Sun courses on New Features of Solaris™ 10
Operating System delivered by Mr. Gary Riseborough (Employee of Sun
Microsystems Inc., Sydney, Australia). Author of this journal has included the
errors that were encountered, during the zone creation process, as well. Some
part of the output are omitted/modified for brevity. This is a simple zone
creation process. For insight into the complex zone creation process, please
visit the following web-location:
http://www.brendangregg.com/zones.html
[Brendan Gregg is an Instructor for Sun in Australia]
Author: R Rajesh 1
Caution: Due care has been taken to make this
document error-free. But the fact that the
contents of this document is copied from a text
file produced as a result of the “script -a”
command run on a Solaris box and that several
modifications had to be done on the same for
proper presentation makes it a candidate for
potential typographical errors. Kindly report the
errors spotted to the author at info@rajeshr.net
A sneak preview into a feature of the block buster Operating System of Sun Microsystems Inc.
Script started on Mon Nov 07 19:02:16 2005
# df -k
Filesystem kbytes used avail capacity Mounted on
/dev/dsk/c0t0d0s0 5063150 3096633 1915886 62% /
/devices 0 0 0 0% /devices
ctfs 0 0 0 0% /
system/contract
proc 0 0 0 0% /proc
mnttab 0 0 0 0% /etc/mnttab
swap 703864 968 702896 1% /etc/svc/volatile
objfs 0 0 0 0% /system/object
fd 0 0 0 0% /dev/fd
swap 702944 48 702896 1% /tmp
swap 702944 48 702896 1% /var/run
/dev/dsk/c0t0d0s7 14027418 13937 13873207 1% /export/home
# mkdir /export/home/zones
# zonecfg -z apple-store
apple-store: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:apple-store> create
zonecfg:apple-store> set autoboot=true
zonecfg:apple-store> set zonepath=/export/home/zones/apple-store
zonecfg:apple-store> add net
zonecfg:apple-store:net> #### You need to set 2 variables for this:
zonecfg:apple-store:net> set physical=hme0
zonecfg:apple-store:net> set address=192.168.1.45.216
zonecfg:apple-store:net> end
zonecfg:apple-store> ### All this what have dones is in the memory
zonecfg:apple-store> verify
zonecfg:apple-store> commit
zonecfg:apple-store> exit
# #### Zone creation completed
# cd /etc/zones
# ls
SUNWblank.xml SUNWdefault.xml apple-store.xml index
# #### The file "apple-store.xml" is a newly created file
# more apple-store.xml

"file:///usr/shar
e/lib/xml/dtd/zonecfg.dtd.1">

autoboot="tru
e">



Author: R Rajesh 2
A sneak preview into a feature of the block buster Operating System of Sun Microsystems Inc.



# ### lib, platform, sbin, usr are the directories that are shared
# ifconfig -a
lo0: flags=2001000849 mtu
8232 index 1
inet 127.0.0.1 netmask ff000000
hme0: flags=1000843 mtu 1500
index 2
inet 192.168.1.216 netmask ffffff00 broadcast 192.168.1.255
ether 0:3:ba:10:2d:a7
# zoneadm -z apple-store install
could not verify net address=192.168.1.45.216 physical=hme0: Neither
an IPv4 nor an IPv6 address nor a host name
zoneadm: zone apple-store failed to verify
# ls
SUNWblank.xml SUNWdefault.xml apple-store.xml index
# vi apple-store.xml

"file:///usr/shar
e/lib/xml/dtd/zonecfg.dtd.1">

autoboot="true">






"apple-store.xml" 12 lines, 525 characters#
wq!"apple-store.xml" 12 lines, 523 characters
## zoneadm -z t apple-store install
Preparing to install zone .
Creating list of files to copy from the global zone.
Copying <2578> files to the zone.
Initializing zone product registry.
Determining zone package initialization order.
Preparing to initialize <914> packages on the zone.
Initializing package <0> of <914>: percent complete: 0%
Initializing package <1> of <914>: percent complete: 0%
Initializing package <2> of <914>: percent complete: 0%
Initializing package <3> of <914>: percent complete: 0%
Initializing package <4> of <914>: percent complete: 0%
Initializing package <5> of <914>: percent complete: 0%
Initializing package <6> of <914>: percent complete: 0%
Initializing package <7> of <914>: percent complete: 0%
Initializing package <8> of <914>: percent complete: 0%
Author: R Rajesh 3
A sneak preview into a feature of the block buster Operating System of Sun Microsystems Inc.
Initializing package <9> of <914>: percent complete: 0%
Initializing package <10> of <914>: percent complete: 1%
<------------------ Output Truncated for Brevity------------->
Initializing package <912> of <914>: percent complete: 99%
Initializing package <913> of <914>: percent complete: 99%
Initialized <914> packages on zone.
Zone is initialized.
The file root/var/sadm/system/logs/install_log> contains a log of the
zone installation.
# #### I had made a mistake while creating zones (IP address that I
gave was invalid). I edited the file, the one that is found in the /
etc/zones and changed the IP address and it worked fine.
# ifconfig -a
lo0: flags=2001000849 mtu
8232 index 1
inet 127.0.0.1 netmask ff000000
hme0: flags=1000803 mtu 1500 index 2
inet 192.168.1.216 netmask ffffff00 broadcast 192.168.1.255
ether 0:3:ba:10:2d:a7
# cd /export/home
# ls
lost+found zones
# cd zones
# ls
apple-store
# cd apple-store
# ls
root
# cd root
# ls
bin etc home mnt platform sbin tmp
var
dev export lib opt proc system usr
# zoneadm -list -cv
ID NAME STATUS PATH
0 global running /
- apple-store installed /export/home/zones/apple-store
# zoneadm -z apple-store boot
zoneadm: zone 'apple-store': "/usr/lib/fs/lofs/mount -o
ro,nosub,nodevices /sbin /export/home/zones/apple-store/root/sbin"
failed with exit code 33
zoneadm: zone 'apple-store': failed to loopback mount /sbin: Error 0
zoneadm: zone 'apple-store': call to zoneadmd failed
# zoneadm -z apple-store boot
zoneadm: zone 'apple-store': "/usr/lib/fs/lofs/mount -o
ro,nosub,nodevices /sbin /export/home/zones/apple-store/root/sbin"
failed with exit code 33
zoneadm: zone 'apple-store': failed to loopback mount /sbin: Error 0
zoneadm: zone 'apple-store': call to zoneadmd failed
#
### The booting process was failing on zone apple-store
Author: R Rajesh 4
A sneak preview into a feature of the block buster Operating System of Sun Microsystems Inc.
### Under the instruction from Gary I uninstalled it
#
# zoneadm -z apple-store uninstall
Are you sure you want to uninstall zone apple-store (y/[n])? y
#
### Reinstalling the zone
#
# zoneadm -z apple-store install
Preparing to install zone .
Creating list of files to copy from the global zone.
Copying <2578> files to the zone.
Initializing zone product registry.
Determining zone package initialization order.
Preparing to initialize <914> packages on the zone.
Initializing package <0> of <914>: percent complete: 0%
Initializing package <1> of <914>: percent complete: 0%
Initializing package <2> of <914>: percent complete: 0%
Initializing package <3> of <914>: percent complete: 0%
Initializing package <4> of <914>: percent complete: 0%
Initializing package <5> of <914>: percent complete: 0%
Initializing package <6> of <914>: percent complete: 0%
Initializing package <7> of <914>: percent complete: 0%
Initializing package <8> of <914>: percent complete: 0%
Initializing package <9> of <914>: percent complete: 0%
Initializing package <10> of <914>: percent complete: 1%
Initializing package <11> of <914>: percent complete: 1%
Initializing package <12> of <914>: percent complete: 1%
Initializing package <13> of <914>: percent complete: 1%
Initializing package <14> of <914>: percent complete: 1%
Initializing package <15> of <914>: percent complete: 1%
Initializing package <16> of <914>: percent complete: 1%
Initializing package <17> of <914>: percent complete: 1%
Initializing package <18> of <914>: percent complete: 1%
Initializing package <19> of <914>: percent complete: 2%
Initializing package <20> of <914>: percent complete: 2%
Initializing package <21> of <914>: percent complete: 2%
Initializing package <22> of <914>: percent complete: 2%
Initializing package <23> of <914>: percent complete: 2%
Initializing package <24> of <914>: percent complete: 2%
Initializing package <25> of <914>: percent complete: 2%
<---------------- Output omitted for Brevity ---------------->
Initializing package <913> of <914>: percent complete: 99%
Initialized <914> packages on zone.
Zone is initialized.
The file root/var/sadm/system/logs/install_log> contains a log of the
zone installation.
# zoneadm -z apple-store boot
zoneadm: zone 'apple-store': WARNING: hme0:1: no matching subnet
found in netmasks(4) for 192.168.45.216; using default of
255.255.255.0.
#
Author: R Rajesh 5
A sneak preview into a feature of the block buster Operating System of Sun Microsystems Inc.
#
#
#
#
#
#
# ####zone creation over successuflly. There was some error
initially. Under the advice from Gary I uninstalled and re-installed
the zones.
#
#
# exit
script done on Tue Nov 08 13:12:57 2005
Author: R Rajesh 6

No comments: