VMware Cloud Community
BGarrod
Contributor
Contributor

Guest Customization /w sysprep file not working after upgrading vCenter from 4.1 to 5

Up until this point, we have been using custom sysprep answer files to deploy new clones of Windows Server 2008 R2. I wrote a script to take guest-specific info (e.g. hostname, IP address) and replace values in a pre-built sysprep.xml. We then import this into a Guest Customization Specification and clone our template using it.

After upgrading the vCenter server to 5.0, the sysprep process does not successfully run following the clone. It looks like the source of the problem is that the sysprep.xml file vCenter is passing to the new guest is formatted incorrectly. For example, this is what the file looks like before uploading and within vCenter:

<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
    <settings pass="generalize">
        <component name="Microsoft-Windows-OutOfBoxExperience" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <DoNotOpenInitialConfigurationTasksAtLogon>true</DoNotOpenInitialConfigurationTasksAtLogon>
        </component>

While this is what it looks like in the xml that vCenter places on the guest:

&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;unattend xmlns=&quot;urn:schemas-microsoft-com:unattend&quot;&gt;
    &lt;settings pass=&quot;generalize&quot;&gt;
        &lt;component name=&quot;Microsoft-Windows-OutOfBoxExperience&quot; processorArchitecture=&quot;amd64&quot; publicKeyToken=&quot;31bf3856ad364e35&quot; language=&quot;neutral&quot; versionScope=&quot;nonSxS&quot; xmlns:wcm=&quot;http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance">
            &lt;DoNotOpenInitialConfigurationTasksAtLogon&gt;true&lt;/DoNotOpenInitialConfigurationTasksAtLogon&gt;
        &lt;/component&gt;

The setuperr.log has this error: [sysprep.exe] UnattendFindAnswerFile: Unable to deserialize explicitly provided unattend file [C:\sysprep\sysprep.xml]; status = 0x1, hrResult = 0x80070057

From what it looks like, vCenter stores the XML file as a field in another XML (the customization specification) and converts the XML metacharacters <, >, and " to their HTML special entities so it can be stored without causing parsing issues. However, since the upgrade it does not seem to be converting back properly when copying the file to the clone in order to run the customization.

There is no problem with the file other than this formatting as I have done a find & replace on these 3 meta characters to fix the formatting and run the sysprep command that vCenter attempts and it runs fine. However this completly removes the advantage of using vCenter to run sysprep.

Is anyone else having this issue with vCenter 5.0 or has something in this process changed that I can adapt our process to?

0 Kudos
1 Reply
mittim12
Immortal
Immortal

Welcome to the forums.  I haven't experienced the issue myself but I saw this KB,  http://kb.vmware.com/kb/2009315.

0 Kudos