Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

Well, if that error is a result of too many syspreps, then there is a workaround, provided the original image wasn't created by an OEM. Try the below:

  1. Run slmgr.vbs /dlv and check the re-arm counter towards the bottom

  2. If it is not zero then you should be able to workaround this issue by running slmgr.vbs –rearm (skip step 3)

  3. If it is zero, you will need to use an unattend.xml file. See example here, beneath the header "The following text is an example of an XML answer file for Windows 7:" (Add that to your unattend.xml file - I can't post it here.)

  4. Run slmgr.vbs –rearm

  5. Alter the following registry keys to match the values below Use regedit to change the below reg keys to match

    HKEY_LOCAL_MACHINE\SYSTEM\Setup\Status\SysprepStatus\GeneralizationState\

    CleanupState:2

    HKEY_LOCAL_MACHINE\SYSTEM\Setup\Status\SysprepStatus\GeneralizationState\

    GeneralizationState:7

  6. Start -> Run : msdtc -uninstall

  7. Start -> Run : msdtc -install (wait few seconds)

  8. Reboot

  9. Run sysprep again

And do note, there is a limit on the number of rearms you can do. MS says 3, and though I've never hit it, you might want to tweak your process to accommodate that. Get to a "gold" image without using sysprep, and then bake in all your cumulative changes into one process so you avoid syspreping an image that's already been sysprepped multiple times. Hardly ideal, but that's Windows for ya.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.