I’m baking AMIs in EC2 with Ansible. Last step involves a call to sysprep.
Before that, I want to wait for any post-install steps to have finished (.NET Framework 4.5 I’m looking at you and your mscorsvw.exe). If they’re not complete, then they’ll probably complete after instances are started, which won’t be ideal.
I thought one way would be wait for the system idle process to sustainedly stay at more than 90% for 5 minutes.
Or, figure out which processes running are normal, and wait for just those to be active.
Does anyone have better ideas? Mine seem quite brittle to me!