Timeout waiting for WinRM

458 views
Skip to first unread message

chuck smith

unread,
May 10, 2016, 5:15:53 PM5/10/16
to Packer

I am trying out Packer for the first time. I am using packer version 0.10.1

Here is my json file:

----
{
  "builders": [{
    "type": "amazon-ebs",
    "region": "us-west-2",
    "availability_zone": "us-west-2a",
    "instance_type": "m3.medium",
    "source_ami": "ami-xxxxxx",
    "ami_name": "packer-win-29",
    "user_data_file": "bootstrap-aws.txt",
    "communicator": "winrm",
    "winrm_username": "Administrator",
    "winrm_password": "Foobar12",
    "winrm_timeout": "1h",
    "access_key": "xxxxx",
    "secret_key": "yyyyy"
  }],
  "provisioners": [{
    "type": "powershell",
    "scripts": [
      "install-additional-programs.ps1"
    ]
  }]
}

---

Here is the debug output:
---

$ packer build -debug -parallel=false windows_ami_test.json 

Debug mode enabled. Builds will not be parallelized.

amazon-ebs output will be in this color.


==> amazon-ebs: Prevalidating AMI Name...

==> amazon-ebs: Pausing after run of step 'StepPreValidate'. Press enter to continue. 

==> amazon-ebs: Inspecting the source AMI...

==> amazon-ebs: Pausing after run of step 'StepSourceAMIInfo'. Press enter to continue. 

==> amazon-ebs: Creating temporary keypair: packer 57323086-608e-fce6-06c0-828af4970a8d

    amazon-ebs: Saving key for debug purposes: ec2_amazon-ebs.pem

==> amazon-ebs: Pausing after run of step 'StepKeyPair'. Press enter to continue. 

==> amazon-ebs: Creating temporary security group for this instance...

==> amazon-ebs: Authorizing access to port 5986 the temporary security group...

==> amazon-ebs: Pausing after run of step 'StepSecurityGroup'. Press enter to continue. 

==> amazon-ebs: Pausing after run of step 'stepCleanupVolumes'. Press enter to continue. 

==> amazon-ebs: Launching a source AWS instance...

    amazon-ebs: Instance ID: i-8f804749

==> amazon-ebs: Waiting for instance (i-8f804749) to become ready...

...

==> amazon-ebs: Pausing after run of step 'StepRunSourceInstance'. Press enter to continue. 

==> amazon-ebs: Pausing after run of step 'stepTagEBSVolumes'. Press enter to continue. 

==> amazon-ebs: Skipping waiting for password since WinRM password set...

==> amazon-ebs: Pausing after run of step 'StepGetPassword'. Press enter to continue. 

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

==> amazon-ebs: Timeout waiting for WinRM.

==> amazon-ebs: Pausing before cleanup of step 'StepGetPassword'. Press enter to continue.  

==> amazon-ebs: Pausing before cleanup of step 'stepTagEBSVolumes'. Press enter to continue. 

==> amazon-ebs: Pausing before cleanup of step 'StepRunSourceInstance'. Press enter to continue. 

==> amazon-ebs: Terminating the source AWS instance...

==> amazon-ebs: Pausing before cleanup of step 'stepCleanupVolumes'. Press enter to continue.  

==> amazon-ebs: No AMIs to cleanup

==> amazon-ebs: Pausing before cleanup of step 'StepSecurityGroup'. Press enter to continue. 

==> amazon-ebs: Deleting temporary security group...

==> amazon-ebs: Pausing before cleanup of step 'StepKeyPair'. Press enter to continue. 

==> amazon-ebs: Deleting temporary keypair...

==> amazon-ebs: Pausing before cleanup of step 'StepSourceAMIInfo'. Press enter to continue. 

==> amazon-ebs: Pausing before cleanup of step 'StepPreValidate'. Press enter to continue. 

Build 'amazon-ebs' errored: Timeout waiting for WinRM.


==> Some builds didn't complete successfully and had errors:

--> amazon-ebs: Timeout waiting for WinRM.


==> Builds finished but no artifacts were created.

----


Thanks for your help!




chuck smith

unread,
May 10, 2016, 5:46:15 PM5/10/16
to Packer
Here is what is in the 'bootstrap-aws.txt'
==
<powershell>

# set administrator password
net user Administrator Foobar12
wmic useraccount where "name='Administrator'" set PasswordExpires=FALSE

# configure WinRM
winrm quickconfig -q  
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="0"}'  
winrm set winrm/config '@{MaxTimeoutms="7200000"}'  
winrm set winrm/config/service '@{AllowUnencrypted="true"}'  
winrm set winrm/config/service/auth '@{Basic="true"}'

netsh advfirewall firewall add rule name="WinRM 5985" protocol=TCP dir=in localport=5985 action=allow

net stop winrm  
sc config winrm start=auto  
net start winrm

# turn off PowerShell execution policy restrictions
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope LocalMachine

</powershell> 

===

Climb Everything

unread,
Aug 1, 2017, 8:18:01 PM8/1/17
to Packer
Did you ever get a fix on this? I am encountering the same issue with a nearly identical template.

-Brando


On Tuesday, May 10, 2016 at 2:15:53 PM UTC-7, chuck smith wrote:

Rickard von Essen

unread,
Aug 2, 2017, 2:26:01 AM8/2/17
to packe...@googlegroups.com
Please post your template and user-script. 

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/9a2b2c4f-95ea-4056-b3c0-4e5e489c94a4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages