I have configured my Jenkins to execute a Linux instance on AWS EC2. This works absolutely fine and I am able to invoke Linux instances on EC2 via Jenkins. (Installed a couple of plugins; settings; creating custom Linux AMI etc.).
I want to run a Windows instance on EC2 via Jenkins. I have already setup a custom Windows AMI with Java installed and Winrm configured; a security group that allows TCP on port 445 and 5985; for SMB and Winrm respectively (https://issues.jenkins-ci.org/browse/JENKINS-4995).
I am able to invoke this Windows instance from Jenkins, but it never connects(just continues the loop "Connecting to ec2-54-191-40-110.us-west-2.compute.amazonaws.com(54.191.40.110) with WinRM as. Waiting for WinRM to come up. Sleeping 10s."
Please help me with the same.
you will need to create a new AMI and change the execution policy on it.
create a new machine from the AMI you mentioned above.
login to it and run the following from the cmd
powershell Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope LocalMachine
take a new image.
configure the new AMI in jenkins.
and you are good to go.
I ran into similar problem. However in my case it turned out that I had windows firewall enabled and it was blocking port 445 which is required before the winrm connection as revealed by plugin source code: https://github.com/jenkinsci/ec2-plugin/blob/0278dd242a554ff200144b813122505f6d8dcd0e/src/main/java/hudson/plugins/ec2/win/WinConnection.java Look at the ping() method
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With