Deltacloud with EC2 frontend
Deltacloud added basic support for EC2 API frontend starting from the version 1.0.1. This frontend is experimental now and support just minimal set of features. However you should be able to successfully launch an instance in many different cloud providers Deltacloud currently supports.
What is currently supported?
Deltacloud EC2 frontend currently support these actions and parameters:
NOTE: The parameter values are mapped to native Deltacloud API models (uppercase).
EC2 Action |
Deltacloud equivalent |
Valid Parameters |
---|---|---|
DescribeAvailabilityZones |
GET /api/realm |
ZoneName.1 = REALM_ID |
DescribeImages |
GET /api/images |
ImageId.1 = IMAGE_ID |
DescribeInstances |
GET /api/instances |
InstanceId.1 = INSTANCE_ID |
DescribeKeyPairs |
GET /api/keys |
|
CreateKeyPair |
POST /api/keys |
KeyName = KEY_NAME |
DeleteKeyPair |
DELETE /api/keys/KEY_ID |
KeyName = KEY_ID |
RunInstances |
POST /api/instances |
ImageId = IMAGE_ID, InstanceType = HARDWARE_PROFILE_ID, Placement.AvailabilityZone = REALM_ID |
StopInstances |
POST /api/instances/INSTANCE_ID/stop |
InstanceId.1 = INSTANCE_ID |
StartInstances |
POST /api/instances/INSTANCE_ID/start |
InstanceId.1 = INSTANCE_ID |
RebootInstances |
POST /api/instances/INSTANCE_ID/reboot |
InstanceId.1 = INSTANCE_ID |
TerminateInstances |
DELETE /api/instances/INSTANCE_ID |
InstanceId.1 = INSTANCE_ID |
What is currently not supported?
- You cannot query for the InstanceType, since EC2 API does not offer this action. So to get list of HARDWARE_PROFILES you need to query Deltacloud API. It's possible to launch multiple frontends together using "-f ec2,deltacloud".
- You cannot start or stop multiple instances (InstanceId.1).
How to use it?
First you should start Deltacloud with '-f' option:
$ deltacloudd -i mock -f ec2,deltacloud
Then you can use 'curl' to verify if it is working:
$ curl -X GET -H 'Accept: application/xml' --user 'mockuser:mockpassword' "http://localhost:3001/ec2?Action=DescribeAvailabilityZones"
The output should be something like:
<DescribeAvailabilityZonesResponse xmlns='http://ec2.amazonaws.com/doc/2012-04-01/'> <requestId>fa396a8d6b5f40dd9f570b2f05574ecb</requestId> <availabilityZoneInfo> <item> <zoneName>us</zoneName> <zoneState>AVAILABLE</zoneState> <regionName>United States</regionName> </item> <item> <zoneName>eu</zoneName> <zoneState>AVAILABLE</zoneState> <regionName>Europe</regionName> </item> </availabilityZoneInfo>
</DescribeAvailabilityZonesResponse>