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

Yogesh Raheja

Yogesh working as a Consultant in Unix Engineering by profession. And he has multiple years experience in Solaris, Linux , AIX and Veritas Administration. He has been certified for SCSA9, SCSA10, SCNA10, VXVM, VCS, ITILv3. He is very much passionate about sharing his knowledge with others. Specialties: Expertize in Unix/Solaris Server, Linux (RHEL), AIX, Veritas Volume Manager, ZFS, Liveupgrades, Storage Migrations, Cluster deployment (VCS and HACMP) and administration and upgrade on Banking, Telecom, IT Infrastructure, and Hosting Services.

Loading Facebook Comments ...

44 Responses

  1. Ramdev says:

    Very Impressive stuff

  2. Yogesh Raheja says:

    Thanks Ram, :-)

  3. Michael says:

    netstat -p |grep -i sp

    shud help out to find the global zone from non global zone 

    if its an flying zone then the normal cluster commands clrg status shud help 

  4. Yogesh Raheja says:

    @Michael, netstat -p | grep -i sp will work from the Global zone. We are trying to provide the same from Non-global zone. :)

  5. Yogesh Raheja says:

    Though you will get the IP for your Globalzone with the help of netstat. Also the IP can be found with the help of arp -a. So for Global zone IP we have options but for Globalzone name the method is given above. :) Thank you very much for your comment.

  6. Michael says:

    netstat -p |grep -i sp works on non global zone too …since -p shud show all the network network data structure and its obvious for the local zone its network related instance shud come from global zone and hence even sometimes u get the FQDN displayed once ur familar with the enviornment landscape then this shud be a quickest way to get information :) thnks yogesh for replying back 

  7. Ramdev says:

    @ Michael – That’s very fair point  – appreciate it. I agree with you, that finding GZ name is not a big deal if we have IP in hand.

  8. Yogesh Raheja says:

    Thanks @Michael, if SA have a good idea about the environment than ” arp -a” is also a good option. Thanks for your point as well..:) Cheers!!!…

  9. Adrian Bussey says:

    To be honest the easiest way I have found is to loopback mount a file containing the global zones name into the local zone. I then have a scripts in a loopback mounted directory in the local zone called globalzone that simply cat’s the file.

  10. srikanth says:

    Great….thanks Michel & yogesh…:-D

  11. Yogesh Raheja says:

    @Adrian, its difficult for a beginner to use scripts. As I wrote its the conman method for all environments (Banking/Telecom/ etc etc…) all OS needs the basic OS pkgs/patches for NZG. Thanks for you suggestion :)

  12. Michael says:

    neebiwe never to play around with arp command … chances of modifying the ip too 

  13. Yogesh Raheja says:

    display wont modify any IP.

    netstat -p |grep -i sp & arp -a will give the same physical interfaces and IP’s.

    • Ramdev says:

      @ Champs, you both are correct in different contexts.

      @ Yogesh your statement is very much convincing in this scenario, as you already know that , in general context the arp considered as little destructive than netstat( which is purely read only command) for new-bee

      And I see similar discussions going in linkedin on this post, its good to listen them.

  14. Ram says:

    I am checking pkg logs and don’t see global zone name..

    PATCH_INFO_126657-01=Installed: Wed Aug 11 07:26:41 PDT 2010 From: fern Obsoletes: 126306-01 Requires: Incompatibles:
    PATCH_INFO_136893-01=Installed: Wed Aug 11 07:26:59 PDT 2010 From: fern Obsoletes: 138403-01 Requires: Incompatibles:
    PATCH_INFO_140081-01=Installed: Wed Aug 11 07:30:41 PDT 2010 From: fern Obsoletes: 139474-01 Requires: Incompatibles:
    PATCH_INFO_141558-01=Installed: Wed Aug 11 07:30:53 PDT 2010 From: fern Obsoletes: 118959-04 Requires: Incompatibles:
    PATCH_INFO_142909-17=Installed: Wed Aug 11 07:46:18 PDT 2010 From: fern Obsoletes: 118814-01 120038-01 120816-01 121128-0


  15. Yogesh Raheja says:

    @Ram, you need to check the packages which are installed on Global zone. If pkg is installed on NGZ only it wont display the GZ name.

  16. Mark says:

    Is this valid of whole root zones? From what I have seen it is only true for sparse zones.

  17. Yogesh Raheja says:

    @Mark, I have given the example from Sparse Zones, but it stands true for Whole Root Zone as well.

  18. Mark says:

    Yogesh, the GZ of the whole root zone I was looking at had a change of host name, so I did not find what I expected. But I do see the old GZ host name.



    • Ramdev says:

      That’s a good catch Mark, and my technical guess is that the log what yogesh mentioned was created during initial NG zone installation, and NG zone has no reasons to change ( to reflect new GZ name) the old logs during its life time unless it was redeployed again on same GZone.

  19. Yogesh Raheja says:

    @Mark/Ram, if we will do patching on the server, it will reflect the new server name, as hostname change wont reflect any changes in the logs (which were created when the hostname was different) untill something new is installed on the server. :)

  20. Yogesh Mehta says:

    hi techies,

    netstat -p |grep -i sp is helpful. but the SUNWaccu method no luck for me :-(

  21. Ramdev says:

    @yogesh mehta – what is the from feild showing in the patch logs? is your zone branded ?

  22. Sukhbir Singh says:

    Very impressive yaar………..

  23. Yogesh Raheja says:

    @Sukhbir, thank you very much!!…

  24. S.P.Raj says:

    the above description was good to findout the GZN from NGZ. How do i findout the whole root zone or spares root zone from Non global zone? is there any command ..?

  25. Yogesh Raheja says:

    @S.P Raj, I dont think so that their is any inbuilt command for that at OS level, but yes you can install external package which will provide you with the command to run on the system so that you can get the GZ name.

  26. Santosh says:

    Hi Ramdev,
    Good Evening…
    If possible can you let us know the steps to install a application (Oracle/Websphere) in Non global zone and as well as global zone.
    I don’t know that…plz help me.

  27. Yogesh Raheja says:

    @Santosh, Oracle/Websphere are installed by using pkgadd command in case of both GZ & NGZ. While installation the installation wizard will prompt some series of ques. like (installation directory, suid/guid set permissions etc) which you need to fill up by “Y or N”. Just try it and let us know in case you encounter any issues.

  28. santosh says:

    Thank you very much for the information….
    Gurkulindia ROCKS

  29. Yogesh Raheja says:

    @Santosh, Thank you :)

  30. Sridevi Nakka says:

    @Yogesh, i only knew netstat and arp to figure out the global zone name… this is really impressive….

  31. Yogesh Raheja says:

    @Sridevi, thanks for your comments!!!..:)

  32. Hudson says:

    Your method only works for Solaris 10. It does not work in Solaris 11.

  33. Ramdev says:

    @hudson – True. We haven’t started posting things on Solaris 11 yet :)

  34. Christopher Atienza says:

    Try to use “ifconfig -a |grep zone” the one with the zone output will be the global zone the use does’nt have is the zone.

  35. Christopher Atienza says:

    solaris10-global # ifconfig -a |grep zone
            zone zone1
            zone zone2
            zone zone3

    solaris10-global # zlogin zone1

    zone1 # ifconfig -a |grep zone

    lo0:6: flags=2001000849 mtu 8232 index 1
            inet netmask ff000000
    ce4:8: flags=1000843 mtu 1500 index 4
            inet netmask fffffc00 broadcast
    ce5:4: flags=1000843 mtu 1500 index 5
            inet netmask fffffc00 broadcast

  36. Christopher Atienza says:

    You could use also to determine global zone to non-global:
    solaris10-global # zonename

    zone1 # zonename

    • Ramdev says:

      Hi Chris, it seems you have a confusion here. The process Yogesh shared here is to find out the global zone name when you are login into non-global zone ( using its up), as per sun there is no authentic procedure for that .

      the commands you mentioned here are to find whether the currently login server is a global zone or non- global-zone .

  37. Duc says:

    Solaris 10, the combination of /etc/globalzone and netstat -p | grep SP will tell us the global zone and non-global zone names.

  38. Yogesh Raheja says:

    @Duc, thanks, netstat -p | grep SP is also one of the frequent way to find out the global zone name. But /etc/globalzone required some package and wont come with default OS. Thanks for sharing this info. cheers.

  39. Wilson says:

    /var/sadm/pkg/SUNWaccu/pkginfo will list the hostname of Global Zone Server Name during the local zone is configured from there. If the hostmane of Global Zone is change later point of time then the output of /var/sadm/pkg/SUNWaccu/pkginfo will not be the accurate one!!!
    Correct me if I am wrong.

  40. Ramdev says:

    Wilson,  that’s right. The file reflects only the initial hostname the later hostname changes won’t be reflected there.

  1. November 9, 2011

    Administrare de personal…

    […] » How to check the Parent Zone (Global Zone) name of Non Global Zone from Non Global Zone.[…]…

Leave a Reply

Your email address will not be published.

[contact-form to='' subject='New Learning Request Submitted'][contact-field label='Name' type='name' required='1'/][contact-field label='Email' type='email' required='1'/][contact-field label='Learning Request' type='textarea' required='1'/][contact-field label='Are you Looking for ' type='radio' required='1' options='Paid Training,Free Training'/][/contact-form]

What is your Learning Goal for Next Six Months ? Talk to us