Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

RunInstances

harlowja edited this page · 55 revisions

RunInstances

Method information

Request

Type: GET/POST

Uri: http://$HOST:$PORT/$PATH/

Notes: Performed using euca-run-instances using euca2ools_2.0.0~bzr464-0ubuntu2 on Ubuntu 11.10

Params:

AWSAccessKeyId=&Action=RunInstances&ImageId=ami-00000001&InstanceType=m1.small&MaxCount=1&MinCount=1SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-04-10T23:33:45Z&Version=2009-11-30

Exact version requested: 2009-11-30

Restricted to: projectmanager, sysadmin

Docs

  1. http://docs.amazonwebservices.com/AWSEC2/2009-11-30/APIReference/index.html?ApiReference-query-RunInstances.html

XSD

  1. https://github.com/yahoo/Openstack-EC2/blob/master/data/xsds/2009-11-30.ec2.wsdl.xsd#L137

Expected response

An XML response (with status code 200) conforming to the previous format would be expected.

Actual response

<?xml version="1.0" ?>
<RunInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2009-11-30/">
   <requestId>req-5125b273-4a29-4db3-9d8a-0e743a716ceb</requestId>
   <ownerId>78560ada18d4443e8ef514428f45e1cb</ownerId>
   <groupSet>
      <item>
         <groupId>default</groupId>
      </item>
   </groupSet>
   <reservationId>r-6l74vh0p</reservationId>
   <instancesSet>
      <item>
         <placement>
            <availabilityZone>unknown zone</availabilityZone>
         </placement>
         <rootDeviceType>instance-store</rootDeviceType>
         <keyName/>
         <instanceId>i-00000001</instanceId>
         <instanceState>
            <code>0</code>
            <name>pending</name>
         </instanceState>
         <publicDnsName/>
         <imageId>ami-00000003</imageId>
         <productCodesSet/>
         <privateDnsName>server-1</privateDnsName>
         <dnsName>server-1</dnsName>
         <launchTime>2012-04-10T18:04:15.000Z</launchTime>
         <amiLaunchIndex>0</amiLaunchIndex>
         <rootDeviceName>/dev/sda1</rootDeviceName>
         <kernelId>aki-00000001</kernelId>
         <ramdiskId>ari-00000002</ramdiskId>
         <ipAddress/>
         <instanceType>m1.small</instanceType>
         <privateIpAddress/>
      </item>
   </instancesSet>
</RunInstancesResponse>

Errors

An error will be sent back in the following XML format (with a 400 status code):

<?xml version="1.0"?>
<Response>
   <Errors>
      <Error>
         <Code>%s</Code>
         <Message>%s</Message>
      </Error>
   </Errors>
   <RequestID>%s</RequestID>
</Response>

Conditions

  1. ImageNotFound
    • Code => ImageNotFound
    • Message => (Exception Dependent)
    • RequestID => (Varies)
  2. EC2APIError(('Image must be available'))
  3. InvalidParameterValue
  4. NotAuthorized
  5. InvalidRequest
  6. QuotaError
  7. UnknownError
  8. InstanceTypeNotFoundByName
  9. InvalidInstanceIDMalformed
    • Message => InvalidInstanceID.Malformed
  10. (TBD - fill in more)

Issues

  1. Does not comply to defined schema (ordering mainly)

$ xsd-validate.sh ../data/xsds/2009-11-30.ec2.wsdl.xsd ../req.xml

org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'ownerId'. One of '{"http://ec2.amazonaws.com/doc/2009-11-30/":reservationId}' is expected.
org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'placement'. One of '{"http://ec2.amazonaws.com/doc/2009-11-30/":instanceId}' is expected.
  1. Version support is weak/non-existent; code copies input version parameter and echos it back
  2. No validation on input or on output of the given version
  3. launchTime is not compliant with the expected xs:dateTime format
  4. Request parameters not implemented
    • Monitoring.Enabled
    • AddressingType
    • SubnetId
    • DisableApiTermination
    • InstanceInitiatedShutdownBehavior
  5. Non-compliant request parameters
    • KeyName (?)
    • UserData (post data?)
  6. Weak to non-existent list of error messages which can be returned
  7. Mapping to EC2 error codes is incorrect
Something went wrong with that request. Please try again.