Last session we gone through the basic of Solaris Zones, in this article you will get more details about the configuring Zone and adding the resources. Let we can start with Zone Components and sub commands which will be very important while configuring the Zones.
Zone Components |
| ||
---|---|---|---|
zonepath | Path of the zone root which is from global zone's file space. | ||
Autoboot | Define whether we need automatically boot the zone | ||
pool | Associate the zone with a resource pool; multiple zones may share a pool. | ||
net | Network interface of Zone | ||
fs | File systems from the zone's /etc/vfstab, automounted file systems configured within the zone, manually mounted file systems or ZFS mounts from within the zone | ||
dataset | To manage non-global zone with ZFS file system. | ||
inherit-pkg-dir | In a sparse root zone, represents directories containing packaged software that a non-global zone shares with the global zone. (Should not be used in a whole root zone.) | ||
device | Devices that should be configured in a non-global zone. | ||
rctl | Zone-wide resource controls such as zone.cpu-shares andzone.max-lwps | ||
attr | Zone comments |
also please note the below "sub commands", this will also important while configuration the zone.
SUB COMMANDS | |
---|---|
add | Add the specified resource or components |
cancel | Ends the resource specification and returns to the global scope without retaining partially specified resources. |
commit | Save the current configuration to the disk. |
create | Create new zone configurations |
delete | Destroy configuration. |
end | Ends the resource specification |
exit | Ends the zonecfg session. |
info | Display information about the configuration of the current scope. |
remove | Remove the specified resource |
revert | Return to the last state written to disk. |
set | Set the specified property to the specified value |
verify | Verify the current configuration for correctness. |
Let we can see how to add the listed zone components with using "zonecfg" command
* Set zonepath and Autoboot (the zones servicesvc:/system/zones:defaultmust also be enabled when we go for autoboot=true)
* Set zonepath and Autoboot (the zones servicesvc:/system/zones:defaultmust also be enabled when we go for autoboot=true)
zonecfg:zone1> set zonepath=/export/home/zone1 zonecfg:zone1> set autoboot=true zonecfg:zone1> verify zonecfg:zone1> commit zonecfg:zone1> exit* In the following example, Filesystem is added into the non-global zone
bash-3.00# zonecfg -z zone1 zonecfg:zone1> add fs zonecfg:zone1:fs> set dir=/test/mnt zonecfg:zone1:fs> set special=/dev/vx/dsk/zonedg/vol1 zonecfg:zone1:fs> set raw=/dev/vx/rdsk/zonedg/vol1 zonecfg:zone1:fs> set type=vxfs zonecfg:zone1:fs> end zonecfg:zone1> verify zonecfg:zone1> commit zonecfg:zone1> exit* In the following example, Network is added into the non-global zone
zonecfg:zone1> add net zonecfg:zone1:net> set physical=e1000g0 zonecfg:zone1:net> set address=192.168.10.35 zonecfg:zone1:net> end zonecfg:zone1> verify zonecfg:zone1> commit zonecfg:zone1> exit* In the following example, ZFS Dataset filesystem is added into the non-global zone
bash-3.00# zonecfg -z zone1 zonecfg:zone1> add dataset zonecfg:zone1:dataset> set name=zonepool/zone1vol zonecfg:zone1:dataset> end zonecfg:zone1> verify zonecfg:zone1> commit zonecfg:zone1> exit* In this example, Specify the Memory Limits. Each limit is optional, but at least one must be set.
zonecfg:zone1> add capped-memory zonecfg:zone1:capped-memory> set physical=50m zonecfg:zone1:capped-memory> set swap=100m zonecfg:zone1:capped-memory> set locked=30m zonecfg:zone1:capped-memory> end zonecfg:zone1> verify zonecfg:zone1> commit zonecfg:zone1> exit* In this example, Assigning Dedicated CPU (1-3). we can set the importance as well.
zonecfg:zone1> add dedicated-cpu zonecfg:zone1:dedicated-cpu> set ncpus=1-3 zonecfg:zone1:dedicated-cpu> set importance=2 zonecfg:zone1:dedicated-cpu> end zonecfg:zone1> verify zonecfg:zone1> commit zonecfg:zone1> exit*In this example, specifies Capped CPU of 3.5 CPUs for the zone1
zonecfg:zone1> add capped-cpu zonecfg:zone1:capped-cpu> set ncpus=3.5 zonecfg:zone1:capped-cpu> end zonecfg:zone1> verify zonecfg:zone1> commit zonecfg:zone1> exit
No comments:
Post a Comment