Monday, January 24, 2011

Global zone name from Local zone

Most of the time we struggle to identify global zone name while we are working in local zone.This tips will be useful to identify global zone name from its local zone.

1.First you login to Global zone and create a file called "global_zone_name" under /usr/bin directory.Hardcore your Global zone name in this file and save it.Change the file permission to 700.

Global Zone
===========
Global# vi /usr/bin/global_zone_name
"/usr/bin/global_zone_name" 1 line, 7 characters

echo "sunray"
wq!


Global# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
1 moon running /zones/moon native shared


Login to local zone
# zlogin moon
[Connected to zone 'moon' pts/6]


In local zone type global_zone_name command it will display your global zone name.
Local Zone:
===========
Sun Microsystems Inc. SunOS 5.10 Generic January 2005

# uname -a
SunOS moon 5.10 Generic_141445-09 i86pc i386 i86pc

# global_zone_name
sunray

**Anyone know better solution than this please share it**

1 comment:

Netstar said...

Use arp -a | grep SP
Easy way to find global zone. When you new to some project and env.where some 1000 physcial server are there. you have got alert for localzone and you have to find global zone...In this case How do you find?