...
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.
- *# EC2 AssociateAddress – fix IP address reassignment :
AWS associates an elastic IP address with an instance. If the IP address is currently assigned to another instance, the IP address is assigned to the new instance. In such cases CloudStack errors out if IP is already assigned.
Solution is to fix CloudStack to allow reassigning the IP address in case it has been already assigned to some other VM. - EC2 DescribeImageAttribute – support launchPermission:
Need to implement the support for ‘launchPermission’ image attribute. CloudStack listTemplatePermissions API can be used for this purpose. - EC2 RunInstances – default SecurityGroup:
...
- Obtain the following from your CloudStack cloud administrator:
- The CloudStack server's publicly available DNS name or IP address
- Your account's API key and Secret key
- Generate a private key and a self-signed X.509 certificate. Substitute your own desired storage location for /path/to/… below.
$ openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /path/to/private_key.pem -out /path/to/cert.pem - Register the mapping from the X.509 certificate to your accounts API keys with CloudStack. Download the script to do this from <location TBD>
$ cloudstack-aws-api-register --apikey=<User’s Cloudstack API key> --secretkey=<User’s CloudStack Secret key> --cert=</path/to/cert.pem> --url=http://<cloud-stack-server>:7080/awsapi - Setup the necessary environment variables for the EC2 tools.
$ export EC2_ACCESS_KEY=<CloudStack API key>
$ export EC2_SECRET_KEY=<CloudStack Secret key>
$ export EC2_CERT=/path/to/cert.pem
$ export EC2_PRIVATE_KEY=/path/to/private_key.pem
$ export EC2_URL=http://cloud-stack-hostname:8080/awsapi
Image Removed
% export EC2_HOME=/path/to/EC2_installation_directory
...
Currently an EC2 Soap or REST request flows to CloudStack as shown below:
- CloudBridge and CloudStack run in separate tomcat servers.
- EC2 tools call the CloudBridge webapp which acts as the translation layer between EC2 API and CloudStack API.
- CloudBridge routes the call to CloudStack API layer and translates the response to EC2 on way back.
...
- We will integrate the CloudBridge code from github.com with 3.0.x branch of CloudStack.
- CloudBridge will be added as a separate project under cloudstack-oss.
- All the setup files including db schema and user setup scripts will be contained in ‘cloudbridge-setup’ directory under cloudstack-oss
- All the thirdparty libraries that CloudBridge requires will be kept separate from CloudStack thirdparty libraries under cloudstack-oss/deps/cloudbridge-lib
...
| Wiki Markup |
|---|
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 we plan to deploy CloudBridge and CloudStack as two separate webapps in the same tomcat server.
- Thus all EC2 requests will be routed through CloudBridge webapp listening on port 8080 which will internally call the CloudStack webapp again listening on 8080 and using the same tomcat threadpool.
- So we need to make sure that N incoming EC2 requests don’t establish N loopback requests to the CloudStack API, essentially using up 2*N threads from the same pool.
- This can lead to a deadlock where the EC2 requests might be blocked waiting on the same thread pool.
- To avoid this we plan to define a new localhost-only http connector listening on some other port, say 7080 and using a separate threadpool.
- CloudBridge will place the call to CloudStack API on this separate port. Thus CloudStack will listen on 8080 for external requests and also on 7080 for localhost requests.
* Changes to awsapi port:
...