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

Document wait time between attempts in ssh_handshake_attempts #249

Open
VladRassokhin opened this issue Feb 16, 2021 · 2 comments
Open

Document wait time between attempts in ssh_handshake_attempts #249

VladRassokhin opened this issue Feb 16, 2021 · 2 comments
Labels
docs enhancement New feature or request

Comments

@VladRassokhin
Copy link
Contributor

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

$subj or make it configurable.
Had to look into packer-plugin-sdk sources to check what is wait time. (2 seconds at the moment I'm writing this)

Use Case(s)

To better understand what to set in ssh_handshake_attempts, e.g. expected_wait_time_in_seconds/2.

Sometimes if cloud-init adds a public key it may take some time, e.g. when it's datasources have to wait for some external metadata. So first minute after sshd daemon is up, no one will be able to authorize since public key is not added to .ssh/authorized_keys yet. In such condition packer may fail since 10 attempts will happen in just 20 seconds.

@VladRassokhin VladRassokhin added the enhancement New feature or request label Feb 16, 2021
@tenthirtyam
Copy link

tenthirtyam commented Jun 13, 2024

Please transfer to https://github.com/hashicorp/packer-plugin-sdk.

There, this could be resolved by extending the following comment:

	// The number of handshakes to attempt with SSH once it can connect.
	// This defaults to `10`, unless a `ssh_timeout` is set, with a 2 second interval.
	SSHHandshakeAttempts int `mapstructure:"ssh_handshake_attempts"`

cc @lbajolet-hashicorp since Lucas authored the most recent related change b81b86f.

Ryan Johnson
Distinguished Engineer, VMware by Broadcom

@lbajolet-hashicorp
Copy link
Contributor

That looks like an SDK issue indeed, as pointed out, adding the default wait-time between two attempts is a solution for this.
Alternatively I imagine we could make the time between two attempts configurable.

Come to think of it, it looks like the ssh_handshake_attempts has precedence over the other, and looking at the docs, it's not clear which is.

I'll transfer this issue and revisit the code ASAP, thanks for bumping this @tenthirtyam!

@lbajolet-hashicorp lbajolet-hashicorp transferred this issue from hashicorp/packer Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants