Wednesday, June 18, 2008

Step By Step Guide ~ How to Change Zone Network Parameters

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.

Objective - To change network properties of zone "ora9"

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

globalzone# zoneadm list -cv
ID NAME STATUS PATH
0 global running /
1 ora9 running /zone/ora9
- ora8 configured /zone/ora8
globalzone#

Note: You may also use zoneadm -z list -v to verify the specific zone status.

STEP 2 - Use zonecfg -z to enter the zone modifying environment

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.

globalzone# zonecfg -z ora9
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
zonecfg:ora9>

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 .

zonecfg:ora9:net> set address=10.10.10.11/24
zonecfg:ora9:net> set physical=ce1
zonecfg:ora9:net> info
net:
address: 10.10.10.11/24
physical: ce1
zonecfg:ora9:net> end
zonecfg:ora9> verify
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>

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#

Use zoneadm -z halt followed by zoneadm -z boot

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# zoneadm -z ora9 halt

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# zoneadm -z ora9 boot

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#

1 comments:

Vishal Sharma said...

we can add another 5gb of swap space to the non global
zone....but u have to reboot it to take effect...........
After halting,1st remove 35gb of swap space in non global zone configuration
then add 40gb of swap space in it......then boot the non global zone.

*#zoneadm -z halt
#zonecfg -z
zonecfg:>select rctl name = zone.max-swap
zonecfg::rctl>remove value (priv = privileged,limit 37580963840,action = deny) * ------->to remove swap of 35gb.Here limit
is denoted in bytes.
*zonecfg::rctl>add value (priv = privileged,limit 42949672960,action = deny) * ---------->to add swap of 40gb.Here limit is
denoted in bytes.
*zonecfg::rctl>end
zonecfg:>verify
zonecfg:>commit
zonecfg:>exit
#zoneadm -z boot

BLOG Maintained by - Vishal Sharma | GetQuickStart