Zone Creation in Solaris 10 is very fast, simple and easy. Following is an example on creating a zone (Virtual OS) on your Solaris 10. This example shows the creation of 'testzone':
# zonecfg -z testzone
testzone: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:testzone> create
zonecfg:testzone> set autoboot=true
zonecfg:testzone> set zonepath=/test/zones/testzonezonecfg:testzone> add inherit-pkg-dir
zonecfg:testzone:inherit-pkg-dir> set dir=/opt
zonecfg:testzone:inherit-pkg-dir> end
zonecfg:testzone> info
zonename: testzone
zonepath: /test/zones/testzone
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
inherit-pkg-dir:
dir: /opt
zonecfg:testzone> add net
zonecfg:testzone:net> set address=10.1.1.1
zonecfg:testzone:net> set physical=bge0
zonecfg:testzone:net> end
zonecfg:testzone> verify
zonecfg:testzone> commit
zonecfg:testzone> exit
We have added "/opt" directory as well, so that it will not be replicated for zones. This will make zone installation faster.
Now, List the zones:
# zoneadm list -cv
ID NAME STATUS PATH
0 global running /
- testzone configured /test/zones/testzone
The newly created zone is now listed, and is in configured state. The configuration information is stored in an XML file within /etc/zones. The zone can’t be used, until it is “installed.”
Here is the step to install my testzone:
bash-3.00# zoneadm -z testzone install
Preparing to install zone <testzone>.
Creating list of files to copy from the global zone.
Copying <2383> files to the zone.
Initializing zone product registry.
Determining zone package initialization order.
Preparing to initialize <1032> packages on the zone.
Initialized <1032> packages on zone.
Zone <testzone> is initialized.
Installation of <1> packages was skipped.
The file </test/zones/testzone/root/var/sadm/system/logs/install_log> contains a log of the zone installation.
It took less than 5 mins to install the testzone on my system. List the zones now:
bash-3.00# zoneadm list -cvID NAME STATUS PATH BRAND IP0 global running / native shared- testzone installed /test/zones/testzone native shared
You can see that zone status is installed. After installing zone, you have to boot it for the first time setup, and also answer boot-time questions. For this, log into the zone console from another terminal:
zlogin -C testzone
This will let you into the zone console (no password req)
Now from the main terminal, boot the zone:
zoneadm -z testzone boot
On the console, the installation will ask set-up related questions. Answer them appropriately.
Check the Zone status:
bash-3.00# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
2 testzone running /test/zones/testzone native shared
The Zone is now started running, and is ready to use.
