On Thu 18 Dec 2008 at 09:20AM, Prabhanand wrote:
> I would like do create/modify/delete operations on zone and resource
> management programatically using C/C++ code. Is there any sample code
> from which i get an some idea?
Prabhanand, at present there is not a documented API for doing
so for zones. We hope to provide one in the future. We recommend
calling out to the command line interfaces using popen(3c). Also,
please note that zoneadm(1m) has a parseable output mode for list, -p,
which is the stable way to consume its output.
Depending on which parts of resource management you are interested
in, there are APIs for most of the functionality. You might
want to look at libexacct(3lib) for extended accounting,
at priocntl(2) for scheduler stuff, libpool(3lib) for resource
pools, and setrctl(2) for resource controls. There is a lot to
know, and it is complicated. If you just want to do RM for
your zones, I recommend using the RM settings built-in to the
zones framework starting with S10 Update 4.
-dp
--
Daniel Price - Solaris Kernel Engineering - dp at eng.sun.com - blogs.sun.com/dp