Sun N1 Service Provisioning System 5.1 Command-Line Interface Reference Manual

Chapter 10 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 10–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 10–2 Argument and Result of the pe.h.prep Command

Argument/Result 

Syntax 

Description 

tar 

[R] 

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 10–3 Arguments and Result for the pe.p.en Command

Argument/Result 

Syntax 

Description 

ID 

[R] 

StepID 

Which step in the plan to display. This can be gathered from the output of the pe.p.lo command.

output 

[O] 

Either “so” or “se” 

Show only stdout or stderr. Default: only stdout shown. 

result 

UIExecNativeOutput 

Output of the step. 

pe.p.la

This command lists running and completed plans.

Table 10–4 Arguments and Result for the pe.p.la Command

Argument/Result 

Syntax 

Description 

max 

[O] 

Integer 

The maximum number of plans to list. This argument is ignored if there are more running plans than the given number. 

plan 

[O] 

String 

Restrict results to plans with this name 

result 

RunningPlan- BeanArray 

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 10–5 Arguments for the pe.p.lo Command

Argument 

Syntax 

Description 

ID 

[R] 

TaskID 

The ID of the plan run to view 

old 

[O] 

Boolean 

Whether to show old messages; default is false 

new 

[O] 

Boolean 

Whether to poll for new messages; default is true 

pe.p.del

This command deletes the history of a completed plan run.

Table 10–6 Arguments for the pe.p.del Command

Argument 

Syntax 

Description 

ID 

[R] 

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 10–7 Argument and Result for the pe.p.lp Command

Argument/Result 

Syntax 

Description 

ID

[R] 

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 10–8 Arguments and Result for the pe.p.run Command

Argument/Result 

Syntax 

Description 

PID 

[R] 

ExecutionPlanID 

The ID of the execution plan to run 

tar 

[R] 

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 

[O] 

Boolean 

True if only preflight should be run 

pdp 

[O] 

Boolean 

True if detailed preflight should be run; default false. 

hr1 

[O] 

Integer 

Limit number of hosts running at the same time; default set by server config file. 

pto 

[R] 

TimeInterval 

The maximum plan execution time 

nto 

[R] 

TimeInterval 

The maximum native call execution time 

[O] 

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 10–1 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 10–2 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 10–9 Argument and Result for the pe.p.stop Command

Argument/Result 

Syntax 

Description 

ID 

[R] 

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 10–10 Argument and Result of the pe.pi.lo Command

Argument/Result 

Syntax 

Description 

ID 

[R] 

TaskID 

The ID of the plan run. 

result 

TaskInfo 

The plan run parameters