Chapter 11 pe: CLI Commands for Running
Plans
This chapter describes the commands that you need to use to run plans.
Overview of the pe Commands
The pe commands provide tools for running, stopping, and monitoring
plans.
Table 11–1 Summary of the
pe Commands
|
Command
|
Description
|
|
pe.h.prep
|
Prepares a set of hosts.
|
|
pe.p.en
|
Displays the output of an <execNative> or an <execJava> step.
|
|
pe.p.la
|
Lists running and completed plans.
|
|
pe.p.lo
|
Lists information about a running or completed plan.
|
|
pe.p.del
|
Deletes the history of a completed plan run.
|
|
pe.p.lp
|
Lists the subplans and targets associated with a plan.
|
|
pe.p.run
|
Runs a plan.
|
|
pe.p.stop
|
Stops a plan that is currently running.
|
|
pe.pi.lo
|
Lists the parameters used to run a plan.
|
pe.h.prep
This command prepares a set of hosts.
Table 11–2 Argument and Result of the
pe.h.prep Command
|
Argument/Result
|
Syntax
|
Description
|
|
tar
|
Required
|
HostIDSet
|
A comma-separated list of host IDs to prepare
|
|
result
|
TaskID
|
The ID of the preparation plan run
|
pe.p.en
This command displays the output of an <execNative> or
an <execJava> step.
Table 11–3 Arguments and Result for the
pe.p.en Command
|
Argument/Result
|
Syntax
|
Description
|
|
ID
|
Required or Optional
|
StepDescriptionContainer
|
Which step in the plan to display. This can be gathered from the output
of pe.p.lo command or specified by label.
|
|
IDs
|
Required or Optional
|
StepDescriptionContainerArray
|
Which steps in the plan to display. These can be gathered from the output
of pe.p.lo command or specified by label. IDs must be specified if ID is not.
If both ID and IDs is specified, IDs is ignored.
|
|
output
|
Optional
|
Either “so” or “se”
|
Here for backward compatibility. The output will contain both the
standard error and standard out. When available the exit status is also included.
|
|
result
|
ExecNativeOutputArray
|
Output of the step or steps indicated.
|
Examples Using the Command
A StepDescriptionContainer can be either a stepID
or a Label. You should use a single StepDescriptionContainer for
the -ID argument. The -IDs argument should
be a comma-separated list of StepDescriptionContainers. The
examples use the following information to create valid commands.
- taskID
-
1001
- stepID
-
2011 with a label value of label1
2012 with a label value of label2
- hostID
-
3001 with a hostname of host1
Example 11–1 Using a Step ID
./cr_cli -cmd pe.p.en -ID ID:2011
./cr_cli -cmd pe.p.en -ID 2011
|
Example 11–2 Using a Label
./cr_cli -cmd pe.p.en -ID L:label1:1001:NM:host1
./cr_cli -cmd pe.p.en -ID L:label1:ID:1001:ID:3001
|
Example 11–3 Using a StepDescriptionContainerArray
In this example one element is a step id and the other is a label.
./cr_cli -cmd pe.p.en -IDs L:label1:ID:1001:ID:3001,2012
|
pe.p.la
This command lists running and completed plans.
Table 11–4 Arguments and Result for the
pe.p.la Command
|
Argument/Result
|
Syntax
|
Description
|
|
max
|
Optional
|
Integer
|
The maximum number of plans to list The default is 5. This argument
is ignored if there are more running plans than the given number (in this
case , all running plans are listed). If the number of running plans is less
than the maximum specified, the sum of all running plans and completed plans
up to the maximum specified is returned.
|
|
plan
|
Optional
|
String
|
Restrict results to plans with this name
|
|
result
|
RunningPlanBeanArray
|
All the running plans and some completed ones
|
pe.p.lo
This command reports on the status of a plan that is running or that
has finished running. It displays the StepID of each step.
Table 11–5 Arguments for the
pe.p.lo Command
|
Argument
|
Syntax
|
Description
|
|
ID
|
Required
|
TaskID
|
The ID of the plan run to view
|
|
old
|
Optional
|
Boolean
|
Whether to show old messages; default is false
|
|
new
|
Optional
|
Boolean
|
Whether to poll for new messages; default is true
|
pe.p.del
This command deletes the history of a completed plan run.
Table 11–6 Arguments for the
pe.p.del Command
|
Argument
|
Syntax
|
Description
|
|
ID
|
Required
|
TaskID
|
The ID of the plan run to delete
|
pe.p.lp
This command lists the subplans and targets associated with a plan.
The named plan is listed first.
Table 11–7 Argument and Result for the
pe.p.lp Command
|
Argument/Result
|
Syntax
|
Description
|
|
ID
|
Required
|
ExecutionPlanID
|
The ID of the execution plan
|
|
result
|
SubplanPrompt- Array
|
Array of subplans and targets
|
pe.p.run
This command runs a plan. If there are plan prompt variables, it interactively
queries the user for responses.
When you run a composite plan through the CLI, you must specify a set
of targets, component versions, and variable sets for each subplan. See Appendix A, Input Types for further description
of the syntax.
Table 11–8 Arguments and Result for the
pe.p.run Command
|
Argument/Result
|
Syntax
|
Description
|
|
PID
|
Required
|
ExecutionPlanID
|
The ID of the execution plan to run
|
|
tar
|
Required
|
HostIDArrayArray
|
Individual hosts or host sets on which to run the plan and each of its
subplans, ordered according to subplan prompts
|
|
comp
|
[O/R]
|
StringArrayArray
|
Component versions to install as a part of the plan and subplans. Versions
are ordered according to component selectors within subplan prompts. Each
referenced component must be represented in this list.
Use the component version number, or "+" for default, "#" for recommended,
and "-" for latest. Do not specify when there are no component versions.
|
|
vs
|
[O/R]
|
StringArrayArray
|
Variable settings to use with each selected component version.
Use variable settings name, or "+" for default. Do not specify when
there are no variable settings.
|
|
po
|
Optional
|
Boolean
|
True if only preflight should be run
|
|
pdp
|
Optional
|
Boolean
|
True if detailed preflight should be run; default false.
|
|
hrl
|
Optional
|
Integer
|
Limits the number of hosts running at the same time; default set by
server config file.
|
|
pto
|
Required
|
TimeInterval
|
The maximum plan execution time
|
|
nto
|
Required
|
TimeInterval
|
The maximum native call execution time
|
|
f
|
Optional
|
ReaderWrapper
|
Plan variables can be passed with a file or standard input; default
is standard input
|
|
result
|
TaskID
|
The ID of the plan run
|
Example 11–4 Running a Plan With a Single Subplan, Component,
and Variable Set
This example demonstrates a simple plan being run on one host.
- Plan name
-
/test/test1
- Host targeted by plan
-
masterserver
- Variable set name
-
nors
- Maximum time for plan execution
-
30 minutes
- Maximum time for native call execution
-
10 minutes
- Component versions to be used
-
default
For a single component and variable set, you do not need to surround
the value with quotation marks.
./cr_cli -cmd pe.p.run -PID NM:/test/test1 -tar H:NM:masterserver \
-vs nors -pto 30 -nto 10 -comp + -u admin -p admin
|
Example 11–5 Running a Plan With More Than One SubPlan, Component,
and Variable Set
This example demonstrates a composite plan with two subplans.
subplan1 install compA install compB subplan2 install compC install compD
|
Each subplan is run on a different host and uses two different variable
sets for each referenced component.
- Plan name
-
/test/test2
- Hosts targeted by plan
-
masterserver and host2
- Variable set names for subplan 1
-
nors and tmc
- Variable set names for subplan 2
-
varset1 and varset2
- Maximum time for execution
-
30 minutes
- Maximum time for native call execution
-
10 minutes
- Component versions to be used
-
default
./cr_cli -cmd pe.p.run -PID NM:/test/test2 \
-tar "H:NM:masterserver;H:NM:host2" -vs "nors,tmc;varset1,varset2" \
-pto 30 -nto 10 -comp "+,+;+,+" -u admin -p admin
|
pe.p.stop
This command stops a plan that is running.
Table 11–9 Argument and Result for the
pe.p.stop Command
|
Argument/Result
|
Syntax
|
Description
|
|
ID
|
Required
|
TaskID
|
The ID of the plan to stop running.
|
|
result
|
Boolean
|
True if the plan was stopped successfully.
|
pe.pi.lo
This command lists the parameters used to run a plan.
Table 11–10 Argument and Result of the
pe.pi.lo Command
|
Argument/Result
|
Syntax
|
Description
|
|
ID
|
Required
|
TaskID
|
The ID of the plan run.
|
|
result
|
TaskInfo
|
The plan run parameters
|