 |
» |
|
|
 |
CPU Allocation Syntax In Brief |  |
To understand how to assign CPUs, you need to understand the command
syntax. Below is a brief explanation of the CPU allocation syntax
for the vparcreate command. For complete information, see the vparcreate(1M), vparmodify(1M),
and vparresources(5) manpages. The vparcreate syntax for CPU allocation is: vparcreate -ppartition_name [-acpu::total] [-acpu:::[min][:[max]]]] [[-acpu:hw_path]...] where min is the number of CPUs bound to partition_name. The default is 1. total is the total number of bound plus unbound CPUs assigned to
partition_name. The default is 1. max is the maximum number of bound plus unbound CPUs
that potentially can be added to the partition. The default is the number
of CPUs in the computer.[3] hw_path is the hardware path of a bound CPU. If not specified, the
monitor chooses the hardware path.
Note on vparmodify SyntaxThe vparmodify command follows a similar syntax, except vparmodify allows the -m(modify) option as well
as the -a(add) option. With the -moption, the number used with the
-mis an absolute number. For
example, -m cpu::3 represents an absolute number of three total CPUs; in this case, it sets the total number of CPUs (bound plus unbound) to three. With the -aoption (as well as the -doption),
the number used with the -ais a relative number
of CPUs (relative to the number of CPUs already assigned to the
partition). For example, -a cpu::3 represents three CPUs relative to the number of existing
CPUs; in this case, -a cpu::3 adds three additional unbound CPUs
to the number of unbound CPUs already assigned to the partition. Adding a CPU as a Bound CPU |  |
All CPUs begin as not being assigned to
any partition, so all CPUs begin as unbound CPUs. However, you can
assign CPUs as bound CPUs to the partition by specifying the min number in the -acpu:::min command line option. ExamplesTo create a virtual partition winona2 with
two bound CPUs: winona1# vparcreate -p winona2 -a cpu::2 -a cpu:::2 In this example, the total number of CPUs assigned to the partition is two (-a cpu::2). Of these two CPUs, two are bound because min is set to two (-a cpu:::2). If the partition already exists, you can use the vparmodify command to set the number of bound CPUs. For example,
to increase the number of bound CPUs from two to three: winona1# vparmodify -p winona2 -m cpu::3 -m cpu:::3
Choosing the
Hardware Path of a Bound CPUBy default, the vPars monitor chooses the hardware path of
a bound CPU. However, if you need to use a specific CPU, you can
specify its hardware path by using the -acpu:hw_path option. ExamplesIn the command winona1# vparcreate -p winona2 -a cpu::2 -a cpu:::2 the virtual partition winona2 has
two bound CPUs. If you want the CPU at hardware path 41 to
be one of the two bound CPUs, specify the hardware path 41 (-a cpu:41) such that the command line is: winona1# vparcreate -p winona2 -a cpu::2 -a cpu:::2 -a cpu:41 If you want to specify multiple processors, use
the -acpu:hw_path option for each hardware path. For example, if you
want to specify the CPU at hardware path 41 and
the CPU at hardware path 45, the command
is: winona1# vparcreate -p winona2 -a cpu::2 -a cpu:::2 -a cpu:41 -a cpu:45 Note that because there are two paths specified, min must be greater than or equal to two. Further, because
there are at least two bound CPUs, total must be at least two.
Removing a Bound CPU |  |
To remove a bound CPU from
a partition, use the vparmodify command to modify the total and min parameters for the virtual partition. ExampleIf the partition winona2 has
two bound CPUs and you want only one bound CPU (and you do not want
to add any unbound CPUs), set the total and min numbers to one: winona1# vparmodify -p winona2 -m cpu:::1 -m cpu::1 NOTE: If you set only the min number to one and leave the total number set at two, you will still have two CPUs assigned
to winona2. One bound CPU will be removed
from the partition, but one unbound CPU will be added to
the partition in order to maintain the total of two CPUs. NOTE: Because one of the value requirements for CPUs is min <= total and because command line options are processed left
to right, when setting both min and total to one, you need to set min to one before setting total to one. This is accomplished by specifying the -m cpu:::min option before the -m cpu::total option.
Migrating an Unbound CPU |  |
After min bound CPUs are assigned to a partition, (total - min) CPUs are assigned to the partition as unbound CPUs.
Therefore, to migrate unbound CPUs, specify total such that (total-min) is the number of unbound CPUs assigned to the target
partition. ExamplesTo create the partition winona2 with
two bound CPUs and one unbound CPU, set total to three and min to two: # vparcreate -p winona2 -a cpu::3 -a cpu:::2 To add an unbound CPU to an existing partition,
use the vparmodify command to either modify the total number of CPUs (-m cpu::total) or add to the total number of CPUs (-acpu::total). For example, to add one unbound CPU to the partition winona2, which
already has three CPUs, two of which are bound, you can either modify total to four: winona1# vparmodify -p winona2 -m cpu::4 or add one to total: winona1# vparmodify -p winona2 -a cpu::1 To delete one unbound CPU from the partition winona2,
which already has four CPUs: winona1# vparmodify -p winona2 -m cpu::3 or winona1# vparmodify -p winona2 -d cpu::1 Because you can dynamically migrate unbound CPUs,
you can migrate an unbound CPU from one partition to another while
both partitions are running. For example, if the partition winona1 has
two bound CPUs and the partition winona2 has
two bound and two unbound CPUs, you can migrate an unbound CPU from winona2 to winona1 using
the following: winona1# vparmodify -p winona2 -d cpu::1 winona1# vparmodify -p winona1 -a cpu::1
 |  |  |  |  | NOTE: For more information on CPUs, see the following: |  |  |  |  |
|