sun.com docs.sun.com My Sun Worldwide Sites

Previous Previous     Contents     Index     Next Next

ProcedureHow to Use Command Files With poolcfg

The poolcfg command with the -f option can take input from a text file that contains poolcfg subcommand arguments to the -c option. This method is appropriate when you want a set of operations to be performed. When processing multiple commands, the configuration is only updated if all of the commands succeed. For large or complex configurations, this technique can be more useful than per-subcommand invocations.

Note that in command files, the # character acts as a comment mark for the rest of the line.

  1. Create the input file poolcmds.txt.

    $ cat > poolcmds.txt
    create system tester
    create pset pset_batch (uint pset.min = 2; uint pset.max = 10)
    create pool pool_batch
    associate pool pool_batch (pset pset_batch)

  2. Become superuser, or assume a role that includes the Process Management profile.

    The System Administrator role includes the Process Management profile. For more information about roles, see "Using the Solaris Management Tools With RBAC (Task Map)" in System Administration Guide: Basic Administration.

  3. Execute the command:

    # /usr/sbin/poolcfg -f poolcmds.txt

Transferring Resources

Use the transfer subcommand argument to the -c option of poolcfg with the -d option to transfer resources in the kernel. The -d option specifies that the command operate directly on the kernel and not take input from a file.

The following procedure moves two CPUs from processor set pset1 to processor set pset2 in the kernel.

ProcedureHow to Move CPUs Between Processor Sets

  1. Become superuser, or assume a role that includes the Process Management profile.

    The System Administrator role includes the Process Management profile. For more information about roles, see "Using the Solaris Management Tools With RBAC (Task Map)" in System Administration Guide: Basic Administration.

  2. Move two CPUs from pset1 to pset2.

    The from and to subclauses can be used in any order. Only one to and from subclause is supported per command.

    # poolcfg -dc 'transfer 2 from pset pset1 to pset2'

Example 13-3   Alternative Method to Move CPUs Between Procesor Sets

If specific known IDs of a resource type are to be transferred, an alternative syntax is provided. For example, the following command assigns two CPUs with IDs 0 and 2 to the pset_large processor set:

# poolcfg -dc "transfer to pset pset_large (cpu 0; cpu 2)"

More Information
Troubleshooting

If a transfer fails because there are not enough resources to match the request or because the specified IDs cannot be located, the system displays an error message.

Activating and Removing Pool Configurations

Use the pooladm command to make a particular pool configuration active or to remove the currently active pool configuration. See the pooladm(1M) man page for more information about this command.

ProcedureHow to Activate a Pools Configuration

To activate the configuration in the default configuration file, /etc/pooladm.conf, invoke pooladm with the -c option, "commit configuration."

  1. Become superuser, or assume a role that includes the Process Management profile.

    The System Administrator role includes the Process Management profile. For more information about roles, see "Using the Solaris Management Tools With RBAC (Task Map)" in System Administration Guide: Basic Administration.

  2. Commit the configuration at /etc/pooladm.conf.

    # pooladm -c

  3. (Optional) Copy the dynamic configuration to a static configuration file, for example, /tmp/backup.

    # pooladm -s /tmp/backup

ProcedureHow to Validate a Configuration Before Committing the Configuration

You can use the -n option with the -c option to test what will happen when the validation occurs. The configuration will not actually be committed.

The following command attempts to validate the configuration contained at /home/admin/newconfig. Any error conditions encountered are displayed, but the configuration itself is not modified.

  1. Become superuser, or assume a role that includes the Process Management profile.

    The System Administrator role includes the Process Management profile. For more information about roles, see "Using the Solaris Management Tools With RBAC (Task Map)" in System Administration Guide: Basic Administration.

  2. Test the validity of the configuration before committing it.

    # pooladm -n -c /home/admin/newconfig

ProcedureHow to Remove a Pools Configuration

To remove the current active configuration and return all associated resources, such as processor sets, to their default status, use the -x option for "remove configuration."

  1. Become superuser, or assume a role that includes the Process Management profile.

    The System Administrator role includes the Process Management profile. For more information about roles, see "Using the Solaris Management Tools With RBAC (Task Map)" in System Administration Guide: Basic Administration.

  2. Remove the current active configuration.

    # pooladm -x

    The -x option to pooladm removes all user-defined elements from the dynamic configuration. All resources revert to their default states, and all pool bindings are replaced with a binding to the default pool.

More Information
Mixing Scheduling Classes Within a Processor Set

You can safely mix processes in the TS and IA classes in the same processor set. Mixing other scheduling classes within one processor set can lead to unpredictable results. If the use of pooladm -x results in mixed scheduling classes within one processor set, use the priocntl command to move running processes into a different scheduling class. See How to Manually Move Processes From the TS Class Into the FSS Class. Also see the priocntl(1) man page.

Setting Pool Attributes and Binding to a Pool

You can set a project.pool attribute to associate a resource pool with a project.

You can bind a running process to a pool in two ways:

  • You can use the poolbind command described in poolbind(1M) command to bind a specific process to a named resource pool.

  • You can use the project.pool attribute in the project database to identify the pool binding for a new login session or a task that is launched through the newtask command. See the newtask(1), projmod(1M), and project(4) man pages.

ProcedureHow to Bind Processes to a Pool

The following procedure uses poolbind with the -p option to manually bind a process (in this case, the current shell) to a pool named ohare.

  1. Become superuser, or assume a role that includes the Process Management profile.

    The System Administrator role includes the Process Management profile. For more information about roles, see "Using the Solaris Management Tools With RBAC (Task Map)" in System Administration Guide: Basic Administration.

  2. Manually bind a process to a pool:

    # poolbind -p ohare $$

  3. Verify the pool binding for the process by using poolbind with the -q option.

    $ poolbind -q $$
    155509 ohare

    The system displays the process ID and the pool binding.

Previous Previous     Contents     Index     Next Next
Company Info Contact Terms of Use Privacy Copyright 1994-2007 Sun Microsystems, Inc.