Re: [zones-discuss] Zones and Resource Pools

2007-01-17 Thread Jeff Victor

James Carlson wrote:

Jeff Victor writes:
Information about zone->pool assignment 'feels' like it belongs in "zoneadm 
list" output (analogous to zonepath),


It certainly doesn't "feel" that way to me.

I expect "zoneadm list" to produce the information that's *crucial*
for the operation of the zone.  It's the stuff that defines the
identity and location of the zone.


Having realized that one could argue both sides of that, the more I think 
about it the more I like the "containerstat" concept.  I hope to find time to 
ponder that and submit an RFE.


--
Jeff VICTOR  Sun Microsystemsjeff.victor @ sun.com
OS AmbassadorSr. Technical Specialist
Solaris 10 Zones FAQ:http://www.opensolaris.org/os/community/zones/faq
--
___
zones-discuss mailing list
zones-discuss@opensolaris.org


Re: [zones-discuss] Zones and Resource Pools

2007-01-17 Thread James Carlson
Jeff Victor writes:
> Information about zone->pool assignment 'feels' like it belongs in "zoneadm 
> list" output (analogous to zonepath),

It certainly doesn't "feel" that way to me.

I expect "zoneadm list" to produce the information that's *crucial*
for the operation of the zone.  It's the stuff that defines the
identity and location of the zone.

Just as I don't expect zoneadm to list what processes are running in a
given zone, or what IP addresses are configured, I don't expect it to
list out pool assignments or other ancillary run-time information.  I
expect to use pool-resource-related tools (perhaps with Zones
extensions) to do that, or zonecfg if I'm interested in the start-time
configuration of the zone.

-- 
James Carlson, Solaris Networking  <[EMAIL PROTECTED]>
Sun Microsystems / 1 Network Drive 71.232W   Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757   42.496N   Fax +1 781 442 1677
___
zones-discuss mailing list
zones-discuss@opensolaris.org


Re: [zones-discuss] Zones and Resource Pools

2007-01-17 Thread Jerry Jelinek

Phil Freund wrote:

I have started using resource pools to limit the number of CPUs available to a 
zone. I'm trying to find a way to track the pool assignment info and have the 
following questions:

Is there a command that will tell me which pools my zones are assigned to or do I have to 
check in each zone config for the value listed in the "pool=" parameter of the 
zone name?

Is there any pool related command that will tell me which resources, including 
zones, are assigned to each pool?


Although you can bind a zone to a pool, behind the scenes the system
does not really track a zone-to-pool binding.  This is managed at
the process level.  You can look at the zones to see what pools
they are assigned to but that information might not be correct
since the zone can be dynamically bound to a different pool using
poolbind(1M).

I have attached the source to a small program I wrote which prints
some resource management information about processes.  Most of
this is available via ps(1), but pool binding is not, so you might
find this useful.  You could trim the code down to only print the
pool binding for the 'init' process in each zone and that would give
you a good idea which pool the running zone is currently bound to.

We have talked about improving zone observability for stuff like this
but we haven't gotten that project off the ground yet.

Jerry
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

static void
pr_pid(boolean_t pactive)
{
	DIR *dirp;
	int procfd;
	dirent_t *dent;
	psinfo_t ps;
	struct project *pp, proj;
	char zname[ZONENAME_MAX];
	char procpath[MAXPATHLEN];
	char pname[32];
	char buf[1024];

	if ((dirp = opendir("/proc")) == NULL) {
		perror("can't open /proc");
		exit(1);
	}

	printf("%6s %6s %3s %12s %8s %12s %4s %s\n", "pid", "ppid",
	"tsk", "project", "zone", "pool", "schd", "process");
	while ((dent = readdir(dirp)) != NULL) {
		if (dent->d_name[0] == '.')
			continue;

		(void) snprintf(procpath, sizeof (procpath), "/proc/%s/psinfo",
		dent->d_name);

		if ((procfd = open(procpath, O_RDONLY)) == -1)
			continue;

		if (read(procfd, &ps, sizeof (ps)) == sizeof (psinfo_t)) {
			getzonenamebyid(ps.pr_zoneid, zname, sizeof (zname));
			pp = getprojbyid(ps.pr_projid, &proj, buf,
			sizeof (buf));
			if (pp == NULL)
snprintf(pname, sizeof (pname), "%d",
ps.pr_projid);
			else
strlcpy(pname, pp->pj_name, sizeof (pname));
			printf("%6d %6d %3d %12s %8s %12s %4s %s\n",
			ps.pr_pid, ps.pr_ppid,
			ps.pr_taskid, pname,
			zname,
			(pactive ? pool_get_binding(ps.pr_pid) : ""),
			ps.pr_lwp.pr_clname,
			ps.pr_fname);
		}

		(void) close(procfd);
	}

	closedir(dirp);
}

main(int argc, char **argv)
{
	int status;
	boolean_t pactive = B_FALSE;

	if (pool_get_status(&status) == PO_SUCCESS && status == POOL_ENABLED)
		pactive = B_TRUE;

	pr_pid(pactive);
}
___
zones-discuss mailing list
zones-discuss@opensolaris.org

Re: [zones-discuss] Zones and Resource Pools

2007-01-17 Thread Jeff Victor

Phil Freund wrote:

I have started using resource pools to limit the number of CPUs available
to a zone. I'm trying to find a way to track the pool assignment info and
have the following questions:

Is there a command that will tell me which pools my zones are assigned to
or do I have to check in each zone config for the value listed in the
"pool=" parameter of the zone name?


I can't think of a command which will do this - though it seems to me that it 
would be a useful tool - but the same functionality could be scripted with a 
combination of zonecfg and pooladm.


Information about zone->pool assignment 'feels' like it belongs in "zoneadm 
list" output (analogous to zonepath), but leads us further down the slippery 
slope of "what *else* belongs in there?"  We might end up with a -o option to 
zoneadm similar to ps, and I'm not sure that's a Good Idea.


Perhaps a "containeradm" (or "constat") command is needed to manage or at 
least display information regarding containers.


Project Duckhorn will simplify some of this, see opensolaris.org.


Is there any pool related command that will tell me which resources,
including zones, are assigned to each pool?

TIA, Phil


Pooladm is as close as it gets.

I can't find an RFE for these.  If there isn't a command or simple solution, 
I'll create an RFE.


--
Jeff VICTOR  Sun Microsystemsjeff.victor @ sun.com
OS AmbassadorSr. Technical Specialist
Solaris 10 Zones FAQ:http://www.opensolaris.org/os/community/zones/faq
--
___
zones-discuss mailing list
zones-discuss@opensolaris.org


[zones-discuss] Zones and Resource Pools

2007-01-17 Thread Phil Freund
I have started using resource pools to limit the number of CPUs available to a 
zone. I'm trying to find a way to track the pool assignment info and have the 
following questions:

Is there a command that will tell me which pools my zones are assigned to or do 
I have to check in each zone config for the value listed in the "pool=" 
parameter of the zone name?

Is there any pool related command that will tell me which resources, including 
zones, are assigned to each pool?

TIA,
Phil
 
 
This message posted from opensolaris.org
___
zones-discuss mailing list
zones-discuss@opensolaris.org