We're using VMWare Convertor in our infrastructure and have another product interfacing with it to enable us to flex the settings of a VM Guest (Disk,RAM and CPU). We've been asked to be able to maintain the UUID from source to guest as our backup infrastructure depends on it.
After much Google/Bing time I've found I need to use the preserveIdentity property in the xml we're submitting to the Web Service API. Found the details here:
An example of the xml we're submitting (values in between stars, are replaced just before the xml gets submitted to convertor):
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ConverterServerConversionManagerCreateJob xmlns="urn:converter">
<_this type="ConverterServerConversionConversionManager">ConversionManager</_this>
<spec>
<name>Server Automation Flex Job - *serverName*</name>
<source>
<location xsi:type="ConverterComputerSpecLiveComputerLocation">
<hostname>*serverNameFullyQualified*</hostname>
<username>*serverUsername*</username>
<password>*serverPassword*</password>
<osType>*serverOSType*</osType>
<verifyPeer>false</verifyPeer>
<sslThumbprint>*sourceSSLThumbprint*</sslThumbprint>
</location>
</source>
<conversionParams>
<doClone>true</doClone>
<cloningParams>
<target>
<name>*guestName*</name>
<location xsi:type="ConverterTargetVmSpecManagedVmLocation">
<vimConnect>
<hostname>*VCServer*</hostname>
<credentials xsi:type="ConverterVimConnectionSpecLoginVimCredentials">
<username>*VCUsername*</username>
<password>*VCPassword*</password>
</credentials>
<verifyPeer>false</verifyPeer>
<sslThumbprint>*targetSSLThumbprint*</sslThumbprint>
</vimConnect>
<vmFolder type="Folder">*folderID*</vmFolder>
<host type="HostSystem">*hostID*</host>
<computeResource type="ClusterComputeResource">*clusterID*</computeResource>
<vmFolderName>*sourceVmFolder*</vmFolderName>
<resourcePoolName>*targetVMwareResourcePool*</resourcePoolName>
<computeResourceName>*targetVMwareCluster*</computeResourceName>
</location>
<hardwareVersion>*targetVmHardwareVersion*</hardwareVersion>
</target>
<storageParams>
*storageParamsXML*
</storageParams>
<networkParams>
<preserveNicCount>true</preserveNicCount>
<preserveNicMapping>true</preserveNicMapping>
</networkParams>
<basicHardwareParams>
<numCPUs>*newCPUValue*</numCPUs>
<numCoresPerSocket>1</numCoresPerSocket>
<memoryMB>*newMemoryValueInMB*</memoryMB>
</basicHardwareParams>
<doSynchronize>false</doSynchronize>
<preserveIdentity>false</preserveIdentity>
</cloningParams>
<doReconfig>true</doReconfig>
<doInstallTools>false</doInstallTools>
<doCustomize>false</doCustomize>
<doUninstallAgent>false</doUninstallAgent>
<powerOnTargetVM>true</powerOnTargetVM>
<removeRestoreCheckpoints>true</removeRestoreCheckpoints>
<throttlingParams>
<cpuThrottling>none</cpuThrottling>
</throttlingParams>
</conversionParams>
<p2vSourceModificationSpec>
<shutdownSource>true</shutdownSource>
</p2vSourceModificationSpec>
<parentFolder type="ConverterServerConversionConversionFolder">ConversionFolder</parentFolder>
</spec>
</ConverterServerConversionManagerCreateJob>
</soapenv:Body>
</soapenv:Envelope>
I've tried putting the preserveIdentity element in a number of places and got the same error back from our tools of:
HTTP/1.1 500 Internal server error
<?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <soapenv:Fault><faultcode>ServerFaultCode</faultcode><faultstring> Unexpected element tag "preserveIdentity" seen while parsing serialized DataObject of type converter.params.CloningParams at line 20, column 5 while parsing property "cloningParams" of static type ConverterCloningParams while parsing serialized DataObject of type converter.params.ConversionParams at line 18, column 4 while parsing property "conversionParams" of static type ConverterConversionParams while parsing serialized DataObject of type converter.server.conversion.ConversionJobSpec at line 6, column 3 while parsing call information for method ConverterServerConversionManagerCreateJob at line 4, column 2 while parsing SOAP body at line 3, column 1 while parsing SOAP envelope at line 2, column 0 while parsing HTTP request for method createJob on object of type converter.server.conversion.ConversionManager at line 1, column 0</faultstring><detail><InvalidRequestFault xmlns="urn:converter" xsi:type="vim25:InvalidRequest" xmlns:vim25="urn:vim25"></InvalidRequestFault></detail></soapenv:Fault> </soapenv:Body> </soapenv:Envelope>
Can anyone help?