I think the official Azure instructions on how to capture a VM image must be either incorrect or incomplete. I've run a variety of tests myself (detailed below) and more than two dozen people have complained on the page that the instructions don't work and/or damage their VM's. Surely something is missing from the instructions because people must be able to capture images from Azure VM's.
http://www.windowsazure.com/en-us/manage/windows/how-to-guides/capture-an-image/
The instructions on the page are pretty simple:
- Remote Desktop into your Azure VM
- Open an administrator command window
- Run sysprep with the indicated settings (Out-Of-Box-Experience, Generalize, Shutdown)
- Hit OK
- Wait for the system to shut the VM down
- Click capture in the portal.
It sounds simple but the VM never actually shuts down so you can't actually click the capure button. If you manually shutdown the instance, even after waiting many hours, the resulting image fails to work and the original vhd is destroyed in the process.
Can anyone confirm you are able to capture a running Azure instance using either this workflow or some other workflow? If so, can you tell me what you're doing differently from what I'm doing?
Details - The tests I've run are as follows:
TEST 1 - Win2k8 R2 on Small instance
- Launch a small instance of Win2k8 R2 in the US West region
- Remote desktop into the image
- Run sysprep with OOBE,generalize,shutdown
- Azure dashboard shows all CPU activity completed after 15min of sysprep, device is idle, steady state is 0.41% cpu
- Wait several hours (>2.5 hours as of this writing on this instance, >12 hours on other tests)
- Azure VM is still running, capture button for the instance is unavailable in portal
TEST 2 - Win2k8 R2 on Large instance
- same steps as Test 1 but on Large instance
- same results except steady state CPU utilization is 0.08% after 15 minutes
TEST 3 - Win2k12 Data Center Edition on small instance
- same steps as Test 1 but run Win2k12 Data Center
- same result as Test 1 except steady state CPU utilization is 4.2%
TEST 4 - Win2k8 R2 on Small instance with Windows update
- same steps as Test 1 but run Windows Update repeatedly until no more updates available before running sysprep
- same results as Test 1
TEST 5 - Win2k8 R2 on Small instance with Visual Studio 2012 Update 3
- same steps as Test 1 but install VS2012 Ultimate and VS2012 Update 3 before running sysprep
- same results as Test 1
TEST 6 - Win2k8 R2 on Large instance with fully configured IIS server
- provision our standard server configuation (IIS, .NET 4.5) on a large instance
- run our standard web service tests
- run sysprep with OOBE,generalize,shutdown
- wait 4 hours, allowing sysprep to run
- use portal to shutdown instance
- use portal to capture instance
- generated image doesn't work (provisioning machines with it times out after a couple hours)
- original VHD doesn't work (can't remote desktop into instance created with the VHD)
TEST 7 - Win2k8 R2 on Large instance with fully configured IIS server
- same as test 6 except wait 12 hours allowing sysprep to run
- as of this writing (12+ hours) the VM still hasn't shut down