Solaris Zone status and Configuration

This article describes how to display the Solaris Zone Status and Configuration from the global zone.

Using zoneadm

Using zoneadm list on the global zone to show the status of a zone

  1. 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 alpha            running        /zones/alpha                   native   shared
       3 bravo            running        /zones/bravo                   native   shared
       4 delta            running        /zones/delta                   native   shared
    global#

    to show status of all installed zones (i-stands for installed)

  2. 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 alpha            running        /zones/alpha                   native   shared
       3 bravo            running        /zones/bravo                   native   shared
       4 delta            running        /zones/delta                   native   shared
       - charlie          configured     /zones/charlie                 native   shared
    global#

    to show status of all configured zones (c-stands for configured which includes installed zones).

NOTE: Using /usr/sbin/zoneadm on a local zone will only display the status of that zone.

Using zonecfg

Use zonecfg -z with the info option to list a specific zone configuration.

# zonecfg -z <zonename>

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

  1. Basic zone The example below is a basic zone installation which contains inherited packages.
    global# zonecfg -z alpha info
    zonename: alpha
    zonepath: /zonepool/alpha
    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.1.143/24
            physical: e1000g0
            defrouter: 192.168.1.254
    global#
  2. Self--contained zone A self-contained zone will display the following configuration display with no inherit-pkg-dir:
    global# zonecfg -z delta info
    zonename: delta
    zonepath: /zonepool/delta
    brand: native
    autoboot: true
    bootargs:
    pool:
    limitpriv: 
    scheduling-class:
    ip-type: shared
    net:
            address: 192.168.1.147/24
            physical: e1000g0
            defrouter: 192.168.1.254
    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#

Using /etc/zones

Examine /etc/zones directory to display zone configuration file.# cat /etc/zones/<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         547 Mar 26 13:56 alpha.xml
-rw-r--r--   1 root     root         547 Mar 24 03:06 bravo.xml
-rw-r--r--   1 root     root        1198 Mar 28 04:18 index
-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 zulu.xml
global# cat alpha.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="alpha" 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.1.145/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         547 Mar 26 13:56 alpha.xml
-rw-r--r--   1 root     root         547 Mar 24 03:06 bravo.xml
-rw-r--r--   1 root     root        1198 Mar 28 04:18 index
-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 zulu.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:/
bravo:installed:/zones/bravo
zulu:installed:/zones/zulu
alpha:installed:/zones/alpha
global#