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/installBelow 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 SPorarp -a|grep SP
Comments
Post a Comment