Jeff Victor wrote:
> The question "if I am in a non-global zone, how do I know what the hostname 
> of 
> the global zone is" has been asked before on this alias.  I will summarize 
> the 
> answers that I remember.
> 
> By default - and by design - a method does not exist.
> 
> The global zone administrator can make it possible for non-global zone users 
> to discover the hostname of the global zone.  For example, the global zone 
> administrator could put the global zone's hostname into a file which is 
> accessible by non-global zone users.
> 
> However, the hostname of the global zone can change, or the non-global zone 
> could be moved to a different computer.  In those situations, the global zone 
> must update the contents of that shared file.

Indeed a maintenance burden. That is why mounting the global zone's 
/etc/nodename using a read-only LOFS mount on /etc/chassis[1] in the 
non-global zone is the best way to do this IMHO. It automatically 
changes whenever the nodename of the global zone changes, whether it is 
because the name of the global zone is modified or because the zone is 
moved to another physical host using zoneadm detach/attach.

Just add this to your zone config:

# zonecfg -z aap
zonecfg:aap> add fs
zonecfg:aap:fs> set dir=/etc/chassis
zonecfg:aap:fs> set special=/etc/nodename
zonecfg:aap:fs> set type=lofs
zonecfg:aap:fs> add options ro
zonecfg:aap:fs> end

Menno

[1] or some other name, /etc/chassis is just the name I chose when 
devising this solution (specifically for zone migration across systems).

-- 
Menno Lageman - Sun Microsystems - http://blogs.sun.com/menno
_______________________________________________
zones-discuss mailing list
zones-discuss@opensolaris.org

Reply via email to