Search code examples
chef-infrarackspaceknifewinrm

knife bootstrap windows winrm timeout issue


I was trying to build windows machine via knife rackspace server create, however, I got the timeout issue that it is just a little bit not long enough to wait until it gets respond from remote node.

Is it a way to increase the timeout?

Thanks a lot.

Below is the result I got the time difference, 1. knife rackspace server create; 2. knife bootstrap

   Waiting server
   Public DNS Name: 119.9.13.107.xip.io
   Public IP Address: 119.9.13.107
   Private IP Address: 10.176.4.151
   Password: E5yQwJTuo94e
   Metadata: []

   Waiting for winrm
   Waiting for remote response before bootstrap.ERROR: No response received from remote node after 1.01 minutes, giving up.
   ERROR: RuntimeError: Command execution failed.

by the way, winrm is installed on the windows template image.

  ± % knife bootstrap -VVV windows winrm "119.9.13.107" -r "recipe[windows_nps],recipe[windows_dhcp],recipe[passthrough_monitor]" -x "autotest\\qa" -P "GibesG9eSEG"
   WARNING: Could not load IOV methods. Check your GSSAPI C library for an update
   WARNING: Could not load AEAD methods. Check your GSSAPI C library for an update

   Waiting for remote response before bootstrap.DEBUG: Adding 119.9.13.107
   DEBUG: :session => :init
   DEBUG: :relay_to_servers => echo . & echo Response received.
   DEBUG: :relayed => 119.9.13.107
   DEBUG: 119.9.13.107 => :run_command
   DEBUG: 119.9.13.107[C2E316A7-E69E-4099-A3B3-3F35B384CBD1] => :shell_open
   DEBUG: 119.9.13.107[C2E316A7-E69E-4099-A3B3-3F35B384CBD1] => :run_command[echo . & echo        Response received.]
   DEBUG: :relay_output_from_backend => ["119.9.13.107", ". \r\n"]
   119.9.13.107 .
   DEBUG: :relay_output_from_backend => ["119.9.13.107", "Response received.\r\n"]
   119.9.13.107 Response received.
   DEBUG: 119.9.13.107[C2E316A7-E69E-4099-A3B3-3F35B384CBD1] => :command_cleanup[echo . & echo Response received.]
   DEBUG: 119.9.13.107[C2E316A7-E69E-4099-A3B3-3F35B384CBD1] => :shell_close
   DEBUG: :command_complete => 119.9.13.107 with return code 0
   DEBUG: command complete on 119.9.13.107
   DEBUG: command complete on All Servers
   DEBUG: :unbind => :connection
   DEBUG: 119.9.13.107 => :unbind
   DEBUG: :unbind_backend => 119.9.13.107
   DEBUG: :session => :close
   Remote node responded after 1.08 minutes.
   Bootstrapping Chef on 119.9.13.107

Solution

  • Knife-rackspace performs a TCP check before any interesting work. My guess is that you're getting hung up on that TCP check, even though WinRM is working:

    https://github.com/opscode/knife-rackspace/blob/master/lib/chef/knife/rackspace_server_create.rb#L315

    I recently submitted a patch to add an option that disables the TCP check for SSH, but you may want to try something similar on Windows, especially if you're doing this from a network with a lot of access restrictions:

    https://github.com/opscode/knife-rackspace/blob/master/lib/chef/knife/rackspace_server_create.rb#L170

    Hope this helps!