Zones
Zones
Zones
Enter zone configuration from the global zone using the below mentioned
commands.
After you have made the above changes, boot the zone from the global zone using
the below commands.
Done!
There is another way to rename a zone (not supported, but it worked for me), but
then that's not the right one though. However, i would mention that as well.
globalzone# cd /etc/zones
globalzone# mv orazone.xml oraprodzone.xml
globalzone# vi oraprodzone.xml
globalzone# cd /zones
-/zones is where I have stored all the zones
T h u r s d a y, J u l y 1 0 , 2 0 0 8
Hi Folks, I have successfully managed to installed and run Oracle 9i on this Solaris
9 Container that i just installed using Solaris Zones. I followed the standard install
process and i didnt encounter anything unusual. The system maintains its own
/etc/system file, all i did was added the below mentioned parameters in it,
rebooted the zone and installed Oracle 9i on it. However i just created a sample
database by the name of vishal on the system. I will work on this more and will
post some feedback and how-to's here.
Info -
/etc/system -
set shmsys:shminfo_shmmax=4294967295
set shmsys:shminfo_shmmin=1
set shmsys:shminfo_shmmni=100
set shmsys:shminfo_shmseg=10
set semsys:seminfo_semmni=100
set semsys:seminfo_semmsl=410
set semsys:seminfo_semmns=1410
set semsys:seminfo_semopm=100
set semsys:seminfo_semvmx=32767
solaris9-zone # uname -a
SunOS solaris9 5.9 Generic_Virtual sun4u sparc SUNW,Sun-Fire-280R
S u n d a y, J u n e 2 2 , 2 0 0 8
MY HARDWARE -
Sun Fire 280R (2 x Ultra SPARC III+ at 1200MHz, 6GB RAM, 2 x 80GB HDD)
5 network interfaces - eri0, ce0, ce1, ce2, ce3
though i used only eri0 and ce0. Remaining, i will use later as and when the need
arises.
MY SOFTWARE -
Solaris 9.0 Container Application - (downloaded from sun.com this file named -
s9containers-1_0-rr-solaris10-sparc.tar.gz)
Solaris 9.0 OS Image file - (downloaded from sun.com this file named - solaris9-
image.flar)
MY OBJECTIVE -
STEPS I FOLLOWED -
Installed Solaris 10 update 5 on my Sun Fire 280R. Chose Entire Distribution and
allocated my second 80GB HDD only for storing Zone data. So i formatted and
mounted /zones on my second hard disk c1t1d0s2. I dedicated my first disk
(c1t0d0) to run Solaris 10 exclusively. Installation was successful without a hitch.
Below is my install configuration -
hostname - sol10
ip address - 10.10.8.46/24 (on eri0 interface)
plumbed my ce0 interface so that i can dedicate this to my solaris 9 zone that i
would be creating in the next step.
(select all and accept all the default parameters. the installation was successful.)
After the system booted, i followed the below commands to create a branded
solaris 9 zone.
Patchadd is terminating.
[Mon Jun 23 12:14:33 SGT 2008] Postprocess: Applying p2v module S31_fix_net
[Mon Jun 23 12:14:33 SGT 2008] Postprocess: Applying p2v module S32_fix_nfs
[Mon Jun 23 12:14:34 SGT 2008] Postprocess: Applying p2v module S33_fix_vfstab
[Mon Jun 23 12:14:34 SGT 2008] Postprocess: Applying p2v module S34_fix_inittab
[Mon Jun 23 12:14:34 SGT 2008] Postprocess: Applying p2v module
S35_fix_crontab
[Mon Jun 23 12:14:34 SGT 2008] Postprocess: Applying p2v module
S36_fix_pam_conf
[Mon Jun 23 12:14:34 SGT 2008] Postprocess: Applying p2v module
S40_setup_preload
[Mon Jun 23 12:14:35 SGT 2008] Postprocess: Performing zone sys-unconfig
[Mon Jun 23 12:15:00 SGT 2008] Postprocess: Postprocessing successful.
[Mon Jun 23 12:15:00 SGT 2008] Result: Postprocessing complete.
[Mon Jun 23 12:15:01 SGT 2008] Service Tag: Gathering information about zone
solaris9
[Mon Jun 23 12:15:01 SGT 2008] Service Tag: Adding service tag: urn:st:f703f244-
18f1-cf25-a9db-fdd4ea20ffe6
Solaris 9 Containers 1.0 added
Product instance URN=urn:st:f703f244-18f1-cf25-a9db-fdd4ea20ffe6
[Mon Jun 23 12:15:01 SGT 2008] Service Tag: Operation successful.
[Mon Jun 23 12:15:01 SGT 2008]
[Mon Jun 23 12:15:01 SGT 2008] Result: Installation completed successfully.
[Mon Jun 23 12:15:01 SGT 2008] Log File:
/zones/solaris9/root/var/log/solaris9.install.846.log
globalzone #
After this you will be asked to set up your hostname, IP Address, TimeZone
Settings, Naming Configuration etc. After successfully completing this, the zone
would reboot. After the system has rebooted, you are all set to go.
After all this, i was able to connect to my Solaris 9 container that i just created
using SSH. Just to test out, i performed the following commands -
solaris9-zone # uname -a
SunOS solaris9 5.9 Generic_Virtual sun4u sparc SUNW,Sun-Fire-280R
solaris9-zone # psrinfo
0 on-line since 06/23/2008 11:52:30
1 on-line since 06/23/2008 11:52:31
solaris9-zone #
I hope the above would be useful to you guys. Do feel free to comment, if you
happen to have any questions.
S a t u r d a y, J u n e 2 1 , 2 0 0 8
W e d n e s d a y, J u n e 1 8 , 2 0 0 8
I would presume here that the zone is already created and i would detail out the
process to change an "existing" zone's network parameters.
Please Note - The network parameters can be changed without halting the zone.
But the changes would only take affect after the zone is rebooted. So be careful
with this part. Before you can use any network interface on a local zone, that
interface must be plumbed first (e.g. ifconfig plumb, on the global zone) in the
global zone. If no network address is assigned on the global zone to that interface,
its default address will be set to inet 0.0.0.0 netmask 0.
FROM -
Interface - ce0
IP Address - 10.10.10.8/24
TO -
Interface - ce1
IP Address - 10.10.10.11/24
STEP 1 - Use zoneadm list on the global zone to show status of zones on your
system.
On the global zone, use the zoneadm list -cv to show current status of all installed
zones.
In the illustration below, i have two zones installed, one being ora9 and another
being ora8
Note: You may also use zoneadm -z list -v to verify the specific zone status.
On the global zone, use the zonecfg -z to enter the zone configuration
environment. The enviromental prompt "zonecfg:" will display.
Use info in the zone configuration environment to verify the network values.
STEP 3 - Use set address= and set physical= to change the network address and
physical interface.
Use set address= and set physical= in the zone configuration environment .
The zone does not require a reboot for this parameter to take place as the zone
will use the new value if it is halted.
Note:
* If you set the autoboot resource property in a zone’s configuration to true, that
zone is automatically booted when the global zone is booted. The default setting is
false.
* for the zones to autoboot, the zones service svc:/system/zones:default must also
be enabled.
STEP 4 - Use remove net address= to remove the old network values.
Use exit in the environment to save the changes and leave the zone configuration
environment.
zonecfg:ora9> info
zonepath: /zone/ora9
autoboot: true
pool:
inherit-pkg-dir:
dir: /lib
inherit-pkg-dir:
dir: /platform
inherit-pkg-dir:
dir: /sbin
inherit-pkg-dir:
dir: /usr
net:
address: 10.10.10.8/24
physical: ce0
net:
address: 10.10.10.11/24
physical: ce1
zonecfg:ora9> remove net address=10.10.10.8/24
zonecfg:ora9> info
zonepath: /zone/ora9
autoboot: true
pool:
inherit-pkg-dir:
dir: /lib
inherit-pkg-dir:
dir: /platform
inherit-pkg-dir:
dir: /sbin
inherit-pkg-dir:
dir: /usr
net:
address: 10.10.10.11/24
physical: ce1
zonecfg:ora9> commit
zonecfg:ora9>
Note:
STEP 5 - Use commit and exit to save the changes to the parameter
Use commit and exit in the environment to save the changes and leave the zone
configuration environment.
zonecfg:ora9> verify
zonecfg:ora9> commit
zonecfg:ora9> exit
globalzone#
The new network parameters will not come into force until the zone is booted. Use
zoneadm -z halt to halt the zone. Then use zoneadm -z boot to start the zone with
the new network parameters.
globalzone# ifconfig -a
lo0: flags=2001000849 mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
lo0:1: flags=2001000849 mtu 8232 index 1
zone ora9
inet 127.0.0.1 netmask ff000000
ce0: flags=1000843 mtu 1500 index 2
inet 10.10.10.14 netmask ffffff00 broadcast 10.10.10.255
ether [removed]
ce0:1: flags=1000843 mtu 1500 index 2
zone ora9
inet 10.10.10.8 netmask ffffff00 broadcast 10.10.10.255
ce1: flags=1000843 mtu 1500 index 3
inet 10.10.10.15 netmask ffffff00 broadcast 10.10.10.255
ether [removed]
globalzone# ifconfig -a
lo0: flags=2001000849 mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
ce0: flags=1000843 mtu 1500 index 2
inet 10.10.10.14 netmask ffffff00 broadcast 10.10.10.255
ether [removed]
ce1: flags=1000843 mtu 1500 index 3
inet 10.10.10.15 netmask ffffff00 broadcast 10.10.10.255
ether [removed]
globalzone# ifconfig -a
lo0: flags=2001000849 mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
lo0:1: flags=2001000849 mtu 8232 index 1
zone ora9
inet 127.0.0.1 netmask ff000000
ce0: flags=1000843 mtu 1500 index 2
inet 10.10.10.14 netmask ffffff00 broadcast 10.10.10.255
ether [removed]
ce1: flags=1000843 mtu 1500 index 3
inet 10.10.10.15 netmask ffffff00 broadcast 10.10.10.255
ether [removed]
ce1:1: flags=1000843 mtu 1500 index 3
zone ora9
inet 10.10.10.11 netmask ffffff00 broadcast 10.10.10.255
globalzone#
Tu e s d a y, M a y 2 0 , 2 0 0 8
Solaris 10 has this excellent new feature called Zones. I was looking forward to this
feature since a long time. I guess Sun was pretty late in implementing this
technology on Solaris Platform. Earlier on i had worked with BSD Jails. However its
implementation was a lil tricky. But in Solaris its all the more easier and involves
fewer steps to quickly make it up and running. Below are some notes that i have
compiled. It should give you a fair understanding of Solaris Zones.
Features:
1. Its Virtualization - i.e. VMWare, BSD Jails
2. As of now, they can host only instances of Solaris. Not other OSs.
3. Limit of 8192 zones per Solaris system
4. Primary zone (also called global zone) has access to ALL zones
5. Non-global zones, do NOT have access to other non-global zones
6. Default non-global zones derive packages from global zone
7. Program isolation - zone1(Apache), zone2(MySQL)
8. Provides 'z' commands to manage zones: zlogin, zonename, zoneadm,zonecfg
###Zone Configuration###
Use: zonecfg - to configure zones
Note: zonecfg can be run: interactively, non-interactively, command-file modes
Zone Types:
1. Sparse Root Zones - share key files with global zone
2. Whole Root Zones - require more storage
11. Zone Installation - zoneadm -z testzone1 install - places zone, 'testzone1' into
'installed' state. NOT ready for production
12. zoneadm -z testzone1 boot - boots the zone, changing its state
I would presume here that the zone is already created and i would detail out the
process to change an "existing" zone's network parameters.
Please Note - The network parameters can be changed without halting the zone.
But the changes would only take affect after the zone is rebooted. So be careful
with this part. Before you can use any network interface on a local zone, that
interface must be plumbed first (e.g. ifconfig plumb, on the global zone) in the
global zone. If no network address is assigned on the global zone to that interface,
its default address will be set to inet 0.0.0.0 netmask 0.
FROM -
Interface - ce0
IP Address - 10.10.10.8/24
TO -
Interface - ce1
IP Address - 10.10.10.11/24
STEP 1 - Use zoneadm list on the global zone to show status of zones on your
system.
On the global zone, use the zoneadm list -cv to show current status of all installed
zones.
In the illustration below, i have two zones installed, one being ora9 and another
being ora8
Note: You may also use zoneadm -z list -v to verify the specific zone status.
On the global zone, use the zonecfg -z to enter the zone configuration
environment. The enviromental prompt "zonecfg:" will display.
Use info in the zone configuration environment to verify the network values.
STEP 3 - Use set address= and set physical= to change the network address and
physical interface.
Use set address= and set physical= in the zone configuration environment .
The zone does not require a reboot for this parameter to take place as the zone
will use the new value if it is halted.
Note:
* If you set the autoboot resource property in a zone’s configuration to true, that
zone is automatically booted when the global zone is booted. The default setting is
false.
* for the zones to autoboot, the zones service svc:/system/zones:default must also
be enabled.
STEP 4 - Use remove net address= to remove the old network values.
Use exit in the environment to save the changes and leave the zone configuration
environment.
zonecfg:ora9> info
zonepath: /zone/ora9
autoboot: true
pool:
inherit-pkg-dir:
dir: /lib
inherit-pkg-dir:
dir: /platform
inherit-pkg-dir:
dir: /sbin
inherit-pkg-dir:
dir: /usr
net:
address: 10.10.10.8/24
physical: ce0
net:
address: 10.10.10.11/24
physical: ce1
zonecfg:ora9> remove net address=10.10.10.8/24
zonecfg:ora9> info
zonepath: /zone/ora9
autoboot: true
pool:
inherit-pkg-dir:
dir: /lib
inherit-pkg-dir:
dir: /platform
inherit-pkg-dir:
dir: /sbin
inherit-pkg-dir:
dir: /usr
net:
address: 10.10.10.11/24
physical: ce1
zonecfg:ora9> commit
zonecfg:ora9>
Note:
Performing either remove net address=
or
remove net physical=
will delete both network parameters. You do not nor can you perform both
command after you have issue one of them.
STEP 5 - Use commit and exit to save the changes to the parameter
Use commit and exit in the environment to save the changes and leave the zone
configuration environment.
zonecfg:ora9> verify
zonecfg:ora9> commit
zonecfg:ora9> exit
globalzone#
The new network parameters will not come into force until the zone is booted. Use
zoneadm -z halt to halt the zone. Then use zoneadm -z boot to start the zone with
the new network parameters.
globalzone# ifconfig -a
lo0: flags=2001000849 mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
lo0:1: flags=2001000849 mtu 8232 index 1
zone ora9
inet 127.0.0.1 netmask ff000000
ce0: flags=1000843 mtu 1500 index 2
inet 10.10.10.14 netmask ffffff00 broadcast 10.10.10.255
ether [removed]
ce0:1: flags=1000843 mtu 1500 index 2
zone ora9
inet 10.10.10.8 netmask ffffff00 broadcast 10.10.10.255
ce1: flags=1000843 mtu 1500 index 3
inet 10.10.10.15 netmask ffffff00 broadcast 10.10.10.255
ether [removed]
globalzone# ifconfig -a
lo0: flags=2001000849 mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
ce0: flags=1000843 mtu 1500 index 2
inet 10.10.10.14 netmask ffffff00 broadcast 10.10.10.255
ether [removed]
ce1: flags=1000843 mtu 1500 index 3
inet 10.10.10.15 netmask ffffff00 broadcast 10.10.10.255
ether [removed]
globalzone# ifconfig -a
lo0: flags=2001000849 mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
lo0:1: flags=2001000849 mtu 8232 index 1
zone ora9
inet 127.0.0.1 netmask ff000000
ce0: flags=1000843 mtu 1500 index 2
inet 10.10.10.14 netmask ffffff00 broadcast 10.10.10.255
ether [removed]
ce1: flags=1000843 mtu 1500 index 3
inet 10.10.10.15 netmask ffffff00 broadcast 10.10.10.255
ether [removed]
ce1:1: flags=1000843 mtu 1500 index 3
zone ora9
inet 10.10.10.11 netmask ffffff00 broadcast 10.10.10.255
globalzone#
#zone>set scheduling-class=fss
#zone>add rctl
#zone>rctl>set name-=zone.cpu-shares
#zone>rctl>set value=(priv=privileged,limit=20,action=none)
#zone>rctl>end