how to suspend ec2 instnaces using scalr cli or rest api 1.0

56 views
Skip to first unread message

Ali

unread,
Jul 20, 2016, 10:24:29 AM7/20/16
to scalr-discuss
Hi I am  using the REST-API 1.0 and scalr CLI. for now.

the AWS EC2 instances I have are all of type "R3" so when I stop server I don't loose any data when restarting the instance . so I am able   to stop the EC2s without worrying about loosing data when I restart it.

having said that. here is my question.

it seems I can spin EC2 or terminate EC2 instances and not stop instances  using scalr CLI or the rest-api
is there a way to be able to stop (suspend) EC2 using the rest-api or scalr CLI  that I may be missing or miss-understanding looking at the documents ? 
since the option of stop/suspend EC2 instance is in the web console, so I assume you should be able to do the same using the CLI or rest-api.

the scalr CLI options  that I see are:
launch-server
list-servers
reboot-server
terminate-server

and there not seem to be a stop-server option  in the CLI or  rest-api 1.0.

very much appreciate your help on this matter.




Marc O'Brien

unread,
Jul 20, 2016, 1:19:26 PM7/20/16
to scalr-discuss
Hi Ali,

Please note, APIv1 has been deprecated.  This is easily achievable with APIv2 server action suspend as documented here.  We also recommend that you use the new scalr-ctl tool instead of the previous command line tools.  This can be installed with: #pip install scalr-ctl

This suspend action is not possible directly from APIv1, but you may be able to achieve this by setting your autoscaling settings for the Farm Role to a Scaling Behavior of "Resume / Suspend" instead of the default "Launch / Terminate" as described in our Wiki.  You could then use the APIv1 FarmUpdateRole call to change the max instances value and cause a downscale with suspend as the default action.

Many thanks,
Wm. Marc O'Brien
Scalr Technical Support

Ali

unread,
Jul 20, 2016, 1:40:13 PM7/20/16
to scalr-discuss
oh ok.
great thanks I will give it a try.
both using scalr-ctrl which is used for API v2 and the rest-api 2.0
thanks very much for all your help on this 
Thanks
-Ali
Reply all
Reply to author
Forward
0 new messages