Sandbox in EC2 … cost safety ….

by bitznbitez

I’ve found EC2 in Amazon AWS to be a great sandbox for a DBA.   I have test servers of SQL Server 2012 and 2014 base at the moment.   I always worry though that I will forget to shutdown an instance when I am not using it, go on vacation to Pango Pango, or wherever, and return to discover I’ve been paying hourly fees for an instance I didn’t need to have running.

What to do ?

The answer is to schedule a task to automatically shutdown the server once a day, a a time when you probably won’t be using it anyway.   Say 3:00 am local time.   If by chance you wanted to have stuff running overnight in your EC2 test instance…. just disable the auto shutdown.

You will want to start the task scheduler, create a basic tast that runs daily, specify the time, and then enter the command and options.  The command is :

C:\Windows\System32\shutdown.exe

Arguments that I use are ‘-s -t 60 -f -c “Bye Be” ‘

To learn more about shutdown.exe read the following technote : http://technet.microsoft.com/en-us/library/bb491003.aspx

Advertisements