Tuesday, January 4, 2011

Solaris Zones Basics-2

Zone States
ConfiguredConfiguration has been completed and storage has been committed. Additional configuration is still required.
IncompleteZone is in this state when it is being installed or uninstalled.
InstalledThe zone has a confirmed configuration, zoneadm is used to verify the configuration, Solaris packages have been installed, even through it has been installed, it still has no virtual platform associated with it.
Ready (active)Zone's virtual platform is established. The kernel creates the zschedprocess, the network interfaces are plumbed and filesystems mounted. The system also assigns a zone ID at this state, but no processes are associated with this zone.
Running (active)A zone enters this state when the first user process is created. This is the normal state for an operational zone.
Shutting down + Down (active)Normal state when a zone is being shutdown.

Files and Directories
zone config file
/etc/zones
zone index
/etc/zones/index

Note: used by /lib/svc/method/svc-zones to start and stop zones

Cheat sheet
Creating a zonezonecfg -z <zone>
see creating a zone for a more details
deleting a zone from the global ssytem## halt the zone first, then uninstall it
zoneadm -z <zone> halt
zoneadm -z <zone> uninstall

## now you can delete it
zonecfg -z <zone> delete -F
Display zones current configurationzonecfg -z <zone> info
Display zone namezonename
Create a zone creation filezonecfg -z <zone> export
  
Verify a zonezoneadm -z <zone> verify
Installing a zonezoneadm -z <zone> install
Ready a zonezoneadm -z <zone> ready
boot a zonezoneadm -z <zone> boot
reboot a zonezoneadm -z <zone> reboot
halt a zonezoneadm -z <zone> halt
uninstalling a zonezoneadm -z <zone> uninstall -F
Veiwing zoneszoneadm list -cv
  
login into a zonezlogin <zone>
login to a zones consolezlogin -C <zone> (use ~. to exit)
login into a zone in safe mode (recovery)zlogin -S <zone>
  
add/remove a package (global zone)# pkgadd -G -d . <package>

If the -G option is missing the package will be added to all zones
add/remove a package (non-global zone)# pkgadd -Z -d . <package>
If the -Z option is missing the package will be added to all zones
Query packages in all non-global zones# pkginfo -Z
query packages in a specified zone# pkginfo -z <zone>
  
lists processes in a zone# ps -z <zone>
list the ipcs in a zone# ipcs -z <zone>
process grep in a zone# pgrep -z <zone>
list the ptree in a zone# ptree -z <zone>
Display all filesystems# df -Zk
display the zones process informtion# prstat -Z
# prstat -z <zone>
Note:
-Z reports information about processes and zones
-z reports information about a particular zone

1 comment: