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 doesn't skip missing nodes #450

Closed spuder closed 6 years ago

spuder commented 6 years ago

When doing knife ssh, if a node isn't available, knife will skip it and go to the next knife winrm will abort on the first node that isn't available

For example, 3 nodes, the 2nd one doesn't exist.

knife winrm -C 1 -m "server1.real.com server2.fake.com server3.real.com" 'hostname' -x example.com\\yourusername
Enter your password:
server1.real.com server1
ERROR: Network Error: getaddrinfo: No such host is known.  (server2.fake.com:5985)
Check your knife configuration and network setting

Expected behavior

It should skip number 2 and go to number 3

Actual behavior

knife winrm exits

dheerajd-msys commented 6 years ago

@spuder I've tried to reproduce the issue but in my case it doesn't skip the node and neither knife winrm exits. Followed below steps to reproduce the issue (Please correct me if I am missing something here) :

  1. Created 3 Azure VMs
  2. Registered 2 of them with chef-server
  3. Activated WinRM on all 3 VMs
  4. Executed command and output is :
    PS D:\Chef_Repo\knife-windows> bundle exec knife winrm -C 1 -m "104.211.48.161 40.121.67.32 40.117.143.101" 'hostname' -x "xxxxxxx" -P "xxxxxxxx" -c D:\chef-starter\chef-repo\.chef\knife.rb
    104.211.48.161 dh-win1-winrm
    104.211.48.161
    40.121.67.32 dh-win3-winrm
    40.121.67.32
    40.117.143.101 dh-win2-winrm
    40.117.143.101

    PS : dh-win3-winrm is not registered with chef-server Please let me know if there is anything which I am missing here.

Thanks

spuder commented 6 years ago

Power off the second vm so that it isn't accessible.

Vasu1105 commented 6 years ago

@spuder sorry for late response could you please check my comments on #445 and let me know if that gives you expected output.

You need to provide the concurrency number based on list of servers you want to run that command

spuder commented 6 years ago

I’ve switched jobs so I don’t have access to a chef server anymore.

Vasu1105 commented 6 years ago

Ohh okay. I am closing for this now and you can reopen this if you by any chance get the time to verify this and still face the issues.

NAshwini commented 4 years ago

This issue is resolved by PR #484