Closed sinking0h closed 1 year ago
You most likely have a PAM setting that is throttling the ssh connections.
@sinking0h Did you find a solution for this? I'm seeing the same behavior
Update: It turned out to be our Unifi Dream Machine firewall dropping the connections, due to package inspection thinking this was a SSH scan attack.
Remote SSH connection hangs after 5 consecutive runRemoteSshCommand commands and times out after ~15 minutes retrying connection;
After connection retry, after another 5 consecutive runRemoteSshCommand it hangs again and times out after 15 minutes;
This continues until VM is created (guest VM creation takes ~3 hours because of the timeout wait times)
Modified MaxStartups, UsePAM, and other sshd config vars to no avail;
after adding breaking point and error printing before
log.Printf("[runRemoteSshCommand] Retry connection: %d\n", attempt)
the below error is shown
[DEBUG] provider.terraform-provider-esxi_v1.10.2: pid-1754-esxi_remote_cmds.go:41: ssh: handshake failed: read tcp :->:: read: connection timed out [DEBUG] provider: plugin process exited: path=./esxi/1.10.2/linux_amd64/terraform-provider-esxi_v1.10.2 pid=1754 error="exit status 1"
if the breaking point is not added, VM creation takes ~3H otherwise it stops at the first timeout.
main.tf