azurewindows-server-2008azure-vm-roleunattended-processing

sysprep failure on Windows Server 2008


Before deploying a Azure VM Role, we need to perform

%windir%\system32\sysprep\sysprep.exe /generalize /oobe /shutdown

But in my case the sysprep fails with the log file %windir%\system32\sysprep\Panther\setuperr.txt saying:

2012-07-05 08:03:57, Error      [0x0f0073] SYSPRP RunExternalDlls:Not running DLLs; either the machine is in an invalid state or we couldn't update the recorded state, dwRet = 31
2012-07-05 08:03:57, Error      [0x0f00ae] SYSPRP WinMain:Hit failure while processing sysprep cleanup external providers; hr = 0x8007001f

I do not always want to create a new image. Is there any work around? I followed the instructions in MS support here and tried:

%windir%\system32\sysprep\sysprep.exe /generalize /oobe /shutdown /unattend:.\unattend.xml

It did not work.

Under certain circumstances, I need to tear down the VM Image from azure and re-deploy with some more changes. So sysprep has to run almost twice every week.


Solution

  • Found that there is a limited number of times we can run sysprep on a Windows machine. I made the mistake of keeping one image and run sysprep on it everytime before uploading it as Azure VM Role. This can cause the licensing etc fail on the Windows machine.

    So what I am doing now is keeping one backup of the VHD which is not syspreped and making changes to it. Then keeping backup again before running sysprep. So basically the Windows is effectively sysprepped only once before uploading. It works for me now.