Windows 2012R2 AWS AMI "Password not available yet" issue, most likely related to sysprep.

36 views
Skip to first unread message

Justin Metz

unread,
May 22, 2019, 2:43:33 PM5/22/19
to Packer
Hi All,

I'm having an intermittent issue producing a consistently working Windows 2012R2 AMI.  It seems that 1 out of every 3 builds produces an AMI that continually throws the message below when an instance created from it is accessed.

(Password not available yet.  Please wait at least 4 minutes after launching an instance before trying to retrieve the auto-generated password)

My assumption is it has something to do with the timing of the call to sysprep, but I have no evidence of that.  I am using the two provisioners below at the end of the config to restart, then kick off the sysprep process, is this correct for 2012R2 in AWS?
Should I put in a Start-Sleep for a minute or two (in the windows-shell provisioner) before kicking off the sysprep?

I'm curious to find out if anyone else has run into a situation such as this...

       {
          "type":"windows-restart",
          "restart_timeout":"30m",
          "restart_check_command": "powershell -command \"& {Write-Output 'restarted.'}\""
       },
       {
         "type": "windows-shell",
         "inline": ["\"c:\\Program Files\\Amazon\\Ec2ConfigService\\ec2config.exe\" -sysprep"]
       }

Thanks in advance!

J

Justin Metz

unread,
May 28, 2019, 10:19:25 AM5/28/19
to Packer
Anyone have any ideas on this one?
Reply all
Reply to author
Forward
0 new messages