Previous Topic: dpmec2 manage Command--Manage Amazon Elastic Compute Cloud Instances

Next Topic: CA AppLogic CLI Commands


dpmec2 run Command--Create Amazon EC2 Instance

The dpmec2 run command creates an Amazon EC2 instance.

Important! Amazon EC2 lets you create an instance of a public image specifying a key pair. If the key is not provided, the instances are inaccessible.

This command has the following format:

dpmec2 run [-sc sc_url] -image imageID [-group groupID[,groupID]] [-key_pair keypair] [-os_type {linux|windows|other}] [-type instancesize] [-user_data string] [-zone placement] [-wait [timeout]] -subnet subnet [-pre] [-post]
-sc sc_url

(Optional) Defines the URL for the service controller host.

Example: https://hostname:port/...

hostname

Defines the fully qualified host where the service controller is installed.

Example: localhost.ca.com

port

Defines the listening port for the service controller server.

Example: 80

-image imageID

Defines the image from which to create an instance.

-group groupID

Defines the security group to which the instance belongs.

-key_pair keypair

Defines the key pair the instance uses.

-os_type linux | windows | other

Defines the operating system that runs on the instance.

-type instancesize

Defines the instance size. Valid entries: micro | small | large | xl | high_CPU_med | high_CPU_xl | high_Mem_xl | high_Mem_x2 | high_Mem_x4 | Cluster | default small

-user_data string

Defines the data available to the instance. The user data must be quoted if it contains any spaces.

-zone placement

Defines the Availability zone where the instance is run.

-wait [timeout]

Specifies that the CLI displays the job status and does not return until the operation completes, fails, or the timeout period is met (if timeout is specified). If you do not specify the -wait option, the CLI returns without waiting for completion. If there is no response, the optional timeout value defines the timeout period in minutes. If you specify the -wait option with no timeout value, the CLI uses the default wait time from the sdadapter.conf (dpmsd only) or imaging.conf (all other CLIs) files, or defaults to 120 minutes. In addition to any positive integer, you can specify zero (0) to wait indefinitely.

-subnet subnet

Defines the subnet.

-pre

(Optional) Specifies whether to generate an event before the operation is performed.

-post

(Optional) Specifies whether to generate an event after the operation is performed.

Example: Create and Instance with User Data

This example creates an instance and passes user data and waits up to 20 minutes for it to finish.

dpmec2 run -image ami-54bc27fg -key_pair pr_kp -user_data “Payroll System” -wait 20