Asynchronous behavior of the Amazon EC2 adapter

The BMC Atrium Orchestrator Application Adapter for Amazon EC2 is an asynchronous API call-based adapter. The adapter actions which involve creating a resource in Amazon Cloud generally return the provisioned resource's identifier and its current state (like 'pending'). To further query the resource's provisioning state and whether the provisioning activity completed successfully, use the corresponding 'Describe' operation on the resource to gather more details. 

For example, when an instance is launched using the run-instances operation, the adapter response returns the <instanceId> and the <instanceState> as follows:

<amazon-ec2-response>
    <metadata>
        <status>success</status>
    </metadata>
    <RunInstancesResponse>
<instancesSet>
            <item>
                <instanceId>i-bd90bfd5</instanceId>
                <imageId>ami-b232d0db</imageId>
                <instanceState>
                    <code>0</code>
                    <name>pending</name>
                </instanceState>
.....................
      </instancesSet>
    </RunInstancesResponse>
</amazon-ec2-response>

To query the final status of the provisioned instance, use the describe-instances operation using the <instance-id> as shown in the following adapter request:

<amazon-ec2-request>
    <wsdl-location>http://ec2.amazonaws.com/doc/2009-11-30/</wsdl-location>
    <endpoint-address>http://us-east-1.ec2.amazonaws.com/</endpoint-address>
    <signature-properties mode = "key-files">
        <private-key-file>C:\Security\pk-MJ5GIUNLM2XJ3VRJSYTKOFDWILELDQHB.PEM</private-key-file>
        <certificate-file>C:\Security\cert-MJ5GIUNLM2XJ3VRJSYTKOFDWILELDQHB.PEM</certificate-file>
    </signature-properties>
    <operation-name>describe-instances</operation-name>
    <parameters>
        <instances-set>
            <item>
                <instance-id>i-bd90bfd5</instance-id>
            </item>
        </instances-set>
    </parameters>
</amazon-ec2-request>

Based on the provisioning cycle, the instance might be 'available' in a few minutes. Therefore, a loop in a workflow around the describe-instances operation invocation can determine the outcome of the run-instances operation.

If the provisioning is successful, the state of the instance is 'running' as shown in the following response. In case of an error, the response contains either of the following:

  • the error details
  • the instance details with no information because the instance was not launched
<amazon-ec2-response>
    <metadata>
        <status>success</status>
    </metadata>
    <DescribeInstancesResponse>
        <reservationSet>
            <item>
                <instancesSet>
                    <item>
                        <instanceId>i-bd90bfd5</instanceId>
                        <imageId>ami-b232d0db</imageId>
                        <instanceState>
                            <code>16</code>
                            <name>running</name>
                        </instanceState>
......................
                    </item>
                </instancesSet>
            </item>
        </reservationSet>
    </DescribeInstancesResponse>
</amazon-ec2-response>
Was this page helpful? Yes No Submitting... Thank you

Comments