Guest User

EC2 Spot Instance Via CLI

a guest
Dec 23rd, 2013
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. Amazon EC2 Spot Instace Request vie EC2 Command Line Tools
  2.  
  3. ec2-request-spot-instances <AMI> -p <PRICE> -n <# INSTANCES> -r <PERSISTENCE> -s <SUBNET> -f <USER-DATA FILE PATH> -z <ZONE> -t <IMAGETYPE> -k <KEY> -g <SECURITY GROUP>
  4.  
  5. AMI - The image identifier. It's gotta be in the region you're connecting to.
  6.  
  7. -p - Price
  8.  
  9. -n - Number of instances to request.
  10.  
  11. -r - Whether or not the request is persistent (re-requests after being terminated)
  12. Valid: one-time|persistent
  13.  
  14. -s The subnet, by ID. Make sure the subnet is in the zone you want to request from.
  15.  
  16. -f Path to the user data file you'd like to use for this instance.
  17.  
  18. -z Zone to launch instance in (should match zone subnet is in) ex. us-east-1a, us-west-2b, etc.
  19.  
  20. -t Instance type (g2.2xlarge if your doing scrypt mining)
  21.  
  22. -k The key to use (for password creation on Windows or SSH authentication on Linux). Keys are just called by their name, no xxx-abcd1234 thing here.
  23.  
  24. -g One of your security groups, appropriate for the image chosen (RDP/VNC Windows, SSH Linux)
  25.  
  26.  
  27. Example:
  28.  
  29. ec2-request-spot-instances ami-1234abcd -p .15 -n 1 -r persistent -s subnet-1234abcd
  30. -f C:\Path\To\User-Data\UserData.File -z us-east-1a -t g2.2xlarge -k Key2 -g sg-1234abcd
Advertisement
Add Comment
Please, Sign In to add comment