Introduction

Purpose

The objective of this feature is to bring EC2 support into mainstream CloudStack by migrating CloudBridge code into the CloudStack database. Improving fidelity with the EC2 API is also a goal.

Scope

Scope of this document is to provide a functional specification for the EC2 integration and fidelity work planned for the Bonita release of CloudStack.

References

Document History

Version

Author/Reviewer

Date

1.0

Prachi Damle

4/3/2012

 

 

 

Feature Specifications

Feature Objectives

      This involves integration of the CloudBridge codebase to the mainline of CloudStack and expose the EC2 support as part of CloudStack. Once integrated under CloudStack, we will rename the CloudBridge project to 'awsapi'

      Currently CloudBridge does not support all the EC2 APIs. Goal is to achieve maximum fidelity to EC2 API by bridging the API gap between EC2 and CloudStack as much as possible.

      For Bonita release following are the API gaps that need to be closed:

CloudStack assigns an IP address from a Zone and CloudBridge picks the first available Zone to do so.However AWS does not assign an IP address from a particular AvailabilityZone.
To bridge this gap, a new CloudStack API needs to be implemented to enable a user to mark a zone as ‘default’ for the account. CloudBridge can then use this default Zone to allocate an IP address from.

CloudStack needs to be fixed to not place the instance in default security group if a groupId is provided.

Limitations

Logging and Debugging

Configuration Characteristics

Deployment requirements

EC2 Support through CloudStack will be available through fresh installations of CloudStack only. EC2 API will not be available through upgrade of previous versions.

Use cases

Case 1: Admin user - Install

Case 2: Admin user - Enable EC2 API

Case 3: EC2 user setup

Architecture and Design description

Currently an EC2 Soap or REST request flows to CloudStack as shown below:


With Bonita release plan is to integrate the two codebases to run in single server under CloudStack but maintaining this call flow.

Thus even after integration, plan is to have CloudBridge call CloudStack API layer as before:

Reasons to go with this design were:

Integration of CloudBridge code

Following is a screenshot of the proposed code base integration:

Tomcat Deployment changes\* \[This has been changed, please refer section 'Changes to awsapi port' below\]

Following design is no longer supported. This has been changed and now awsapi will be listening on URL: http://<server>:7080/awsapi/
Under tomcat cloudbridge will be still deployed as a separate webapp. It can be accessed on the same port as cloudstack but with different URL: http://<server>:8080/awsapi/

Avoiding Loopback requests in Tomcat:

After integration in to CloudStack in 3.0.3, EC2 API listens on the same port 8080 as CloudStack API, under a different context. This was intended to make it appear that CloudStack is able to accept EC2/S3 requests as wel and also to avoid the loopback issues as mentioned above.

Problem: This design of using the 7080 localhost only port, is breaking any other applications who proxy CloudStack requests coming on 8080. Since CS API requests made by EC2 go on port 7080, these applications cannot proxy the EC2 requests.

Solution:

We will have to revert back this design and make awsapi listen on a different port than the CloudStack port. We will make awsapi listen on port 7080 by default.

Thus EC2/S3 will listen on http://<server_ip_of_CloudStack>:7080/awsapi and will call CloudStack on 8080.

No loopback issues will arise since awsapi EC2/S3 API and Cloudstack API are now using different ports on tomcat.

New deployment looks like this:

API Changes

MarkDefaultZoneForAccountCmd

This will be a new API added to CloudStack to enable a user to mark a particular zone as ‘default’ to be used for any operations for the account. This will be useful for users of EC2 API in use cases like AllocateAddress.

Parameters:

DB Changes

EC2 support will be available only for new installs. So there is no need to include any DB changes in upgrade scripts.

CloudBridge DB

CloudStack  DB

 A new Column ‘default_zone’ will be added to this table to store the zoneid of the zone to be marked default for the account.

We need to add a new Configuration parameter called 'enable.ec2.api' to enable EC2 API through global settings. Default value of this parameter should be 'false'.