Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • In the first step of "Add instance " wizard ,  select template,
  • In step 2, select "tiny Linux"
  • In step 3, select "tinyOffering"
  • In step 4, select "No thanks"
  • Skip step 5 and 6.
  • Launch VM

...

Set some Global Settings

In the UI, set the following global settings:

  • expunge.interval = 120
  • expunge.delay = 120
  • enable.ec2.api = true

Now CTL-C your rdebug, and then "ant rdebug" again (to restart the management server).

Additional Testing

At this point, it would be good to check that you can access the console of the newly created instance, followed by destroying the instance.

expunge.interval = 120

expunge.delay = 120

EC2 testing

Destroying the instance is important, and confirming that it was expunged prior to trying to test the EC2 API. This is due to the resource constraints on the DevCloud image.

EC2 testing

  • Under
  • Access the UI at http://localhost:8080/client
  • Under Global Settings, set enable.ec2.api to true
  • Under Accounts, generate keys for the admin user in the admin account
  • Under service offerings, rename tinyOffering as m1.small
  • In your Virtual Box settings, forward port 7080
  • In your local machine, cd into the awsapi-setup/setup folder of the source
  • Use and use the python script cloudstack-aws-api-register to register the user. Like so:
Code Block
python cloudstack-aws-api-register --apikey=JdTxDI2rOZ0RDZdgF1O_ZxfISxNuema9gQ3NyE4z5psX4sgSxE4ueEBohG3bfqWHr7BYP6_sAghXTIvm3noqkw --secretkey=fVT0r5lETIJThRGyec-Eg4WFm9_IN5tNIut7Ac5BJW0VExFGdRZEqA_JFvxdTFDH2ZeRcbO25xPQcyxt0VRWKg --cert=/path/to/cert.pem --url=http://localhost:7080/awsapi

...

Note

You can specify an empty file as cert but use the keys generated in the GUI

...

. Executing this with an empty cert file will result in an error. Regardless of this error, if the registration works you should see the credentials in the cloudbridge database in the usercredentials table.

Within the DevCloud VM (as root):
mysql cloudbridge
select * from usercredentials;

You should see your account as the only row in that table.

  • Use a python script similar as below (change the keys) to launch an instance:
Code Block
#!/usr/bin/env python

import sys
import os
import boto
import boto.ec2

region = boto.ec2.regioninfo.RegionInfo(name="ROOT",endpoint="localhost")
apikey='JiKIBbp6GRe3-7Ma-KF_pJl69BAsv2smJEA3So4DLfG0JCa9u5VnGeS5qsSo6cHiArzu8pRwEr4DkGy6M5inTw'
secretkey='x9iMD9XY0xsnLy_1EZQi6lOXAY5hH-O6S2z_VFVTWMO5_GAIdeSm93tNk09rb56cB1bAQKZ0vSOztBrusZRu6g'

def main():
        '''Establish connection to EC2 cloud'''
        conn =boto.connect_ec2(aws_access_key_id=apikey,
                       aws_secret_access_key=secretkey,
                       is_secure=False,
                       region=region,
                       port=7080,
                       path="/awsapi",
                       api_version="2010-11-15")

        '''Get list of images that I own'''
        images = conn.get_all_images()
        print images
        myimage = images[0]
        '''Pick an instance type'''
        vm_type='m1.small'
        reservation = myimage.run(instance_type=vm_type,security_groups=['default'])

if __name__ == '__main__':
        main()
  • Confirm that the instance started via the GUI.

End!

If we made it this far, the release has at least been reasonably "smoke tested".