1
votes

I am using CHEF 12 and trying to bootstrap an EC2 instance (Win server 2012 R2) from my workstation. However, I am getting the below error.

> Waiting for remote response before
> bootstrap.....................ERROR: No response received from remote
> node after 2.08 minutes, giving up. ERROR: Network Error: No
> connection could be made because the target machine actively refused
> it. - connect(2) (http://52.76.1.57:5985) Check your knife
> configuration and network settings

I have two CHEF servers (Hosted as well as on-premises); I have tried bootstraping the EC2 instance using each of these, but get the same result.

Chef bootstrap command issued via power-shell:

PS ~\chef-repo> knife bootstrap windows winrm 52.76.1.57 --winrm-user Administrator --winrm-password '******' --node-name node_145 --run-list 'recipe[ie::esc],recipe[install_iis]'

As far as I researched, it is because I am not able to establish a WINRM connection from my workstation to the Ec2 instance. I am however able to connect to another Win 2012 server within my office network and bootstrap successfully.

  • have already logged in remotely to the EC2 instance and run winrm quickconfig from powershell.
  • have set the Administrator password to a desired one.
  • Have opened inbound firewall rule for WIndows remote management on ports 5985 and 5986
  • Set up setcurity group and allowed inbound Custom TCP rule for ports 5985 and 5986 on AWS
2

2 Answers

1
votes

you took all the necessary steps for this, would it be possible that you are getting filtered by a firewall (e.g company firewall)?

fyi, I managed to bootstrap a machine with the following steps:

# configure winrm for using knife winrm
winrm set winrm/config/service/auth '@{Basic="true"}'
winrm set winrm/config/service '@{AllowUnencrypted="true"}'
set-item WSMan:\localhost\Client\allowunencrypted $true
#turn off firewall
Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False

EDIT: to sum up below comments, the problem was the company firewall that was blocking the traffic

0
votes

Windows 2012 R2 introcuced changes within WinRM security, which rendered some of old articles / readme examples explaining usage of knife-ec and knife-windows unusable.

This article http://blog.coderinserepeat.com/2015/07/15/chef-knife-ec2-and-knife-windows/ pretty much sums up how to deal with this in recent versions of knife plugins.