UPDATE: This issue has been resolved. Guest-initiated shutdowns will no longer result in the VM restarting instead of shutting down. This means that you can useShutdown in the Shutdown options drop-down menu or the /shutdownswitch when running the sysprep tool. Note that using the workaround to specifyQuit still works also, so if you had changed to using that as a workaround in the meantime it is not necessary to immediately switch back to usingShutdown.
----------------------
We are currently investigating an issue where VMs are unexpectedly started after a guest-initiated shutdown. This does not impact portal-initiated shutdown (clicking Shutdown in the Windows Azure management portal).
Guest-initiated shutdown would be any process that triggers a shutdown from within the guest OS, which could be sysprep /shutdown, or manually shutting down the VM from within an RDP session.
When capturing an image, the guest needs to remain shutdown for it to be captured in the correct state. If you capture a VM that has been started after sysprep has been run, the guest OS is not in the correct state. The capture operation will succeed, but VMs created from the image will fail to provision successfully, and will ultimately show statusProvisioning timed out. This is because the VM was captured when the setup state was IMAGE_STATE _UNDEPLOYABLE instead of the desired IMAGE_STATE_GENERALIZE_RESEAL_TO_OOBE (see alsohttp://technet.microsoft.com/en-us/library/cc721913(v=ws.10).aspx for description of those values).
To workaround this issue, specify Quit instead of Shutdown when running sysprep, and once sysprep completes, shutdown the VM from the Shutdown option in the Windows Azure management portal instead of from within the RDP session.
- Create a second user account that you add to the local Administrators group to use for troubleshooting if needed.
- Run Sysprep, selecting Enter System Out-of-Box Experience (OOBE) andGeneralize checked but select Quit instead of Shutdown.
Or from a command-line:
c:\windows\system32\sysprep\sysprep.exe /generalize /oobe /quit
- Wait for the C:\Windows\System32\sysprep\Sysprep_succeeded.tag file to be created before doing anything else, as that indicates sysprep completed.
- Log off from the VM, leaving it running. Do not shut it down from within the RDP session.
- Click Shutdown for the VM in the Windows Azure management portal.
- When the Status under Quick Glance on the
Dashboard of the VM in the portal shows Stopped (Deallocated), then you can clickCapture at the bottom to create the image.