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

Support max-run-duration and instance-termination-action #173

Open
ralbertazzi opened this issue Jul 6, 2023 · 0 comments
Open

Support max-run-duration and instance-termination-action #173

ralbertazzi opened this issue Jul 6, 2023 · 0 comments

Comments

@ralbertazzi
Copy link

ralbertazzi commented Jul 6, 2023

Community Note

Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request.
If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Description

We have automated Packer jobs running in our CI systems. Sometimes Packer encounters temporary non-reproducible errors that lead to VMs that are not shutdown properly. This has several downsides both in terms of costs and robustness of future jobs (as running VMs contribute to the project's quota).

We learnt to live with this flakiness and embraced the fact that things can sometimes fail. We now have a periodic cleanup job that deletes packer VMs that have been running for too long, as it means that the related job probably failed in an ungraceful way.

Google Cloud supports setting the maximum runtime of an instance via the max-run-duration and instance-termination-action parameters. If this Packer plugin supported setting these values through HCL language, we would be able to get rid of the custom cleanup job.

Use Case(s)

A failsafe mechanism to delete Packer VMs even if Packer fails to delete a VM.

Potential configuration

max_run_duration
instance_termination_action

Potential References

https://cloud.google.com/compute/docs/instances/limit-vm-runtime

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant