This repository has been archived by the owner on Jul 15, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
RunInstances
harlowja edited this page Apr 11, 2012
·
55 revisions
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=<VARIABLE>&Action=RunInstances&ImageId=<VARIABLE>&InstanceType=<VARIABLE>&MaxCount=<VARIABLE>&MinCount=<VARIABLE>&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=<VARIABLE>&Version=2009-11-30
-
MaxCount
can be >=MinCount
(is there any validation on this?) -
ImageId
must be an existent and accessible image identifier -
InstanceType
must be an existent and accessible flavor
Exact version requested: 2009-11-30
Restricted to: projectmanager, sysadmin
An XML response (with status code 200
) conforming to the previous XSD would be expected.
<?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>
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>
- EC2APIError
- ImageNotFound
- InstanceLimitExceeded
- InstanceTypeDiskTooSmall
- InstanceTypeMemoryTooSmall
- InstanceTypeNotFoundByName
- InvalidInstanceIDMalformed
- InvalidParameterValue
- InvalidRequest
- NotAuthorized
- QuotaError
- SecurityGroupNotFound
- SecurityGroupNotFoundForProject
- Unauthorized (huh, duplicate of NotAuthorized?)
- UnknownError
- (Others??)
- 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.
- Version support is weak/non-existent; code copies input version parameter and echos it back
- No validation on input of the given version
- No validation of the output
- Does not ensure it conforms to a given version
- No concept of separate renderers for all supported versions
-
launchTime
is not compliant with the expectedxs:dateTime
format - Request parameters not implemented
- Monitoring.Enabled
- AddressingType
- SubnetId
- DisableApiTermination
- InstanceInitiatedShutdownBehavior
- Non-compliant request parameters
- KeyName (?)
- UserData (post data?)
- Weak to non-existent list of error messages which can be returned
- Mapping to EC2 error codes is incorrect
- Should map to: http://docs.amazonwebservices.com/AWSEC2/2009-11-30/APIReference/index.html?api-error-codes.html
- Little parameter validation (ie all args are converted into python uncamelcased objects/lists)
- This could lead to exploits/DOS/python running out of memory...
- Error XML response creation does not do XML escaping, see LP bug #978439