amazon-ebs output will be in this color.
==> amazon-ebs: Prevalidating AMI Name...
==> amazon-ebs: Inspecting the source AMI...
==> amazon-ebs: Creating temporary keypair: packer xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
==> amazon-ebs: Creating temporary security group for this instance...
==> amazon-ebs: Authorizing access to port 5986 the temporary security group...
==> amazon-ebs: Launching a source AWS instance...
amazon-ebs: Instance ID: i-xxxxxxxx
==> amazon-ebs: Waiting for instance (i-xxxxxxxx) to become ready...
==> amazon-ebs: Waiting for auto-generated password for instance...
amazon-ebs: It is normal for this process to take up to 15 minutes,
amazon-ebs: but it usually takes around 5. Please wait.
amazon-ebs:
amazon-ebs: Password retrieved!
==> amazon-ebs: Waiting for WinRM to become available...
==> amazon-ebs: Timeout waiting for WinRM.
==> amazon-ebs: Terminating the source AWS instance...
==> amazon-ebs: No AMIs to cleanup
==> amazon-ebs: Deleting temporary security group...
==> amazon-ebs: Deleting temporary keypair...
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.
Hi Aman,
Terraform being in the userdata is just because I was also using the packer built amis in terraform -later.
It’s the winrm http port that needs opening on the packer ami (via userdata) and the on the machine running packer. Leave https for now.
The main problem is that the script in userdata can fail silently, so you really need to check it. I was setting a password on the AMI that failed the default password policy and it was all failing.
(My clients network was also blocking winrm ports so I had to tether my phone but that’s somewhat less likely)
If that doesn’t help post what you have and ill have a look. James
--
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 a topic in the Google Groups "Packer" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/packer-tool/2bW8Oe-InRg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to packer-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/5b4bc0c6-27d6-40c5-aa41-1d1125a7641d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I got an adapted version of your sample. Three things -firewall, needs a more complex password other wise it fails silently and you don’t need to specify a security group (its only temporary).
Example.json
{
"variables": {
"admin_password": "some0thingG?me5"
},
"builders": [
{
"type": "amazon-ebs",
"region": "us-east-1",
"source_ami": "ami-c8a9baa2",
"instance_type": "m4.xlarge",
"user_data_file": "bootstrap-aws.txt",
"communicator": "winrm",
"winrm_username": "Administrator",
"winrm_timeout": "30m",
"winrm_password": "{{user `admin_password`}}",
"ami_name": "windows-ami-01"
}
]
}
<powershell>
Enable-PSRemoting -force
set-item WSMan:\localhost\Service\AllowUnencrypted -Value True
set-item WSMan:\localhost\Service\Auth\Basic -Value True
set-item WSMan:\localhost\Client\AllowUnencrypted -Value True
set-item WSMan:\localhost\Client\Auth\Basic -Value True
set-NetFirewallRule -Name WINRM-HTTP-In-TCP-PUBLIC -Profile Any -Enabled true
set-NetFirewallRule -Name WINRM-HTTP-In-TCP -Profile Any -Enabled true
new-NetFirewallRule -Name Terraform-http -DisplayName "Terraform http" -Enabled True -Profile Any -Action Allow -protocol tcp -RemotePort 5985
new-NetFirewallRule -Name Terraform-https -DisplayName "Terraform https" -Enabled True -Profile Any -Action Allow -protocol tcp -RemotePort 5986
net user Administrator some0thingG?me5
set-executionpolicy bypass -force
</powershell>
Hope that helps.
This works.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/e91385b4-81b3-4aaf-ba3f-dcba2a936927%40googlegroups.com.
Have you opened up winrm locally?
Sent from my Fire
On Sunday, May 1, 2016 at 3:03:43 AM UTC-5, James Woolfenden wrote:</