2.1. The configuration & unconfiguration of Zones

For configuration it require 4 steps
1. Create
2. Install
3. Ready
4. Boot
For unconfiguration it require 3 steps
1. Halt
2. Uninstall
3. Delete
The installation takes approximately 20 mins

The configuration:
Take a system with Global zone (default OS), and make a new non-global zone (virtual OS) from global zone.
Create a File system of 4GB, Format it, Mount it, and make it permanent.
Solaris1# Format
specify disk (enter its number): 0
Format> p                   // partition
Partition> p                 // print
Partition> 5                 // Select the slice
partition id tag [unassigned]:                        //leave it blank it defaultly take unassigned
partition permission flags [wm]:                   //leave it blank it defaultly take wm
enter starting cylinder number cy[0]: 514
enter partition size: 4g                              
// The entered information about partition ID, permission flags and partition size will be on the RAM, in order to update to the kernel we need to "label" it.
partition> l
ready to the label disk, continue? Y           // now it is into the kernal, before it was in RAM
partition> q                    // quit from partition  
format> q                    // quit from format & back to the Solaris1
Solaris1# newfs /dev/rdsk/c0t0d0s5          // to construct new file system
construct new filesystem (y/n)? Y
 Solaris1# df -h (or) df -k                         // to view file system, no slice(s5) visible, bcoz not yet mounted
Solaris1# mkdir /sunny
Solaris1#mount /dev/dsk/c0t0d0s5 /sunny
Solaris1# df -h                                         // to view file system, now slice(s5) visible, bcoz mounted to sunny
Solaris1# zoneadm list -vc                       // to display the status of the zone
ID           Name             Status         path
0             global             running         /      //Id=0 always zero bcoz global
// now i want to create non-global zone, so create zone with name 'sun'
1. Create:
Solaris1# zonecfg -z sun
zonecfg:sun> create                                 // create: it creates whole root zone
                                                               // create -b: it creates sparse root zone
// if you want to config non-global zone, it required IP address, physical address & all networking details.
zonecfg:sun> set autoboot=true
zonecfg:sun> set zonepath =/sunny
zonecfg:sun> add net
zonecfg:sun:net> set physical=hme0
zonecfg:sun:net> set address=192.168.0.25   //ip address depends on requirement
zonecfg:sun:net> end
zonecfg:sun> commit                                    // save
zonecfg:sun> exit

//check out the zone status, as we just created sun (non-global), but no packages installed in 'sun'
Solaris1# zoneadm list -vc

ID           Name             Status         path
0             global             running         / 

-               sun               configured    /sunny
Solaris1# ls -ld /sunny                                 // check the status of permission
Solaris1# chmode 700 /sunny                     // set the permission as 700


2. Install:
Solaris1# zoneadm -z sun install                
//now all the files copying from global zone(Solaris1) to non-global zone (sun)
Solaris1# zoneadm list -vc

ID           Name             Status         path
0             global             running         / 

1               sun               installed       /sunny

3.Ready:
Solaris1# zoneadm -z sun ready
Solaris1# zoneadm list -vc
ID           Name             Status         path
0             global             running         / 
2               sun               ready           /sunny


4. Boot:
Solaris1# zoneadm -z sun boot
Solaris1# zoneadm list -vc
ID           Name             Status         path
0             global             running         / 

3               sun                running    /sunny



To go on to the non global zone:
Solaris1# zlogin -C -E sun
select 13 for CDE
Solaris1# telnet 192.168.0.25
sun#
sun# telnet 192.168.0.1
Solaris1#
// thus the two OS systems are running in one hardware called zones.

To unconfig a zone:
1. Halt:
Solaris1# zoneadm list -vc

ID           Name             Status         path
0             global             running         / 
3               sun                running       /sunny
Solaris1# zoneadm -z sun halt
Solaris1# zoneadm list -vc
ID           Name             Status         path
0             global             running         / 
1               sun               installed       /sunny
2. uninstall:
Solaris1# zoneadm -z sun uninstall -F
3. Delete:
Solaris1# zonecfg -z sun delete
Solaris1# zoneadm list -vc
ID           Name             Status         path
0             global             running         /   



 // so, as unusual showing single global zone