Re: [zones-discuss] how to find global-zone from zone

2007-08-29 Thread Michael Barto




Since this seems to be a common question that has shown up on this list
from time to time, I have added our method to our Solaris Zone RunBook
which is free and posted it at:

http://www.logiqwest.com/dataCenter/Demos/RunBooks/Zones/listingGlobal.html

Hope this helps till Sun finally puts a real command in the OS.

Remco Fugers wrote:
Hi,
  
I was wondering if it's possible to find out to which global zone 
a zone is related.  (And not from Globalzone point of view!)
  
It might happen (as a sysadmin) that you login to a zone but you need
to perform maintenance in the global zone (
i.e. Veritas VM -stuff).
  
Thanks in advance
  
Remco
  
  
  

___
zones-discuss mailing list
zones-discuss@opensolaris.org


-- 





  

  
  


  Michael Barto
  Software Architect
  
  
  
  


   LogiQwest
Inc.
16458 Bolsa Chica Street, # 15
Huntington Beach, CA  92649
  http://www.logiqwest.com/
  
  
     
  [EMAIL PROTECTED]
Tel:  714 377 3705
Fax: 714 840 3937
Cell: 714 883 1949
  
  


  'tis a gift to be
simple
   


   This e-mail may contain
LogiQwest
proprietary information and should be treated as confidential. 

  






___
zones-discuss mailing list
zones-discuss@opensolaris.org

Re: [zones-discuss] how to find global-zone from zone

2007-08-29 Thread Christine Tran
Paul Kraus wrote:
> On 8/29/07, Brandorr <[EMAIL PROTECTED]> wrote:
> 
>> In a related, but similar situation. How does one know that they are
>> actually in a non-global zone vs a global zone? (Using a committed
>> interface).
> 
> `ps -ef` and look for pid 0,1,2,3; these should only be visible in a
> global zone.
> 

Gahh! The contortions! Just use "zonename"; if it comes back "global", 
you're in a global zone.  If anything else, you're not.  Attribute is 
"Evolving", is that better than looking for pids?  And maybe one day 
there will be pid 0, 1, 2, 3 in a non-global zone.

CT
___
zones-discuss mailing list
zones-discuss@opensolaris.org


Re: [zones-discuss] how to find global-zone from zone

2007-08-29 Thread Paul Kraus
On 8/29/07, Brandorr <[EMAIL PROTECTED]> wrote:

> In a related, but similar situation. How does one know that they are
> actually in a non-global zone vs a global zone? (Using a committed
> interface).

`ps -ef` and look for pid 0,1,2,3; these should only be visible in a
global zone.

-- 
Paul Kraus
___
zones-discuss mailing list
zones-discuss@opensolaris.org


Re: [zones-discuss] how to find global-zone from zone

2007-08-29 Thread Yanakiev, Vladimir
This is easy:

In the global zone

[EMAIL PROTECTED] zoneadm list
global
labv490-01z3
labv490-01z2
labv490-01z6
labv490-01z7
labv490-01z4
labv490wsz1
labv490wsz2
labv490wsz3
labv490-01z1
[EMAIL PROTECTED]

In the non-global

[EMAIL PROTECTED] zoneadm list
labv490-01z1 

If the output form zoneadm list shows the word "global", you are in the
global zone. If there is no "global", you are in a non-global zone.


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Brandorr
Sent: Wednesday, August 29, 2007 9:27 AM
To: John Chase
Cc: zones-discuss@opensolaris.org
Subject: Re: [zones-discuss] how to find global-zone from zone

On 8/29/07, John Chase <[EMAIL PROTECTED]> wrote:
>
>
>  Remco,
>
>  There is no command to display the Global zone of a non-global zone
>  but there are a few tricks that I have heard of.
>
>  One is to create a file in the zone path of each zone and then read
it
>  from the non-global
>  On the Global
> touch /zone_path/root/etc/global.hostname
>
>  On the non
> ls -l /etc/global*
>
>  -JOhn
>
>
>  Remco Fugers wrote:
>  Hi,
>
>  I was wondering if it's possible to find out to which global zone
>  a zone is related.  (And not from Globalzone point of view!)
>
>  It might happen (as a sysadmin) that you login to a zone but you need
to
> perform maintenance in the global zone ( i.e. Veritas VM -stuff).

In a related, but similar situation. How does one know that they are
actually in a non-global zone vs a global zone? (Using a committed
interface).

-Brian
>
>  Thanks in advance
>
>  Remco
>
>
>  
>
> ___
> zones-discuss mailing list
> zones-discuss@opensolaris.org
>
>
>  --
>
> **
>
>
>   John Chase
>  /___/\ (Technical Support OS Group)
>  _\_ \\ \ Sun Support Services
>  _\__\ \\ /
>  / / \/_/ / Sun Microsystems Inc.
> /___/ / __\//\ 1 Network Drive BLDG 4
> \___\//\ __/ / Burlington, MA 01803-0903
>  /__/ / /\ / M/S UBUR04-268
>  \___/ \\ \ EMail: [EMAIL PROTECTED]
>  \ \ \\ 1-800-USA4-SUN
>  \___\/
>
> **
>
>
> ___
> zones-discuss mailing list
> zones-discuss@opensolaris.org
>


-- 
- Brian Gupta

http://opensolaris.org/os/project/nycosug/
___
zones-discuss mailing list
zones-discuss@opensolaris.org
___
zones-discuss mailing list
zones-discuss@opensolaris.org


Re: [zones-discuss] how to find global-zone from zone

2007-08-29 Thread Björn Sobek
Hi,


we implemented a cron-job in the global zone to run the following srcipt:
#!/bin/ksh

PATH=$PATH:/usr/sbin:/usr/bin

OSVERSION=`uname -r | awk -F. '{print $2}'`

if [ "${OSVERSION}" -gt 9 ]; then
zonename | grep global >/dev/null 2>&1
[ $? -ne 0 ] && exit 0
for i in `zoneadm list -v| awk '{print $4}' | grep -v ^/$ | grep ^/`
do
echo `hostname` > $i/root/etc/globalzone
done
fi


So you have just to do a "cat /etc/globalzone".
 
 
This message posted from opensolaris.org
___
zones-discuss mailing list
zones-discuss@opensolaris.org


Re: [zones-discuss] how to find global-zone from zone

2007-08-29 Thread Steffen Weiberle
 > In a related, but similar situation. How does one know that 
they are
 > actually in a non-global zone vs a global zone? (Using a committed
 > interface).

zonename(1). And zonecfg(1M) states that the name 'global' is 
reserved.

Steffen

Brandorr wrote:
> On 8/29/07, John Chase <[EMAIL PROTECTED]> wrote:
> 
>>
>> Remco,
>>
>> There is no command to display the Global zone of a non-global zone
>> but there are a few tricks that I have heard of.
>>
>> One is to create a file in the zone path of each zone and then read it
>> from the non-global
>> On the Global
>>touch /zone_path/root/etc/global.hostname
>>
>> On the non
>>ls -l /etc/global*
>>
>> -JOhn
>>
>>
>> Remco Fugers wrote:
>> Hi,
>>
>> I was wondering if it's possible to find out to which global zone
>> a zone is related.  (And not from Globalzone point of view!)
>>
>> It might happen (as a sysadmin) that you login to a zone but you need to
>>perform maintenance in the global zone ( i.e. Veritas VM -stuff).
> 
> 
> In a related, but similar situation. How does one know that they are
> actually in a non-global zone vs a global zone? (Using a committed
> interface).
> 
> -Brian
> 
>> Thanks in advance
>>
>> Remco
>>
>>
>> 
>>
>>___
>>zones-discuss mailing list
>>zones-discuss@opensolaris.org
>>
>>
>> --
>>
>>**
>>
>>
>>  John Chase
>> /___/\ (Technical Support OS Group)
>> _\_ \\ \ Sun Support Services
>> _\__\ \\ /
>> / / \/_/ / Sun Microsystems Inc.
>>/___/ / __\//\ 1 Network Drive BLDG 4
>>\___\//\ __/ / Burlington, MA 01803-0903
>> /__/ / /\ / M/S UBUR04-268
>> \___/ \\ \ EMail: [EMAIL PROTECTED]
>> \ \ \\ 1-800-USA4-SUN
>> \___\/
>>
>>**
>>
>>
>>___
>>zones-discuss mailing list
>>zones-discuss@opensolaris.org
>>
> 
> 
> 
___
zones-discuss mailing list
zones-discuss@opensolaris.org


Re: [zones-discuss] how to find global-zone from zone

2007-08-29 Thread Brandorr
On 8/29/07, John Chase <[EMAIL PROTECTED]> wrote:
>
>
>  Remco,
>
>  There is no command to display the Global zone of a non-global zone
>  but there are a few tricks that I have heard of.
>
>  One is to create a file in the zone path of each zone and then read it
>  from the non-global
>  On the Global
> touch /zone_path/root/etc/global.hostname
>
>  On the non
> ls -l /etc/global*
>
>  -JOhn
>
>
>  Remco Fugers wrote:
>  Hi,
>
>  I was wondering if it's possible to find out to which global zone
>  a zone is related.  (And not from Globalzone point of view!)
>
>  It might happen (as a sysadmin) that you login to a zone but you need to
> perform maintenance in the global zone ( i.e. Veritas VM -stuff).

In a related, but similar situation. How does one know that they are
actually in a non-global zone vs a global zone? (Using a committed
interface).

-Brian
>
>  Thanks in advance
>
>  Remco
>
>
>  
>
> ___
> zones-discuss mailing list
> zones-discuss@opensolaris.org
>
>
>  --
>
> **
>
>
>   John Chase
>  /___/\ (Technical Support OS Group)
>  _\_ \\ \ Sun Support Services
>  _\__\ \\ /
>  / / \/_/ / Sun Microsystems Inc.
> /___/ / __\//\ 1 Network Drive BLDG 4
> \___\//\ __/ / Burlington, MA 01803-0903
>  /__/ / /\ / M/S UBUR04-268
>  \___/ \\ \ EMail: [EMAIL PROTECTED]
>  \ \ \\ 1-800-USA4-SUN
>  \___\/
>
> **
>
>
> ___
> zones-discuss mailing list
> zones-discuss@opensolaris.org
>


-- 
- Brian Gupta

http://opensolaris.org/os/project/nycosug/
___
zones-discuss mailing list
zones-discuss@opensolaris.org


Re: [zones-discuss] how to find global-zone from zone

2007-08-29 Thread John Chase


Remco,

There is no command to display the Global zone of a non-global zone
but there are a few tricks that I have heard of.

One is to create a file in the zone path of each zone and then read it
from the non-global
   On the Global
  touch /zone_path/root/etc/global.hostname

   On the non
  ls -l /etc/global*

-JOhn


Remco Fugers wrote:


Hi,

I was wondering if it's possible to find out to which global zone
a zone is related.  (And not from Globalzone point of view!)

It might happen (as a sysadmin) that you login to a zone but you need 
to perform maintenance in the global zone ( i.e. Veritas VM -stuff).


Thanks in advance

Remco




___
zones-discuss mailing list
zones-discuss@opensolaris.org
 



--

**


   John Chase 
   /___/\  (Technical Support OS Group)

  _\_ \\ \ Sun Support Services
 _\__\ \\ /
/   / \/_/ /   Sun Microsystems Inc.

/___/ / __\//\  1 Network Drive BLDG 4
\___\//\ __/ /  Burlington, MA 01803-0903
 /__/ / /\ /   M/S UBUR04-268
 \___/ \\ \EMail:  [EMAIL PROTECTED]
  \   \ \\ 1-800-USA4-SUN 
   \___\/


**

___
zones-discuss mailing list
zones-discuss@opensolaris.org

Re: [zones-discuss] how to find global-zone from zone

2007-08-29 Thread Boyd Adamson
(Replying to the correct thread this time)

"Remco Fugers" <[EMAIL PROTECTED]> writes:
> Hi,
>
> I was wondering if it's possible to find out to which global zone a
> zone is related.  (And not from Globalzone point of view!) It might
> happen (as a sysadmin) that you login to a zone but you need to
> perform maintenance in the global zone ( i.e. Veritas VM -stuff).
>
> Thanks in advance
>
> Remco

This should probably be in the FAQ:

http://www.opensolaris.org/jive/thread.jspa?threadID=35960
___
zones-discuss mailing list
zones-discuss@opensolaris.org


[zones-discuss] how to find global-zone from zone

2007-08-29 Thread Remco Fugers
Hi,

I was wondering if it's possible to find out to which global zone
a zone is related.  (And not from Globalzone point of view!)

It might happen (as a sysadmin) that you login to a zone but you need to
perform maintenance in the global zone (i.e. Veritas VM -stuff).

Thanks in advance

Remco
___
zones-discuss mailing list
zones-discuss@opensolaris.org