How to know the global zonename from non-global zone? | Unix Linux Forums | Solaris

  Go Back    


Solaris The Solaris Operating System, usually known simply as Solaris, is a Unix-based operating system introduced by Sun Microsystems. The Solaris OS is now owned by Oracle.

How to know the global zonename from non-global zone?

Solaris


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 12-14-2008
honglus honglus is offline
Registered User
 
Join Date: Dec 2008
Last Activity: 8 December 2011, 1:40 AM EST
Posts: 87
Thanks: 1
Thanked 3 Times in 3 Posts
How to know the global zonename from non-global zone?

It is easy to list all zones from global zones, but how to find out the global zone name from non-global zone?

thx
Sponsored Links
    #2  
Old 12-15-2008
incredible incredible is offline Forum Advisor  
Registered User
 
Join Date: May 2008
Last Activity: 24 August 2014, 5:15 AM EDT
Location: SINGAPORE.. The "FINE" City
Posts: 2,693
Thanks: 1
Thanked 19 Times in 19 Posts
Check the /etc/zones directory. there will be a xml file in here. you might find some clue in there.
Sponsored Links
    #3  
Old 12-15-2008
jlliagre jlliagre is offline Forum Advisor  
ɹǝsn sıɹɐlos
 
Join Date: Dec 2007
Last Activity: 22 October 2014, 4:30 PM EDT
Location: Paris
Posts: 4,431
Thanks: 16
Thanked 473 Times in 427 Posts
The global zone name is always simply "global". There is no built in way to disclose information about any other zone including the global one to any non-global zone. This is by design. Of course, you can add /etc/hosts entries to the zones from the global one.
    #4  
Old 12-15-2008
incredible incredible is offline Forum Advisor  
Registered User
 
Join Date: May 2008
Last Activity: 24 August 2014, 5:15 AM EDT
Location: SINGAPORE.. The "FINE" City
Posts: 2,693
Thanks: 1
Thanked 19 Times in 19 Posts
Yup correct jlliagre I forgot that its just global.. Was thinking something else. my mistake..
Sponsored Links
    #5  
Old 12-15-2008
honglus honglus is offline
Registered User
 
Join Date: Dec 2008
Last Activity: 8 December 2011, 1:40 AM EST
Posts: 87
Thanks: 1
Thanked 3 Times in 3 Posts
Quote:
Originally Posted by incredible View Post
Yup correct jlliagre I forgot that its just global.. Was thinking something else. my mistake..
Your interpretation is correct, I want to know about non-global zones parent information, Since its name is always global, how to get its ip?

The reason is that i can jump to its global zone to halt the non-global zone in case it freezes.

/etc/zones only have 1 index file in non-global zone. I doesn't has information about global zone.

thx
Sponsored Links
    #6  
Old 12-15-2008
reborg's Avatar
reborg reborg is offline Forum Advisor  
Administrator Emeritus
 
Join Date: Mar 2005
Last Activity: 29 March 2012, 7:00 PM EDT
Location: Ireland
Posts: 4,464
Thanks: 0
Thanked 11 Times in 11 Posts
Why would you take this route? If the zone is frozen than you won't be able to access it. On the other have if you can examine /etc/zones, aren't you already in the global zone?

If you need the information within the zone, then just provision the hostname of the global zone in /etc/hosts in the NGZ as part of your zone creation routine.
Sponsored Links
    #7  
Old 12-15-2008
honglus honglus is offline
Registered User
 
Join Date: Dec 2008
Last Activity: 8 December 2011, 1:40 AM EST
Posts: 87
Thanks: 1
Thanked 3 Times in 3 Posts
Quote:
Originally Posted by reborg View Post
Why would you take this route? If the zone is frozen than you won't be able to access it. On the other have if you can examine /etc/zones, aren't you already in the global zone?

If you need the information within the zone, then just provision the hostname of the global zone in /etc/hosts in the NGZ as part of your zone creation routine.
The following scenenario may explain my need.

1. I ssh login to a NGZ and I want to reboot it.
2. Before issue init 6, I know it may freeze when rebooting.
3. Without any documentation, I need to find out the IP of the GZ
4. so I can ssh to GZ, ready to issue "zoneadm -z xx reboot" when NGZ freeze.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to access ENV variables of non global zones in global zone??? vijaysachin Solaris 1 02-08-2010 08:40 AM
Is there two different kernel`s running in global and non global zone? vijaysachin Solaris 1 11-25-2009 02:48 AM
How can we copy a directory from Global to Non-global zone? vijaysachin Solaris 8 11-18-2009 07:41 AM
[b]How to mount a folder from global zone to non global zone?? vijaysachin Solaris 2 11-10-2009 05:11 AM



All times are GMT -4. The time now is 06:20 PM.