EC2Provider does instance pooling, which means instances will be left running.

      Stephen had a great idea that we should make those instances self-terminate after certain inactivity.

      We can define "activity" in various ways, but for example we could have cron touch a marker file if it finds active SSH sessions, and then have the instance shutdown if the marker file is older than say a few hours.

      As for how to make instances terminate automatically when they go down, see http://stackoverflow.com/questions/10541363/self-terminating-aws-ec2-instance

          [JENKINS-22259] Make EC2 instances self shutdown

          Vivek Pandey added a comment -

          Fixed. First every ec2 instance is configured to terminate by configuring InstanceInitiatedShutdownBehavior attribute and then a nohup bash script is executed that will check periodically for inactivity and shutdown ec2 instance in case of inactivity.

          Vivek Pandey added a comment - Fixed. First every ec2 instance is configured to terminate by configuring InstanceInitiatedShutdownBehavior attribute and then a nohup bash script is executed that will check periodically for inactivity and shutdown ec2 instance in case of inactivity.

          Vivek Pandey added a comment -

          Fixed. First every ec2 instance is configured to terminate by configuring InstanceInitiatedShutdownBehavior attribute and then a nohup bash script is executed that will check periodically for inactivity and shutdown ec2 instance in case of inactivity.

          Vivek Pandey added a comment - Fixed. First every ec2 instance is configured to terminate by configuring InstanceInitiatedShutdownBehavior attribute and then a nohup bash script is executed that will check periodically for inactivity and shutdown ec2 instance in case of inactivity.

            vivek Vivek Pandey
            kohsuke Kohsuke Kawaguchi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: