Start of changeHCL Workload Automation, Version 9.4

Microsoft Azure jobs

A Microsoft Azure job defines, schedules, monitors, and controls operations related to Microsoft Azure virtual machines. You can add one or more Microsoft Azure 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 Microsoft Azure jobs, you must have a Microsoft Azure Tenant ID, a Client ID, and a Client Secret Key.

Microsoft Azure 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 Microsoft Azure jobs:
Table 1. Required and optional attributes for the definition of a Microsoft Azure job
Attribute Description and value Required
Connection attributes
Subscription The ID that uniquely identifies your subscription to Microsoft Azure.
Client The Client ID associated to your Microsoft Azure account.
Tenant The Tenant ID associated to your Microsoft Azure account.
Key The Secret Key associated to your Microsoft Azure account.
Action attributes when managing an existing Microsoft Azure virtual machine
Virtual Machine The name of the virtual machine that you want to work with.
Change Power State To change the power state of the virtual machine, specify the new state:
  • Start
  • Stop
  • Restart
  • Deallocate
  • Generalize
  • Delete
 
Generalize To generalize a virtual machine.  
Capture a Custom Image To create a virtual machine image.  
Image Name The name of the virtual machine image.  
Add a Tag To add a tag to the virtual machine.  
Tag Name The name of the tag.  
Tag Value The value of the tag.  
Deallocate To deallocate the virtual machine.  
Delete To delete the virtual machine.  
Action attributes when creating a new Microsoft Azure virtual machine
VM Name The name of the virtual machine that you want to create.
Resource Group The container that holds all the resources for an application.
Primary Network The primary network interface to your virtual machine.
Primary Private IP The private IP address for the primary network interface. If not specified, a dynamic IP address is assigned.  
Primary Public IP The public IP address for the primary network interface. If not specified, a dynamic IP address is assigned.  
From Image The virtual machine image name.
Username The user name to log on to the virtual machine.
Password The password to log on to the virtual machine.
Size The size of the virtual machine.

MicrosoftAzureJobExecutor.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\MicrosoftAzureJobExecutor.properties file contains the following properties:
region=
subscription=
client=
tenant=
key=
region
The region where the virtual machine is created.
subscription
The ID that uniquely identifies your subscription to Microsoft Azure.
client
The Microsoft Azure client ID associated to your account.
tenant
The Microsoft Azure tenant ID associated to your account.
key
The Microsoft Azure client secret key associated to your account.
The following is an example of a Microsoft Azure properties file:
    region=uswest1
    subscription=ffa52f27-be12-4cad-b1ea-c2c241b6cceb
    client=b52dd125-9272-4b21-9862-0be667bdf6dc
    tenant=72f988bf-86f1-41af-91ab-2d7cd011db47
    key=ebc6e170-72b2-4b6f-9de2-99410964d2d0

Scheduling and stopping a job in HCL Workload Automation

You schedule HCL Workload Automation Microsoft Azure 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 Microsoft Azure 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 Microsoft Azure 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 a Microsoft Azure job that creates a new virtual machine:
<?xml version="1.0" encoding="UTF-8"?>
<jsdl:jobDefinition xmlns:jsdl="http://www.xxx.com/xmlns/prod/scheduling/1.0/jsdl" 
 xmlns:jsdlazure="http://www.xxx.com/xmlns/prod/scheduling/1.0/jsdlazure" name="AZURE">
    <jsdl:application name="azure">
        <jsdlazure:azure>
            <jsdlazure:AzureParameters>
                <jsdlazure:Connection>
                    <jsdlazure:connectionInfo>
                        <jsdlazure:subscription>xxxxxxxxxxxxx</jsdlazure:subscription>
                        <jsdlazure:client>yyyyyyyyyyyyyy</jsdlazure:client>
                        <jsdlazure:tenant>ZZZZZZZZZZZZZZZZ</jsdlazure:tenant>
                        <jsdlazure:key>ABCABCABCABCABCABC</jsdlazure:key>
                    </jsdlazure:connectionInfo>
                </jsdlazure:Connection>
                <jsdlazure:ManageInstance>
                    <jsdlazure:virtualmachine>
                        <jsdlazure:virtualmachinename></jsdlazure:virtualmachinename>
                    </jsdlazure:virtualmachine>
                    <jsdlazure:actions>
                        <jsdlazure:changepowerstate>
                            <jsdlazure:powerstate>nonepowerstate</jsdlazure:powerstate>
                        </jsdlazure:changepowerstate>
                    </jsdlazure:actions>
                </jsdlazure:ManageInstance>
                <jsdlazure:CreateVM>
                    <jsdlazure:vmname>VirtualMachine</jsdlazure:vmname>
                    <jsdlazure:resourcegroup>davidtestrg</jsdlazure:resourcegroup>
                    <jsdlazure:primarynetwork>10.0.0.0/24</jsdlazure:primarynetwork>
                    <jsdlazure:primaryprivateip></jsdlazure:primaryprivateip>
                    <jsdlazure:primarypublicip></jsdlazure:primarypublicip>
                    <jsdlazure:fromimage>UBUNTU_SERVER_16_04_LTS</jsdlazure:fromimage>
                    <jsdlazure:username>TestUno</jsdlazure:username>
                    <jsdlazure:password>Passw0rd</jsdlazure:password>
                    <jsdlazure:size>STANDARD_D2_V2</jsdlazure:size>
                </jsdlazure:CreateVM>
            </jsdlazure:AzureParameters>
        </jsdlazure:azure>
    </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 Microsoft Azure 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