Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

9/3/2015 How 

to find the Solaris global zone from local zone using script ­ UnixArena

Monday , February 23 2015 About Contact Us Privacy Policy Hire US Table of Contents Search... ὐ

VMware Cloud Oracle Solaris Free-EBooks Tutorials LINUX Frequently Asked Advertise with us

Home / Solaris 10 / How to find the Solaris global zone from local zone using script

How to find the Solaris global zone from local zone using script Follow UnixArena
May 10, 2013 in Solaris 10 , Unix admin scripts , Zones
 
Lingeswaran R
Many of the Solaris administrators will break their head to find Solaris global zone name from  localzone. These kind
of questions may asked in interviews too.How do you find it ? The answer is No.There is no simple command to find Follow
it.Because Oracle (Sun microsystems  ) designed the Solaris zones in such a way for that, you can’t  find the global
zone from local zone due to security reason. But you can add cronjob to write the global zone name on all local zones
from global periodically to identify the global.

 
But there are some other alternatives that you can find the global zone name from local zone using MAC address.Here   
we will see about that and we will see the  permanent fix for that issue.
Subscribe 33 697
Assumpations:Here i am having local zone “sol1″ is running on Global‐zone To RSS Feed Followers Fans

Global-zone# zoneadm list -cv


ID NAME STATUS PATH BRAND IP
0 global running / native shared TOP DOWNLOADS-UNIXARENA
8 sol1 running /export/zone/sollz1 native shared
VSAN: Reimagining Storage in vSphere
Virtual Infrastructure Storage
Linux+ Exam 1 CramMaster
Login to local zone and execute the below command:If you are getting many IP’s, then that global zone may have more Microsoft Excel 2013-- Quick Reference Guide
local zones.You can suppress those IP’s by confirming global or local zone by using zonename command.(Login to those Microsoft Outlook 2013 -- Free Quick Reference
IP address and type “zonename” to determined that.) Card

Local-zone# arp -a|grep SP


e1000g0 192.168.56.130 255.255.255.255 SPLA 00:0c:29:5e:76:f5 WHAT’S HOT ?
bash-3.00# exit
# ^D Redhat Linux Certification Path for Linux
Administrators
September 10, 2013
Login to IP 192.168.56.130 and type zonename.If the output global,then this is the global zone where that local zone is
running. How to install Oracle VM manager on
Oracle Linux ?
Global-zone#zonename May 18, 2014
global
Global-zone# ifconfig -a  How to use VisualEsxtop on Vsphere
lo0: flags=2001000849 mtu 8232 index 1 Environment ?
inet 127.0.0.1 netmask ff000000 April 27, 2014
lo0:1: flags=2001000849 mtu 8232 index 1
zone sol1
Solaris memory management – Performance
inet 127.0.0.1 netmask ff000000
issue
e1000g0: flags=1004843 mtu 1500 index 2
March 12, 2013
inet 192.168.56.130 netmask ffffff00 broadcast 192.168.56.255
ether 0:c:29:5e:76:f5 How to create a new VM template on
VMware vSphere ?
July 19, 2014
How to see the global zone name in local zone permanently ?
There is a workaround to see global zone name in local zone permanently by adding one small script in global’s
Installing Oracle Solaris 11.2 using
crontab.
USB openstack Image
August 23, 2014
Add the below entries in root crontab of global zone.This will write the global zone name in all the local zones every
hour.you can check it in /etc/GLOBALZ file in all the local zones.
rcapadm – Solaris Online Resource Capping
# To write the global zone name on all local zone hourly May 15, 2013
00 * * * * /root/globalzonename.sh >/dev/null 2>&1
wireshark – How to analyse captured network
data ?
June 21, 2013

Keep the “globalzonename.s”h in /root and make is executable. What is VMware vCloud ? How it
works ?
Global-Zone# cat globalzonename.sh September 28, 2014
#!/usr/bin/bash

for i in `/usr/sbin/zoneadm list -v | /usr/bin/egrep -v "ID|global" |/usr/bin/awk ' { print $4 } '`; do echo `uname -n` > $i/root/etc/GLOBALZ; done
SMF-Service Management facility:Service
information
May 23, 2013

http://www.unixarena.com/2013/05/how­to­find­solaris­global­zone­from.html 1/3
9/3/2015 How to find the Solaris global zone from local zone using script ­ UnixArena
Verifying our work after an hour,

Local-zone# cat /etc/GLOBALZ


sfos

If you want to find the zone type, you can just type “zonename” command.If its a global zone ,you will get output as
“global” otherwise you will get hostname.

How to identify the zone type ? whole root zone or sparse root zone ?
Use “pkgcond ‐n is_what”  command to determine the zone type. This command output shows the below values. (1=
True 0=False )

For local zone + whole root zone


is_global_zone=0
is_nonglobal_zone=1
is_sparse_root_nonglobal_zone=0

is_whole_root_nonglobal_zone=1

For local zone + Sparse root zone


is_global_zone=0
is_nonglobal_zone=1
is_sparse_root_nonglobal_zone=1

is_whole_root_nonglobal_zone=0

For Global zone


is_global_zone=1
is_nonglobal_zone=0
is_sparse_root_nonglobal_zone=0

is_whole_root_nonglobal_zone=0
Refer the here for more information about pkgcond use.

Thank you for reading this article.Please leave a  comment if you have any doubt.I will get back to you.

Share ! Like 4 1 Share 2

« Previous:
Solaris Process controlling – proc
tools
Next:
Solaris Process Inspection Commands »
You may also Like

Shellshock bug – Converting native zone as How to configure and install


vulnerability on Bash shell Kernel zone – Solaris 11.2 kernel zone on Solaris 11.2
September 26, 2014 August 11, 2014 August 7, 2014

How to install solaris 10 How to Identify Solaris


branded zone on solaris 11? Processor Cores ?
Solaris Local Zone’s lsof
March 27, 2014 January 25, 2014
January 29, 2014

2 comments
eahmedshendy
July 14, 2014 at 8:59 pm

Hi Lingeswaran R,
I just wonder, Why System Admin should need to know the name of global zone if it always has the name ‘global’ ?

I mean in Solaris 11, I don’t work with Solaris 10 before


Reply

Lingeswaran R
July 15, 2014 at 12:21 am

http://www.unixarena.com/2013/05/how­to­find­solaris­global­zone­from.html 2/3
9/3/2015 How to find the Solaris global zone from local zone using script ­ UnixArena
July 15, 2014 at 12:21 am

Global zone name will be updated on the local zone not in global itself.If you connect local zone, you can easily
determine , the global zone name.

Regards
Lingeswaran
UnixArena.
Reply

Leave a Reply
Your email address will not be published. Required fields are marked *
Name *

Email *

Website

Post Comment

To Get Regular Updates RSS Feed

Follow UnixArena on Facebook Subscribe to our email newsletter.

Follow UnixArena on Twitter


Enter your e­mail address
Follow UnixArena on Google Plus
Subscribe
Follow UnixArena on LinkedIn

UnixArena © Copyright 2014, All Rights Reserved     Powered by WordPress | Designed by Tielabs

http://www.unixarena.com/2013/05/how­to­find­solaris­global­zone­from.html 3/3

You might also like