[Swift-commit] r7719 - SwiftApps/cloud

ketan at ci.uchicago.edu ketan at ci.uchicago.edu
Mon Mar 17 12:38:25 CDT 2014


Author: ketan
Date: 2014-03-17 12:38:25 -0500 (Mon, 17 Mar 2014)
New Revision: 7719

Modified:
   SwiftApps/cloud/README
   SwiftApps/cloud/addnodes
Log:
document spot instances and add more info on addnodes

Modified: SwiftApps/cloud/README
===================================================================
--- SwiftApps/cloud/README	2014-03-17 16:49:25 UTC (rev 7718)
+++ SwiftApps/cloud/README	2014-03-17 17:38:25 UTC (rev 7719)
@@ -202,7 +202,18 @@
 ./addnodes -a "54.243.24.104 54.243.24.154"
 ----
 
+Add EC2 spot instances
+~~~~~~~~~~~~~~~~~~~~~~
 
+To add resources from the EC2 spot instances, use the `-p` option of the `addnodes` command. For example, the following commandline will add 2 EC2 spot instances with a bid of $ 0.08 :
+
+----
+./addnodes -p 0.08 -n 2
+----
+
+Note that there is no guarantee of the resources being available at this price.
+In case the resources are not available, the request will be silently ignored.
+
 Remove EC2 compute instances
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 

Modified: SwiftApps/cloud/addnodes
===================================================================
--- SwiftApps/cloud/addnodes	2014-03-17 16:49:25 UTC (rev 7718)
+++ SwiftApps/cloud/addnodes	2014-03-17 17:38:25 UTC (rev 7719)
@@ -53,7 +53,6 @@
 }
 
 addbynum (){
-    echo "$1"
     
     if [ -z "$SPOT_PRICE" ] ; then
         #ec2-run-instances -k <key-name> -n 1 -g <groupname> --instance-type <type> <ami-id>
@@ -61,10 +60,10 @@
         runinst=$(ec2-run-instances -k "$EC2KEYPAIR" -g "$EC2SECGRP" -n "$1" --instance-type t1.micro "$EC2AMI")
     else
         echo "spot price set to: $SPOT_PRICE"
-        runinst=$(ec2-request-spot-instances -k "$EC2KEYPAIR" -g "$EC2SECGRP" -n "$1" --instance-type -p "$SPOT_PRICE" t1.micro "$EC2AMI")
+        runinst=$(ec2rsi -k "$EC2KEYPAIR" -g "$EC2SECGRP" -n "$1" --instance-type -p "$SPOT_PRICE" t1.micro "$EC2AMI")
     fi
 
-    echo "Waiting for instances to start"
+    echo "Waiting for $1 instance(s) to start"
     sleep 60
     for i in $(echo $runinst | grep -o '\bi-........\b'); do
         ip=$(ec2din $i | grep 'running' | awk '{print $15}')




More information about the Swift-commit mailing list