Skip to content

Make EBS source termination wait optional#683

Open
FocalChord wants to merge 1 commit into
hashicorp:mainfrom
FocalChord:optional-source-termination-wait
Open

Make EBS source termination wait optional#683
FocalChord wants to merge 1 commit into
hashicorp:mainfrom
FocalChord:optional-source-termination-wait

Conversation

@FocalChord

Copy link
Copy Markdown

Description

This PR adds an Amazon EBS builder option named skip_source_instance_termination_wait.

When the option is false, behavior is unchanged. Packer still waits for EC2 to report the source instance as terminated.

When the option is true, Packer returns from source instance cleanup after TerminateInstances succeeds. This keeps the choice explicit and separate from skip_create_ami.

This PR does not change AMI creation or AMI preparation behavior.

Resolved Issues

Closes #682

Evidence

The direct EC2 data I saw suggests the final source instance state can take much longer on bare metal instances than the API acceptance of termination.

  1. c5.large reached terminated in about one minute after TerminateInstances was accepted.
  2. c5.metal remained shutting-down for more than 19 minutes before later reaching terminated.
  3. A minimal local Packer run on c5.metal saw EC2 accept source instance termination around one second after Packer requested it.

Validation

  1. go test ./builder/common ./common ./builder/ebs
  2. Local plugin build completed
  3. Git whitespace check passed

Rollback Plan

Revert this change.

Changes to Security Controls

No. This does not change access controls, encryption, or logging.

@FocalChord FocalChord requested a review from a team as a code owner June 15, 2026 08:02
@hashicorp-cla-app

Copy link
Copy Markdown

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes

Have you signed the CLA already but the status is still pending? Recheck it.

@FocalChord

Copy link
Copy Markdown
Author

Hi, I signed the CLA but unsure why it hasn't gone through yet.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EBS source instance termination wait can dominate cleanup

2 participants