the zoneadm -z zone boot command on a zone in the running state will have the zone be booted into the running state
Solaris Zones Zones are virtual process environments in Solaris 10 (and newer) that allow system administrator to isolate process in one zone from processes in another zone. Zones have their own (chroot) storage environment which again separates data between zones.
Manage zone
Undefined zonecfg -z zone delete
↑
↓zoneadm -z zone install zoneadm -z uninstall ↑ Installed ↑
Ready
↓
Create zone's root file system structure zoneadm -z zone install Boot zone in ready mode zoneadm -z zone ready
Configured
↓zoneadm -z zone ready
List zones List available zones zoneadm list -cv Look at zone configuration zonecfg -z zone info Check current zone zonename
Create zone using custom template zonecfg -z zone -f template.zone
Zone states
↓zoneadm -z zone boot
Create sparse root model zone (default) zonecfg -z zone zonecfg:zone> create Create whole root model zone zonecfg -z zone zonecfg:zone> create -b
This quick reference list the most commonly used commands involved managing Solaris zones. For a zones overview see the solaris_zones_intro quick reference at http://www2.petervg.nl/quick_reference
zonecfg -z zone ↓ zone: > create
Create zone
Restore zone configuration using command file zonecfg -z zone install
zoneadm -z zone halt ↑
Running zoneadm -z zone reboot Running
●
A running zone cannot be brought back to the ready state. A halt on a running zone will bring the zone to the installed state.
●
A zone doesn't have to be booted into the ready state before it can enter the running state. Issuing
Into running mode zoneadm -z zone boot Reboot zone(from global zone) zoneadm -z zone boot
Log in and run commands Log in on zone's console (from global zone) zlogin -C zone Log in on zone (from global zone) zlogin zone Log in on zone (from anywhere) ssh zone_host_name Run command in zone (from global zone) zlogin -c command zone
Halt zone (from global zone)
Run command in zone (from anywhere) ssh zone cmd
This will not run the shutdown procedures!! zoneadm -z zone halt
Run command in zone ( from anywhere) rsh zone command
Reboot zone (from global zone) This will not run the shutdown procedures zoneadm -z zone reboot
Manage processes
Backup zone configuration zonecfg -z zone -f /backup/zone.cmd
Display zone name with running process ps -e -Z
Display processes running in zone (from global zone) ps -z zone
Create resource pool poolcfg -dc 'create pool zone_pool'
Display zone statistics prstat -Z
Associate processor set with pool poolcfg -dc 'associate pool zone_pool (pset two_cpu)'
Kill process by name in zone pkill -z zone process_name Find process by name in zone pgrep -z zone process_name List process tree in zone ptree -z zone
Install packages and patches Install package in current zone only pkgadd -G pkg_name Install patch in current zone only patchadd -G path_name Backup zone configuration zonecfg -z zone export > /backup/zone.cmd
Dynamic resource pool management Dynamic resource pools are not part of the zone framework. I have listed the command here for your convenience. View current pool configuration poolcfg -dc info Read pool configuration file poolcfg -c info /etc/pooladm.conf Create processor set (with 2 CPUs) poolcfg -dc 'create pset two_cpu ( uint pst.min = 1 ; uint pset.max = 2 )'
Enable pool facility pooladm -e Save active pool configuration pooladm -s /etc/pooladm.conf Activate the /etc/pooladm.conf configuration pooladm -c
Memory capping To manage the memory usage of zone's you can use the so-called memory capping feature in Solaris. Setup project projadd -c "Project Description" -G users -p 101 users projmod -s -K rcap.max-rss=1000k users Enable resource capping rcapadm -E Check status rcapstat
Colophon Author Peter van Gemert Name solaris_zones_commands.pdf Location http://www2.petervg.nl/quick_reference Created 16 July 2007 Modified 16 July 2007