Updated 22 March 2010
Linux Logo

Displaying Solaris Zone Status/Configuration


Description:
  • This procedure describes how to Solaris Zone Status and Configuration.
Prerequisites:
  • Access to the global zone server
Notes:
  • None
References:

Step Action Description
1 Use zoneadm list on the global zone server to show status of zone
# /usr/sbin/zoneadm list -vi to show status of all installed zones (i-stands for installed)
# /usr/sbin/zoneadm list -vc to show status of all configured zones (c-stands for configured which includes installed zones).
 

On the global zone, use the zoneadm list -vi to show current status of all installed zones.

global# /usr/sbin/zoneadm list -vi
  ID NAME             STATUS         PATH                           BRAND    IP
   0 global           running        /                              native   shared
   2 rlogic           running        /zones/rlogic                  native   shared
   3 utility          running        /zones/utility                 native   shared
   4 myzone           running        /zones/myzone                  native   shared
global# 

On the global zone, use the zoneadm list -vc to show current status of all configured zones.

global# /usr/sbin/zoneadm list -vc
  ID NAME             STATUS         PATH                           BRAND    IP
   0 global           running        /                              native   shared
   2 rlogic           running        /zones/rlogic                  native   shared
   3 utility          running        /zones/utility                 native   shared
   4 myzone           running        /zones/myzone                  native   shared
   - junkzone         configured     /zones/junkzone                native   shared
global# 

Note: Using the /usr/sbin/zoneadm on a local zone will only display the status of that zone.
2 Use zonecfg -z with the info option to list a specific zone configuration.
# zonecfg -z <zone name> info

The zonecfg command can be used to list the configuration of a current zone. The zonename must be specified.

Basic Zone
global# zonecfg -z myzone info
zonename: myzone
zonepath: /zonepool/myzone
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/sfw
net:
        address: 192.168.29.143/24
        physical: e1000g0
        defrouter: 192.168.29.2
global#

The example above is a basic zone installation which contains inherited packages. A self-contained zone will display the following configuration display with no inherit-pkg-dir:

global# zonecfg -z mywhole info
zonename: mywhole
zonepath: /zonepool/mywhole
brand: native
autoboot: true
bootargs:
pool:
limitpriv: 
scheduling-class:
ip-type: shared
net:
        address: 192.168.29.142/24
        physical: e1000g0
        defrouter: 192.168.29.2
capped-memory:
        physical: 512M
        [swap: 512M]
        [locked: 512M]
rctl:
        name: zone.max-swap
        value: (priv=privileged,limit=536870912,action=deny)
rctl:
        name: zone.max-locked-memory
        value: (priv=privileged,limit=536870912,action=deny)
rctl:
        name: zone.cpu-shares
        value: (priv=privileged,limit=10,action=none)
global# 
3 Examine /etc/zones directory to display zone configuration file.
# cat <zonename>.xml

The directory /etc/zones contains the configuration files for each zone by the zone name. Examining these files will show the show the configuration of the zones.

global# cd /etc/zones
bash-3.00# ls -l
total 18
-rw-r--r--   1 root     root        1198 Mar 28 04:18 index
-rw-r--r--   1 root     root         547 Mar 26 13:56 myzone.xml
-rw-r--r--   1 root     root         547 Mar 24 03:06 rlogic.xml
-r--r--r--   1 root     bin         1196 Sep  7  2005 SUNWblank.xml
-r--r--r--   1 root     bin         1366 Sep  7  2005 SUNWdefault.xml
-rw-r--r--   1 root     root         549 Mar 24 03:50 utility.xml
global# cat myzone.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE zone PUBLIC "-//Sun Microsystems Inc//DTD Zones//EN" 
"file:///usr/share/lib/xml/dtd/zonecfg.dtd.1">
<!--
DO NOT EDIT THIS FILE.  Use zonecfg(1M) instead.
-->
<zone name="myzone" zonepath="/zones/myzone" autoboot="true"> <inherited-pkg-dir directory="/lib"/> <inherited-pkg-dir directory="/platform"/> <inherited-pkg-dir directory="/sbin"/> <inherited-pkg-dir directory="/usr"/> <inherited-pkg-dir directory="/opt/sfw"/> <network address="192.168.3.38/24" physical="rtls0"/> </zone> gloabl#

The index file in this directory also contains the status of the zones:

global# ls -l
total 18
-rw-r--r--   1 root     root        1198 Mar 28 04:18 index
-rw-r--r--   1 root     root         547 Mar 26 13:56 myzone.xml
-rw-r--r--   1 root     root         547 Mar 24 03:06 rlogic.xml
-r--r--r--   1 root     bin         1196 Sep  7  2005 SUNWblank.xml
-r--r--r--   1 root     bin         1366 Sep  7  2005 SUNWdefault.xml
-rw-r--r--   1 root     root         549 Mar 24 03:50 utility.xml
global# cat index
# ident "@(#)zones-index        1.3     05/06/08 SMI"
# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License, Version 1.0 only
# (the "License").  You may not use this file except in compliance
# with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# DO NOT EDIT: this file is automatically generated by zoneadm(1M)
# and zonecfg(1M).  Any manual changes will be lost.
#
global:installed:/
rlogic:installed:/zones/rlogic
utility:installed:/zones/utility
myzone:installed:/zones/myzone
global#
Click for more info