Finding capped memory of a non global zone


 
Thread Tools Search this Thread
Operating Systems Solaris Finding capped memory of a non global zone
# 1  
Old 10-15-2014
Finding capped memory of a non global zone

Is there a way to find the capped memory of a solaris non global zone from the non global zone itself (given rcapd is disabled)
# 2  
Old 10-15-2014
Code:
zonestat -z zonename -r physical-memory 2

from inside the zone - only works for later versions of Solaris 10.

or --

Code:
ssh globalzone '/usr/sbin/zonecfg -z zonename info'

# 3  
Old 10-15-2014
I'm working on solaris 10 and zonestat is not available.
I was looking for a way to retrieve the info from the non global zone itself rather than from the global. Isn't this info stored somewhere inside the zone from where it could be read?
# 4  
Old 10-15-2014
Not really for a regular user. It is /etc/zones/zonename.xml only visible from the global zone.

Sun took extra care to be sure there is no way to "escape" directly from the virtual machine (zone) into the controlling domain. That would create a horrible security hole. And some data must exist locally in kernel or zsched memory, which requires privileged access.

Use ssh - that reads directly from the global zone via a "proxy". I don't get your requirement for local access. Unless you are a programmer writing code and cannot access the global zone. If so, then if the mcap is absolutely required you will have to work with your sysadmin on that requirement. S/he may write some code for you or "place" a file just after boot time:

Code:
cp /etc/zones/*.xml /etc/zones/zonename/root/tmp/

Which is a small security issue, compared to granting users access. You would then see the file you need in /tmp. This does not accomodate the use of prctl to dynamically change zone resource control values during runtime.

Code:
grep 'mcap_physcap' /etc/zones/zonename.xml
<mcap physcap="34359738368"/>

so
Code:
mcap=$(ssh zonename "grep 'mcap_physcap' /etc/zones/${zonename}.xml" )

You can then parse the number in the variable mcap.

Last edited by jim mcnamara; 10-15-2014 at 12:38 PM..
This User Gave Thanks to jim mcnamara For This Post:
# 5  
Old 10-15-2014
Show the resource controls that the current shell inherits:
Code:
prctl -P $$

This User Gave Thanks to MadeInGermany For This Post:
# 6  
Old 10-16-2014
Jim, I am writing code that runs on the local zone and cannot access the global zone. So copying or ssh is not an option. I do have root access but I can't find a command that can fetch this info for me.

MadeInGermany,

prctl -P $$ - I could not find the Physical memory cap data in this.

There are other data like swap, locked memory cap etc

zone.max-swap privileged 536870912 - deny -
zone.max-locked-memory privileged 54525952 - deny -
..
# 7  
Old 11-07-2014
well it's kind of a hack but when you look at top in the zone. The memory line shows the capped memory....
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

Solaris 11 zone has no external network access (except to Global Zone)

Hi, hoping someone can help, its been a while since I used Solaris. After creating a NGZ (non global zone), the NGZ can access the GZ (Global Zone) and the GZ can access the NGZ (using ssh, zlogin) However, the NGZ cannot access any other netwqork devices, it can't even see the default router ... (2 Replies)
Discussion started by: GazinLincoln
2 Replies

2. Solaris

Date and time change in global and non global zone

Hi, If I change date and time in global zone, then it will affect in non global zones. During this process what files will get affect in non global zones and which mechanism it's using to change. gloabl zone:Solaris 11.3 X86 TIA (1 Reply)
Discussion started by: Sumanthsv
1 Replies

3. Solaris

Global and non-global zone resource sharing - tricky

hi all, Just a simple question but i cant get the answers in the book - In my globalzone , assuming i have 4 cpus (psrinfo -pv = 0-3), if i set dedicated-cpu (ncpus=2) for my local zone Is my globalzone left with 2 cpus or still 4 cpus ? Does localzone "resource reservation.e.g. cpu in... (6 Replies)
Discussion started by: javanoob
6 Replies

4. Solaris

zone breaching 'capped-memory' threshold

Calling upon all Solaris zone experts. I have a Sun T3-1 that is running a few whole-root zones. I've set the 'capped-memory' setting on all the zones. However, I have a problem on the one zone. Under load it uses more memory that has been allocated to it. zonecfg -z sunrep02 export ... (4 Replies)
Discussion started by: soliberus
4 Replies

5. Solaris

Finding the global zone name

Hi im in a local zone which command if i execute in the local zone will show the global zone name Thanks (6 Replies)
Discussion started by: newtoaixos
6 Replies

6. Solaris

How to access ENV variables of non global zones in global zone???

Hi Guys, My requirement is I have file called /opt/orahome/.profile in non global zone. PATH=/usr/bin:/usr/ucb:/etc:/usr/sbin:/usr/local/bin:/usr/openwin/bin:. export PATH PS1="\${ORACLE_SID}:`hostname`:\$PWD$ " export PS1 EDITOR=vi export EDITOR ENV=/opt/orahome/.kshrc export ENV... (1 Reply)
Discussion started by: vijaysachin
1 Replies

7. Solaris

[b]How to mount a folder from global zone to non global zone??

Hi All There is one folder in global zone I just want to share the same folder innon global zone. How can i do it? pls send me script for this. (2 Replies)
Discussion started by: vijaysachin
2 Replies

8. Solaris

Reserve Memory for Global Zone

We have several containers on one machine and would like to reserve some memory for the global zone. capped-memory only allows max physical/swap and setting a max on each container isn't an option. The server has 32GB physical and 30GB swap. Currently there are ten containers on it. Normally... (6 Replies)
Discussion started by: kharjahn
6 Replies

9. Solaris

capped-memory in zone

How does capped-memory work in zones? I have 32G of memory and 10 zones. I want about physical=4G and swap=4G in each zone. Is this possible? I am going over the 32G. (1 Reply)
Discussion started by: photon
1 Replies
Login or Register to Ask a Question