AWS ParallelCluster CLI commands

pcluster is the AWS ParallelCluster CLI and permits to launch and manage HPC clusters in the AWS cloud.

usage: pcluster [-h]
                {create,update,delete,start,stop,status,list,instances,ssh,createami,configure,version}
                ...

Positional Arguments

command Possible choices: create, update, delete, start, stop, status, list, instances, ssh, createami, configure, version

Sub-commands:

create

Creates a new cluster.

pcluster create [-h] [-c CONFIG_FILE] [-r REGION] [-nw] [-nr]
                [-u TEMPLATE_URL] [-t CLUSTER_TEMPLATE] [-p EXTRA_PARAMETERS]
                [-g TAGS]
                cluster_name

Positional Arguments

cluster_name name for the cluster. The CloudFormation Stack name will be parallelcluster-[cluster_name]

Named Arguments

-c, --config alternative config file
-r, --region region to connect to
-nw, --nowait

do not wait for stack events, after executing stack command

Default: False

-nr, --norollback
 

disable stack rollback on error

Default: False

-u, --template-url
 specify URL for the custom CloudFormation template, if it has been used at creation time
-t, --cluster-template
 cluster template to use
-p, --extra-parameters
 add extra parameters to stack create
-g, --tags tags to be added to the stack

When the command is called and it starts polling for status of that call it is safe to “Ctrl-C” out. You can always return to that status by calling “pcluster status mycluster”.

Examples:

$ pcluster create mycluster
$ pcluster create mycluster --tags '{ "Key1" : "Value1" , "Key2" : "Value2" }'

update

Updates a running cluster by using the values in the config file or a TEMPLATE_URL provided.

pcluster update [-h] [-c CONFIG_FILE] [-r REGION] [-nw] [-nr]
                [-u TEMPLATE_URL] [-t CLUSTER_TEMPLATE] [-p EXTRA_PARAMETERS]
                [-rd]
                cluster_name

Positional Arguments

cluster_name name of the cluster to update

Named Arguments

-c, --config alternative config file
-r, --region region to connect to
-nw, --nowait

do not wait for stack events, after executing stack command

Default: False

-nr, --norollback
 

disable CloudFormation Stack rollback on error

Default: False

-u, --template-url
 URL for a custom CloudFormation template
-t, --cluster-template
 specific cluster template to use
-p, --extra-parameters
 add extra parameters to stack update
-rd, --reset-desired
 

reset the current ASG desired capacity to initial config values

Default: False

When the command is called and it starts polling for status of that call it is safe to “Ctrl-C” out. You can always return to that status by calling “pcluster status mycluster”

delete

Deletes a cluster.

pcluster delete [-h] [-c CONFIG_FILE] [-r REGION] [-nw] cluster_name

Positional Arguments

cluster_name name of the cluster to delete

Named Arguments

-c, --config alternative config file
-r, --region region to connect to
-nw, --nowait

do not wait for stack events, after executing stack command

Default: False

When the command is called and it starts polling for status of that call it is safe to “Ctrl-C” out. You can always return to that status by calling “pcluster status mycluster”

start

Starts the compute fleet for a cluster that has been stopped.

pcluster start [-h] [-c CONFIG_FILE] [-r REGION] cluster_name

Positional Arguments

cluster_name starts the compute fleet of the provided cluster name

Named Arguments

-c, --config alternative config file
-r, --region region to connect to

This command sets the Auto Scaling Group parameters to either the initial configuration values (max_queue_size and initial_queue_size) from the template that was used to create the cluster or to the configuration values that were used to update the cluster since creation.

stop

Stops the compute fleet, leaving the master server running.

pcluster stop [-h] [-c CONFIG_FILE] [-r REGION] cluster_name

Positional Arguments

cluster_name stops the compute fleet of the provided cluster name

Named Arguments

-c, --config alternative config file
-r, --region region to connect to

Sets the Auto Scaling Group parameters to min/max/desired = 0/0/0 and terminates the compute fleet. The master will remain running. To terminate all EC2 resources and avoid EC2 charges, consider deleting the cluster.

status

Pulls the current status of the cluster.

pcluster status [-h] [-c CONFIG_FILE] [-r REGION] [-nw] cluster_name

Positional Arguments

cluster_name Shows the status of the cluster with the provided name.

Named Arguments

-c, --config alternative config file
-r, --region region to connect to
-nw, --nowait

do not wait for stack events, after executing stack command

Default: False

list

Displays a list of stacks associated with AWS ParallelCluster.

pcluster list [-h] [-c CONFIG_FILE] [-r REGION]

Named Arguments

-c, --config alternative config file
-r, --region region to connect to

Lists the Stack Name of the CloudFormation stacks named parallelcluster-*

instances

Displays a list of all instances in a cluster.

pcluster instances [-h] [-c CONFIG_FILE] [-r REGION] cluster_name

Positional Arguments

cluster_name Display the instances for the cluster with the provided name.

Named Arguments

-c, --config alternative config file
-r, --region region to connect to

ssh

Run ssh command with username and IP address pre-filled. Arbitrary arguments are appended to the end of the ssh command. This command may be customized in the aliases section of the config file.

pcluster ssh [-h] [-d] cluster_name

Positional Arguments

cluster_name name of the cluster to connect to

Named Arguments

-d, --dryrun

print command and exit

Default: False

Example:

$ pcluster ssh mycluster -i ~/.ssh/id_rsa

results in an ssh command with username and IP address pre-filled:

$ ssh ec2-user@1.1.1.1 -i ~/.ssh/id_rsa

SSH command is defined in the global config file, under the aliases section and can be customized:

[aliases]
ssh = ssh {CFN_USER}@{MASTER_IP} {ARGS}

Variables substituted:

{CFN_USER}
{MASTER_IP}
{ARGS} (only if specified on the cli)

createami

(Linux/OSX) Creates a custom AMI to use with AWS ParallelCluster.

pcluster createami [-h] -ai BASE_AMI_ID -os BASE_AMI_OS
                   [-ap CUSTOM_AMI_NAME_PREFIX] [-cc CUSTOM_AMI_COOKBOOK]
                   [-c CONFIG_FILE] [-r REGION]

Named Arguments

-ai, --ami-id specify the base AMI to use for building the AWS ParallelCluster AMI
-os, --os specify the OS of the base AMI. Valid values are alinux, ubuntu1404, ubuntu1604, centos6 or centos7
-ap, --ami-name-prefix
 

specify the prefix name of the resulting AWS ParallelCluster AMI

Default: “custom-ami-“

-cc, --custom-cookbook
 specify the cookbook to use to build the AWS ParallelCluster AMI
-c, --config alternative config file
-r, --region region to connect to

configure

Start initial AWS ParallelCluster configuration.

pcluster configure [-h] [-c CONFIG_FILE]

Named Arguments

-c, --config alternative config file

version

Display version of AWS ParallelCluster.

pcluster version [-h]

For command specific flags run “pcluster [command] –help”