chef / knife-windows

Plugin for Chef's knife tool for working with Windows nodes
Apache License 2.0
152 stars 110 forks source link

knife winrm stops when there is one host which is not responding #445

Closed liivats closed 4 years ago

liivats commented 6 years ago

If you using command knife winrm **"platformfamily:windows" "hostname"** Then it fails when reaches the host which is not responding. To compare knife ssh, then knife ssh works as expected. It resumes when there is non-responsive host.

Please fix it as it is really important to be able to proceed with hosts which running.

PS C:\windows\system32> _knife winrm "platformfamily:windows" "hostname" -x 'username' Enter your password: hostname1 hostname1 ERROR: Network Error: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. - connect(2) for "hostname2" port 5985 (hostname2:5985) Check your knife configuration and network settings PS C:\windows\system32>

bish0polis commented 6 years ago

This looks like #402 .

Vasu1105 commented 6 years ago

@liivats sure we will look into this on priority and let you know once this gets reproduced and fix

Vasu1105 commented 6 years ago

@liivats Sorry for late response

@liivats I have identified that to connect to multiple servers using knife winrm command you need to also provide an --concurrency The number of allowed concurrent connection option along with your --manual-list QUERY is a space separated list of servers option

The command which I verified is

knife winrm -C 3 -m "<ip-address-1> <ip-address-2> <ip-address-2>" 'hostname' -x "azure" -P "azure@12345678" -c ~/workspace/chef-repo/.chef/knife.rb

and the result which I got is it did listed the hostname for the servers which are responding and then at the end the end I got timeout error for the server which I purposely stopped

<ip-address-1> vj-msys-891
<ip-address-3>  vj-msys-891-is2

/home/msys/workspace/knife-windows/bundle/ruby/2.5.0/gems/httpclient-2.8.3/lib/httpclient/session.rb:611:in `initialize': execution expired (HTTPClient::ConnectTimeoutError)
ERROR: HTTPClient::ConnectTimeoutError: execution expired

@btm do you think that based on the number of servers that are coming as input from user we should decide the concurrency and set it dynamically rather than expecting that to be provided by user?

NAshwini commented 4 years ago

Closing this issue as its been resolved by PR https://github.com/chef/knife-windows/pull/484