unable to WinRM via internal IP

256 views
Skip to first unread message

Jon A.

unread,
Jun 20, 2019, 4:52:04 PM6/20/19
to Packer

Hello, 
I'm trying to use the "A Windows Example" on the Packer build-image tutorial. 

The ONLY thing I've changed to get it partially working, is setting "vpc_id" and "subnet_id" in the builders section because we do not have a default VPC. I also have tried this with Win 2012 base and Win 2016 base.

The machine spins up, but freezes at 

==> amazon-ebs: Waiting for WinRM to become available...

I enabled RDP in the temporary packer security group and can connect to the machine. I verified that the bootstrap_win is at least partially running by putting in a powershell command to create a file on the new machine and it did so. I ran Test-WSMan on the machine and I don't get any errors. 

I enabled debug, and the log is just filled with: 

2019/06/20 16:13:02 packer.exe: 2019/06/20 16:13:02 [INFO] Attempting WinRM connection...
2019/06/20 16:13:02 packer.exe: 2019/06/20 16:13:02 [DEBUG] connecting to remote shell using WinRM
2019/06/20 16:13:02 packer.exe: 2019/06/20 16:13:02 [ERROR] connection error: unknown error Post http://ip-10-0-0-37.ec2.internal:5985/wsman: dial tcp: lookup ip-10-0-0-37.ec2.internal: no such host
2019/06/20 16:13:02 packer.exe: 2019/06/20 16:13:02 [ERROR] WinRM connection err: unknown error Post http://ip-10-0-0-37.ec2.internal:5985/wsman: dial tcp: lookup ip-10-0-0-37.ec2.internal: no such host

Is the problem that it is trying to use the internal IP vs. external? Is there a way to force external? The newly created machine is not on any domain. I also tried manually creating a different machine on the same VPC, installed Packer, and went through these same steps with the same result. 

I've seen others with the same or similar behavior, but the cause/solution seems different.
Any ideas?

Thanks,
Jon

Rickard von Essen

unread,
Jun 20, 2019, 5:01:15 PM6/20/19
to packe...@googlegroups.com
Most likely you are launching the instans in a private network (I.e instances don't get a public IP).

Try setting associate_public_ip_address to true. That will work if you have an igw correctly setup for that subnet work. 




--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/f5da2ce0-8e4b-4cd0-97f8-9b6eb75aba1c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jon A.

unread,
Jun 20, 2019, 6:38:49 PM6/20/19
to Packer
There is an igw attached to the VPC, and adding associate_public_ip_address does not help. It was already producing a public IP, that's how I was able to RDP to it, but the packer log shows it trying to connect to the internal IP... 

Thanks,
Jon
To unsubscribe from this group and stop receiving emails from it, send an email to packe...@googlegroups.com.

Rickard von Essen

unread,
Jun 21, 2019, 2:32:01 AM6/21/19
to packe...@googlegroups.com
Could you provide your template and a copy of the output from running with env var PACKER_LOG=1 set. 

To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/f2aac118-1b70-4251-bfe7-91e4abf6c218%40googlegroups.com.

Jon A.

unread,
Jun 21, 2019, 1:49:50 PM6/21/19
to Packer
See attachments. They are basically the windows example with very minor modifications. 
Thanks,
Jon
winexample.json
bootstrap_win.txt
packerlog.txt
Reply all
Reply to author
Forward
0 new messages