Sysprep AMI Error in AWS

Yesterday our team created a Sysprep'd image of a Windows Server 2012 R2 base install in AWS. We made some changes to make the AMI a golden image per a customer provided document. From our initial review, none of the changes should have affected the Sysprep process.

Instance System Log from the Console

Instance System Log from the Console

The Problem:

After performing the Sysprep from the EC2ConfigTool in AWS, and trying to test our new image, we'd get the following error in the System Logs screen in the EC2 console.

Windows is still being configured. SysprepState=IMAGE_STATE_SPECIALIZE_RESEAL_TO_OOBE

The Solution:

It turns out that in AWS, when performing a Sysprep on a Windows Server, you cannot change the local administrator username or remove the account. This will break the syprep deployment and leave you scratching your head in frustration.