Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-terminate doesn't work on Windows instances #54

Open
snay2 opened this issue Mar 9, 2022 · 0 comments
Open

Auto-terminate doesn't work on Windows instances #54

snay2 opened this issue Mar 9, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@snay2
Copy link
Contributor

snay2 commented Mar 9, 2022

Describe the bug
simple-ec2 offers a feature to auto-terminate an instance you launch a certain number of minutes after its creation. This is nice for testing where you only need an instance for a short amount of time, since you don't have to worry about cleanup.

However, this mechanism only works on Linux instances, not Windows instances.

Steps to reproduce:

  1. Run simple-ec2 launch -i
  2. Use any values you like but specify the following:
    1. Windows AMI
    2. Auto-terminate timer of some short duration (e.g., 15 minutes)
  3. Launch the instance, wait a few minutes, and verify that the instance is running (it will show up in the AWS Console or in the list in simple-ec2 connect -i
  4. Wait 15 minutes

Result: The Windows instance is still running and it did not terminate

Expected outcome:

The Windows instance should terminate after the set time. If this is not possible, simple-ec2 should not give the user that option when selecting a Windows AMI.

This mechanism is implemented with a "shut down in the future" command in the userdata script, but that command is specific to Linux. It may be possible to do this in Windows with the following PowerShell command:

shutdown -s -t <TimeInSeconds>

Workaround:

Manually terminate the instance with simple-ec2 terminate or via the AWS Console

Environment

  • App Version: 0.6.0
  • OS/Arch: MacOS 12.2 Intel
@snay2 snay2 added the bug Something isn't working label Mar 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant