Changes between Version 4 and Version 5 of DICLOUD/GEC12tutorial


Ignore:
Timestamp:
10/17/11 15:31:33 (13 years ago)
Author:
David Irwin
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DICLOUD/GEC12tutorial

    v4 v5  
    129129$ sudo chgrp www-data geni_cert_web.pem
    130130}}}
     131
     132== Setup Environment Variables ==
     133
     134
     135Step 5:  Setup environment variables
     136------------------------------------
     137
     138{{{
     139cd ~/Tutorials/DiCloud
     140nano environment
     141
     142[ Insert correct from geni_aws_credentials.txt
     143    AWS_ACCESS_KEY_ID=
     144    AWS_SECRET_ACCESS_KEY= ]
     145
     146cat environment >> ~/.bashrc
     147}}}
     148
     149Add Access Key Id and Secret Access Key to .s3cfg file.
     150Copy .s3cfg file to ~geni
     151
     152{{{
     153cp ~/Tutorials/DiCloud/.s3cfg ~/.s3cfg
     154}}}
     155
     156
     157== Run the DiCloud server ==
     158
     159{{{
     160cd ~/Tutorials/DiCloud/dicloud/bin
     161./dicloud_server.sh
     162}}}
     163
     164
     165Step 7: Using the DiCloud console
     166---------------------------------
     167
     168Open a new terminal.  We run ntpdate to make sure the time is accurate.  Amazon will fail calls from machines with inaccurate local time.
     169
     170{{{
     171sudo ntpdate ntp.ubuntu.com
     172cd ~/Tutorials/DiCloud/dicloud/bin
     173./dicloud_console.sh
     174dicloud - not connected>connect localhost 1099
     175Connecting to //localhost:1099/dicloud/server
     176dicloud - //localhost:1099>ec2 start /home/geni/Tutorials/DiCloud/ec2/keys/geni_cert$
     177dicloud - //localhost:1099>help
     178Commands available for the main menu are:
     179add credit amount_of_money
     180   Add credit to the AWS account
     181billing history history_size csv|html
     182   Get the AWS account activity history in CSV or HTML format (a history of 0 retrie$
     183connect DiCloudServerHostName RmiPortNumber
     184   Connects to the DiCloud server
     185ebs attach cert.pem pk.pem ec2_region ebs_volume_id ec2_instance_id device_name
     186   Attach an EBS volume (ebs_volume_id) to the running instance (ec2_instance_id) as$
     187ebs create cert.pem pk.pem size_in_gb ec2_region ec2_availability_zone
     188   Create an EBS volume
     189ebs delete cert.pem pk.pem volume_id ec2_region
     190   Delete an EBS volume
     191ebs detach cert.pem pk.pem ec2_region ebs_volume_id
     192   Detach EBS volume ebs_volume_id from its EC2 instance
     193ebs probe cert.pem pk.pem volume_id ec2_region ascii|html
     194   Probe an EBS volume and get current status information
     195ec2 probe cert.pem pk.pem instance_id ec2_region html|ascii
     196   Check the status of a running EC2 instance
     197ec2 start cert.pem pk.pem ami_id instance_nb instance_type ec2_region ec2_keypair_na$
     198   Start a new EC2 instance
     199ec2 stop cert.pem pk.pem instance_id ec2_region ec2_keypair_name
     200   Stop an EC2 instance
     201get balance
     202   Get the AWS account balance
     203help
     204   Print this help message
     205history [<command index>]
     206   Display history of commands for the console.
     207quit
     208   Quit the console
     209s3 create bucket_name region
     210   Create an S3 bucket
     211s3 delete bucket_name region
     212   Delete an S3 bucket
     213s3 get s3_bucket_name object_name file_path
     214   Get the content of an object named object_name into the specified file from the S$
     215s3 probe bucket_name region
     216   Get information about an S3 bucket
     217s3 put s3_bucket_name object_name file_path
     218   Put the content of the specified file in an object named object_name in the S3 bu$
     219shutdown
     220   Shutdown the DiCloud server the console is currently connected to.
     221dicloud - //localhost:1099>get balance
     222Current balance is: $99.53222835338767
     223dicloud - //localhost:1099>ec2 probe /home/geni/Tutorials/DiCloud/ec2/keys/geni_cert.pem /home/geni/Tutorials/DiCloud/ec2/keys/geni_pk.pem i-b87b74d8 us-east-1 ascii
     224Instance Id: i-b87b74d8
     225AMI Id: ami-78f21911
     226Public name: ec2-75-101-245-135.compute-1.amazonaws.com
     227Private name: ip-10-244-46-161.ec2.internal
     228Public IP: 75.101.245.135
     229Private IP: 10.244.46.161
     230Instance State: running
     231Instance Type: m1.small
     232Key pair: geni-keypair
     233Start time: 2011-10-17T17:31:41+0000
     234Availability zone: us-east-1b
     235dicloud - //localhost:1099>quit
     236}}}
     237
     238You can also script the DiCloud console. An example is below.
     239
     240{{{
     241$ echo "connect localhost 1099
     242get balance
     243quit" > ./getbalance.txt
     244$ ./dicloud_console_script.sh -silent < ./getbalance.txt
     245}}}
     246
     247Example use of S3
     248
     249{{{
     250dicloud - //localhost:1099>s3 create gec12-tutorial-1 us
     251dicloud - //localhost:1099>s3 put gec12-tutorial-1 test /home/geni/Tutorials/DiCloud/dicloud/bin/dicloud.properties
     252Uploading file /home/geni/Tutorials/DiCloud/dicloud/bin/dicloud.properties as object test in bucket gec12-tutorial-1
     253dicloud - //localhost:1099>s3 get gec12-tutorial-1 test /home/geni/Tutorials/DiCloud/test
     254Downloading file /home/geni/Tutorials/DiCloud/test from object test in bucket gec12-tutorial-1dicloud - //localhost:1099>
     255dicloud - //localhost:1099>s3 delete gec12-tutorial-1 us
     256}}}
     257
     258Example use of EBS
     259{{{
     260dicloud - //localhost:1099>ebs create /home/geni/Tutorials/DiCloud/ec2/keys/geni_cert.pem /home/geni/Tutorials/DiCloud/ec2/keys/geni_pk.pem 1 us-east us-east-1a
     261dicloud - //localhost:1099>ebs delete /home/geni/Tutorials/DiCloud/ec2/keys/geni_cert.pem /home/geni/Tutorials/DiCloud/ec2/keys/geni_pk.pem <volume_id> us-east
     262}}}
     263