Start of changeHCL Workload Automation, Version 9.4

Amazon EC2 jobs

An Amazon EC2 job defines, schedules, monitors, and controls operations related to Amazon EC2 virtual computing environments, known as instances. You can add one or more Amazon EC2 jobs in the job stream that automates your business process flow, to provide a flexible and dynamic allocation of cloud resources to your workload.

Prerequisites

Before you can define Amazon EC2 jobs, you must have the Access Key ID and the Secret Access Key to use Amazon EC2 API(s).

Amazon EC2 job definition

A description of the job properties and valid values are detailed in the context-sensitive help in the Dynamic Workload Console by clicking the question mark (?) icon in the top-right corner of the properties pane.

For more information about creating jobs using the various supported product interfaces, see Defining a job.

The following table lists the required and optional attributes for Amazon EC2 jobs:
Table 1. Required and optional attributes for the definition of an Amazon EC2 job
Attribute Description and value Required
Connection attributes
Access Key ID The Access Key ID associated to your Amazon EC2 account.
Secret Access Key The Secret Access Key associated to your Amazon EC2 account.
Dry-Run
Checkbox
Supported values are true and false.
  • When the value is true, Amazon EC2 verifies the required permission to run the requested action, without actually making the request.
  • When the value is false, Amazon EC2 doesn't verifies the required permission to run the requested action.
Default is false.
 
Action attributes when managing an existing Amazon EC2 instance
Instance The name of the instance that you want to work with.
Change Power State To change the power state of the instance, specify the new state:
  • Start
  • Stop
  • Reboot
 
Create Amazon Machine Image (AMI) To create an Amazon EC2 Machine Image that provides the information required to launch the instance.  
Image Name The Amazon EC2 Machine Image name.  
Description The Amazon EC2 Machine Image description.  
No Reboot Instance
Checkbox
Supported values are true and false.
  • When the value is true, you do not want Amazon EC2 to reboot the instance.
  • When the value is false, you do want Amazon EC2 to reboot the instance.
Default is false.
 
Remove Select this option to remove the instance.  
Action attributes when creating a new Amazon EC2 instance
Amazon Machine Image (AMI) The Amazon EC2 Machine Image (AMI) name.
Instance Type The hardware of the host computer used for your instance.
Network The network interface to your instance. If you don’t specify this attribute, the Amazon EC2 default value is used.  
Subnet The ID of the subnet where your instance is created. If you don’t specify this attribute, the Amazon EC2 default value is used.  
Security-group The security group to be assigned to your instance. If you don’t specify this attribute, the instance is automatically assigned to the Amazon EC2 default security group.  
EBS Volume size The size (GB) of the Elastic Block Storage device that you can attach to the instance.  

AmazonEC2JobExecutor.properties file

Additional properties needed to run Amazon EC2 are set in the plug-in properties file

The properties file is automatically generated either when you perform a "Test Connection" from the Dynamic Workload Console in the job definition panels, or when you submit the job to run the first time. Once the file has been created, you can customize it. This is especially useful when you need to schedule several jobs of the same type. You can specify the values in the properties file and avoid having to provide information such as credentials and other information, for each job. You can override the values in the properties files by defining different values at job definition time.

The TWS_INST_DIR\TWS\JavaExt\cfg\AmazonEC2JobExecutor.properties file contains the following properties:
region=
maxresults=
keypair=
region=region
The region where the instance is created. If the subscription took place after May 17, 2017, default value is us_west-2, otherwise it is us_east-1.
maxresult= maximum_number_of_results
The maximum number of results to return in a single call.Default value is 250.
keypair= key_pair_name
The name associated to the public and private keys that you use to log in to your instance.
The region, maxresults, and keypair properties can be specified only in the AmazonEC2JobExecutor.properties file.

Scheduling and stopping a job in HCL Workload Automation

You schedule HCL Workload Automation Amazon EC2 jobs by defining them in job streams. Add the job to a job stream with all the necessary scheduling arguments and submit the job stream.

You can submit jobs by using the Dynamic Workload Console, Application Lab or the conman command line. See Scheduling and submitting jobs and job streams for information about how to schedule and submit jobs and job streams using the various interfaces.

After submission, when the job is running and is reported in EXEC status in HCL Workload Automation, you can stop it if necessary, by using the kill command.

Monitoring a job

If the HCL Workload Automation agent stops when you submit the Amazon EC2 job, or while the job is running, the job restarts automatically as soon as the agent restarts.

For information about how to monitor jobs using the different product interfaces available, see Monitoring HCL Workload Automation jobs.

Job properties

While the job is running, you can track the status of the job and analyze the properties of the job. In particular, in the Extra Information section, if the job contains variables, you can verify the value passed to the variable from the remote system. Some job streams use the variable passing feature, for example, the value of a variable specified in job 1, contained in job stream A, is required by job 2 in order to run in the same job stream.

For information about how to display the job properties from the various supported interfaces, see Analyzing the job log. For example, from the conman command line, you can see the job properties by running:
conman sj <job_name>;props
where <job_name> is the Amazon EC2 job name.

The properties are listed in the Extra Information section of the output command.

For information about passing job properties, see Passing job properties from one job to another in the same job stream instance.

The following example shows the job definition for an Amazon EC2 job that changes the power state of an instance:
<?xml version="1.0" encoding="UTF-8"?>
<jsdl:jobDefinition xmlns:jsdl="http://www.XXX.com/xmlns/prod/scheduling/1.0/jsdl" 
       xmlns:jsdlaws="http://www.XXX.com/xmlns/prod/scheduling/1.0/jsdlaws" name="AWS">
    <jsdl:application name="aws">
        <jsdlaws:aws>
            <jsdlaws:AwsParameters>
                <jsdlaws:Connection>
                    <jsdlaws:connectionInfo>
                        <jsdlaws:key1>YYYYYYYYYYY</jsdlaws:key1>
                        <jsdlaws:key2>ZZZZZZZZZZZZ</jsdlaws:key2>
                    </jsdlaws:connectionInfo>
                </jsdlaws:Connection>
                <jsdlaws:ManageInstance>
                    <jsdlaws:instance>
                        <jsdlaws:instancename></jsdlaws:instancename>
                    </jsdlaws:instance>
                    <jsdlaws:actions>
                        <jsdlaws:changepowerstate>
                            <jsdlaws:powerstate>nonepowerstate</jsdlaws:powerstate>
                        </jsdlaws:changepowerstate>
                    </jsdlaws:actions>
                </jsdlaws:ManageInstance>
                <jsdlaws:CreateInstance>
                    <jsdlaws:image>ami-2c33ed43 - Windows_Server-2008-SP2-English-32Bit-Base- 
                      2017.05.10 - i386</jsdlaws:image>
                    <jsdlaws:amitype>t2.micro</jsdlaws:amitype>
                    <jsdlaws:network>vpc-ffeb7f97 | pnp-vpc-eu-central-1</jsdlaws:network>
                    <jsdlaws:subnet>subnet-2237664a | hws-eu-pvtsubnet | eu-central-1a</jsdlaws:subnet>
                    <jsdlaws:securitygroup>sg-ce8b37a5 | pnp-eu-common-pvtsubnet-windows-sg | security
                      group for windows instances hosted in pnp us private subnets</jsdlaws:securitygroup>
                    <jsdlaws:rootvolumesize>1</jsdlaws:rootvolumesize>
                </jsdlaws:CreateInstance>
            </jsdlaws:AwsParameters>
        </jsdlaws:aws>
    </jsdl:application>
</jsdl:jobDefinition>

Job log content

For information about how to display the job log from the various supported interfaces, see Analyzing the job log.

For example, you can see the job log content by running conman sj <job_name>;stdlist, where <job_name> is the Amazon EC2 job name.

See also

From the Dynamic Workload Console you can perform the same task as described in

Creating job definitions.

For more information about how to create and edit scheduling objects, see

Designing your Workload.



End of change