You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
while the vm is rebooting the ssh communicator keeps (re)trying to connect to ssh, but that will fail because the connection is refused by the vm while its booting / not yet ready... and the communicator gives up too quickly.
while following the code, this ended up being because the retry logic of the ssh communicator at
I ran into this problem as well. In my case my guests are RHEL VMs where they are pingable before the SSH daemon starts up. The behavior i see with vagrant up --debug is:
The guest becomes pingable
An SSH connection is initiated
SSH returns CONNECTIONREFUSED because the SSH daemon on the guest isn't up yet (taking a little while to boot)
Vagrant does NOT retry and simply exits with an error
I found the same section of code that @rgl did and manually set the opts[:retries] to 5 (seems to be set to 1 when the function is called) and then added in a sleep. This allowed the SSH connection to be retried and communication to the guest works great.
I'm thinking a good solution would be to expose something like:
while using vagrant 2.2.4 I'm trying to reboot an ubuntu vm with:
with
reboot.sh
being:nohup bash -c "ps -eo pid,comm | awk '/sshd/{print \$1}' | xargs kill; sync; reboot"
while the vm is rebooting the ssh communicator keeps (re)trying to connect to ssh, but that will fail because the connection is refused by the vm while its booting / not yet ready... and the communicator gives up too quickly.
while following the code, this ended up being because the retry logic of the ssh communicator at
vagrant/plugins/communicators/ssh/communicator.rb
Line 431 in b1d8b95
sleep
argument, e.g.:maybe that
timeout
should trickle down from the Vagrantfile provision line (likeopts[:retries]
), e.g.: with thesleep
argument:The text was updated successfully, but these errors were encountered: