Showing posts with label zones. Show all posts
Showing posts with label zones. Show all posts

Sunday, 30 March 2008

Solaris 10 zone states

Here's a list of the states a non-global zone can be in:

configured - zone is configured, but it's yet to have its initial boot

incomplete - zoneadm command sets a zone's state to this value while installing and uninstalling a zone. When the operation is completed, zone's status is changed.

installed - zone is fully configured, OS packages have been installed. It's a ready-to-use zone, all you have to do is to boot it. The zone has no virtual platform associated yet.

ready - the zone is ready. It already has a virtual platform established, the kernel has created a zsched process, all the network interfaces are plumbed, devices are configured and file systems are mounted. No processes have been started yet, but since the zone is ready it already has a unique ID assigned to it. We normally don't see a zone in this state, and it always moves one to the next one - running.

running - the zone is up and running. You can connect to the zone. It's a fully working environment now.

shutting down and down - short-term states which are shown when the zone is being halted. Upon completion of halt, the zone gets back into installed state.

Wednesday, 27 February 2008

Solaris 10 Zones command crib

Zones command crib
----------------------------------
List available zones

zoneadm list –v
-----------------------------------

List status of zones

zoneadm list -cp
-----------------------------------

Login to zone

zlogin –C zonename
-----------------------------------

Logout of a local zone while in a console session / logout of a local zone when logged in from the global zone

~~~.

Logout of a global zone
~.
-----------------------------------

Determine what zone you are in

zonename
-----------------------------------

Command to discover if zone is sparse or whole
# pkgcond is_whole_root_nonglobal_zone
# echo $?
1
# pkgcond is_sparse_root_nonglobal_zone
# echo $?
0

so here the zone is sparse
-----------------------------------

How to get data from a zone without logging into it

(from the global zone)

zlogin zonename cmd

eg

zlogin zonename1 iostat –En
-----------------------------------
From the global zone, show disk stats in human readable form with zone areas included

df –hZ



From the global zone, show processes that are running including zone procs


ps –ef Z

-----------------------------------

Determine disk usage of zones within the partition they reside


du –sk /xx/xx/zonenames*



eg



du –sk /zone/zp*

-----------------------------------------

Determine CPU utilization from the global zone


prstat –Z

-----------------------------------------

Booting a zone


(from the global zone)



zoneadm –z zonename boot

-----------------------------------------

Rebooting a zone


(from the global zone)



zoneadm –z zonename reboot

-----------------------------------------

Halting a zone


(from the global zone – this is used to remove both the application environment and virtual platform for a zone – Zone status is then brought to the ‘installed’ state. All processes are killed, devices unconfigured, network interfaces unplumbed, file systems are unmounted and kernel data structures destroyed)



zoneadm –z zonename halt

-----------------------------------------

Deleting a Zone


(from the global zone, the assumption is that the zone has been halted prior to these actions)



zoneadm –z zonename uninstall



zonecfg –z zonename delete



You can confirm the status of the zone at any time with



zoneadm list –cp