Skip to main content

How to check the Parent Zone (Global Zone) name of Non Global Zone from Non Global Zone

As many Unix folks are discussing and believing that their is no way to find out the Parent Zone (Globle Zone, GZ) from Non Global Zone (NGZ).
Folks there is a way, I will show you the complete steps how to find out the GZ name from NZG.
It took many months for me to find out the way, but at last I got it. :-)
This post is for all those Unix Champs who were asking the same que. on Linkedin.com , guys as committed below is the post.
My Global Zone (Physical Server):
===========================
yogesh-test#uname -a
SunOS yogesh-test 5.10 Generic_144488-11 sun4u sparc SUNW,Sun-Fire-V245 —–> GZ (yogesh-test)
yogesh-test#zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
1 yogesh-zone running /zones/yogesh-zone native shared  ——> NZG (yogesh-zone)
My Non-Global Zone (Virtual Server):
==============================
yogesh-test#zlogin yogesh-zone
[Connected to zone ‘yogesh-zone’ pts/2]
Last login: Sun Sep 4 18:56:47 on pts/2
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
Procedure to find out the Global Zone Name in any environment without any customization:
# cd /var/sadm
# ls
README install_data security softinfo svm3 wbem
install pkg servicetag spool system
# cd pkg
# ls
<<<<<<<<Output Truncated>>>>>
SUNW1251f SUNWftduu SUNWmdr SUNWsshu
SUNW1394 SUNWftpr SUNWmdu SUNWstc
SUNW1394h SUNWftpu SUNWmeadt SUNWsthwreg
SUNW5ttf SUNWfwflash SUNWmeaos SUNWstosreg
SUNW5xmft SUNWgccruntime SUNWmeaow SUNWstsf
SUNWGlib SUNWgcmn SUNWmfdev SUNWstsfr
SUNWTcl SUNWged SUNWmfman SUNWsviso1
SUNWTiff SUNWgedu SUNWmfrun SUNWswmt
SUNWTk SUNWgfb SUNWmga SUNWtavor
SUNWaccr SUNWgfbcf SUNWmgapp SUNWtcpd
SUNWaccu SUNWgfbr SUNWmgts SUNWtcsh
<<<<<<<<Output Truncated>>>>>
# cd SUNWaccu
# ls
install pkginfo save
#
# more pkginfo
CLASSES=none
BASEDIR=/
LC_CTYPE=en_GB.ISO8859-1
LC_NUMERIC=en_GB.ISO8859-1
LC_TIME=en_GB.ISO8859-1
LC_COLLATE=en_GB.ISO8859-1
LC_MESSAGES=C
LC_MONETARY=en_GB.ISO8859-1
TZ=GB-Eire
PKG_CLIENT_OS=Solaris
PKG_CLIENT_VERSION=10
PKG_CLIENT_REVISION=0
PATH=/sbin:/usr/sbin:/usr/bin:/usr/sadm/install/bin
OAMBASE=/usr/sadm/sysadm
PKG=SUNWaccu
NAME=System Accounting, (Usr)
ARCH=sparc
VERSION=11.10.0,REV=2005.01.21.15.53
SUNW_PRODNAME=SunOS
SUNW_PRODVERS=5.10/Generic
SUNW_PKGTYPE=usr
SUNW_OBSOLETES=
MAXINST=1000
CATEGORY=system
DESC=utilities for accounting and reporting of system activity
VENDOR=Sun Microsystems, Inc.
HOTLINE=Please contact your local service provider
EMAIL=
SUNW_PKGVERS=1.0
SUNW_PKG_ALLZONES=true
SUNW_PKG_HOLLOW=false
SUNW_REQUIRES=
SUNW_INCOMPAT=
SUNW_PATCHID=141558-01
SUNW_PATCH_PROPERTIES=rebootafter
PSTAMP=on10ptchfeat20090522095754
PKGINST=SUNWaccu
PKGSAV=/var/sadm/pkg/SUNWaccu/save
PKG_NO_UNIFIED=TRUE
LANG=
PATCHLIST=117465-02 118959-03 120038-01 125022-01 126657-01 127759-01 125095-15 128010-10 127759-03 118959-04 138318-02 136893-01 1400
81-01 142900-12 142909-17 141558-01
PATCH_INFO_117465-02=Installed: Mon Mar 24 10:23:52 PDT 2008 From: fern Obsoletes: Requires: Incompatibles:
PATCH_INFO_118959-03=Installed: Mon Mar 24 10:25:53 PDT 2008 From: fern Obsoletes: Requires: Incompatibles:
PATCH_INFO_120038-01=Installed: Mon Mar 24 10:32:56 PDT 2008 From: fern Obsoletes: Requires: Incompatibles:
PATCH_INFO_125022-01=Installed: Mon Mar 24 10:46:26 PDT 2008 From: fern Obsoletes: Requires: Incompatibles:
PATCH_INFO_126657-01=Installed: Mon Mar 24 10:49:02 PDT 2008 From: fern Obsoletes: 126306-01 Requires: Incompatibles:
PATCH_INFO_127759-01=Installed: Mon Mar 24 10:49:23 PDT 2008 From: fern Obsoletes: Requires: Incompatibles:
PATCH_INFO_125095-15=Installed: Mon Mar 24 11:53:44 PDT 2008 From: fern Obsoletes: Requires: Incompatibles:
PATCH_INFO_128010-10=Installed: Mon Mar 24 12:24:41 PDT 2008 From: fern Obsoletes: Requires: Incompatibles:
INSTDATE=Aug 19 2011 10:56
PATCH_PROGRESSIVE=false
PATCH_UNCONDITIONAL=false
PATCH_NO_UNDO=false
PATCH_BUILD_DIR=none
PATCH_UNDO_ARCHIVE=none
INTERRUPTION=no
SQLDB=no
ACTIVE_OBSOLETES=118959-04
PATCH_INFO_127759-03=Installed: Sunday, 9 May 2010 03:21:47 BST From: yogesh-test Obsoletes: 125022-01 Requires: Incompatibles
:
SCRIPTS_DIR=/var/tmp/TmpDAAAmGa44T/141558-01/SUNWaccu/install
Below logs are showing from where the package (system package, which is necessary for Solaris OS installation) was installed and that is sufficient for us to get our GZ name.
PATCH_INFO_118959-04=Installed: Tuesday, 11 May 2010 18:47:28 BST From: yogesh-test Obsoletes: Requires: Incompatibles:
PATCH_INFO_138318-02=Installed: Tuesday, 11 May 2010 19:57:34 BST From: yogesh-test Obsoletes: 125022-01 127759-03 Requires: Inc
ompatibles:
PATCH_INFO_136893-01=Installed: Tuesday, 11 May 2010 20:20:10 BST From: yogesh-test Obsoletes: 138403-01 Requires: Incompatibles
:
PATCH_INFO_140081-01=Installed: Tuesday, 11 May 2010 20:27:04 BST From: yogesh-test Obsoletes: 139474-01 Requires: Incompatibles
:
PATCH_INFO_142900-12=Installed: Thursday, 10 June 2010 03:02:29 BST From: yogesh-test Obsoletes: 118814-01 120038-01 12139
4-03 123271-01 125022-01 125174-02 125200-01 125201-01 126308-01 127723-01 127759-03 127762-01 128032-01 137133-01 138157-01 138318-03
139509-02 139514-01 139943-01 139945-03 140562-02 141544-01 141550-02 141773-01 142263-01 142528-01 143352-01 Requires: 118833-36 118
918-24 119578-30 120011-14 127127-11 127755-01 137137-09 139555-08 141444-09 143055-01 Incompatibles:
PATCH_INFO_142909-17=Installed: Thursday, 26 May 2011 13:28:00 BST From: yogesh-test Obsoletes: 118814-01 120038-01 12081
#
As we all know that the NZG will use the same kernel as that of GZ, so in the system installation logs (Patch/Packages) you will find the GZ name where the actual installation has been done. 

Alternative Solution: running either of the below two commands will fetch you the global zone information from a local zone


netstat -p|grep SP  
or

arp -a|grep SP

Comments

Popular posts from this blog

How to create and configure solaris 10 zones

Solaris zones enables a software partitioning of solaris 10 OS to support multiple independent, secure OS environments to run in the same OS. Each environment has separate process space, resource allocation and users. Zones are widely used in production environments as it is easy to setup and doesn’t require any special hardware like ldoms does. Zone types Global zone  – every installed OS acts like a global zone, which is present by default. All non-global zones can only be intalled, configured and administered from global zone. Non-global zone  – They share the functioning of the kernel booted under the global zone. All the software and other resources are inherited from the global zone. Whole Root zone (Big zone)  – It gets their own writable copy of all the file systems like /opt, /usr. It takes more disk space. Sparse root zone (Small zone)  – File systems like /opt, /usr are shared from global zone as loopback file-system (you only have a read-only access...

How to Identify Sparse or Whole Root Zones

First question in your mind is to identify the Non-Global Zone whether they Sparse or Whole Root Zone in real time. This post will help you to find those details in handy ways. Theoretically everyone having good knowledge about Sparse and Whole Root Zones. But in real time.....Please follow the Steps. Here We have 2 Non-Global zone, but we are not sure which one is Sparse or Whole Root Zones. Let we identify them. [root@unixrock ~]# zoneadm list -cv ID NAME STATUS PATH BRAND IP 0 global running / native shared 1 unixrockLZ running /export/zones/unixrockLZ native shared 2 unixrockLZ1 running /export/zones/unixrockLZ1 native shared [root@unixrock ~]# There is a Command called "pkgcond" allows you to determine the type of target being operated on (global zone, non-global zone). more details you can refer man Page of pkgcond. I'm executing the c...

Solaris 10 boot process : SPARC

The boot process for SPARC platform involves 5 phases as shown in the diagram below. There is a slight difference in booting process of a SPARC based and x86/x64 based solaris operating system. Boot PROM phase 1. The boot PROM runs the power on self test (POST) to test the hardware. 2. The boot PROM displays the banner with below information – Model type – processor type – Memory – Ethernet address and host ID 3. Boot PROM reads the PROM variable boot-device to determine the boot device. 4. Boot PROM reads the primary boot program ( bootblk ) [sector 1 to 15] and executes it. Boot program phase 1.  bootblk  loads the secondary boot program  ufsboot  into memory. 2. ufsboot reads and loads the kernel. The kernel is composed of 2 parts : unix (platform specific kernel) genunix (platform independent kernel) 3. ufsboot combines these 2 kernel into one complete kernel and loads into memory. Kernel initialization phase 1. The kernel reads the configura...