I have vCenter 5.1 and two ESXi 5.1 nodes attached to it. I am trying to perform relocation (changin host and datastore). I can do it without any issues via Web Client, but I always have an error using API. I've tryied to use Perl cleint described at http://blogs.vmware.com/vsphere/2012/10/vmotion-without-shared-storage-api.html and my own cleint that uses Java SDK. Both clients are sending the SOAP messages thate looks like this one:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope 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>
<RelocateVM_Task xmlns="urn:vim25"><_this type="VirtualMachine">vm-21</_this>
<spec><datastore xsi:type="ManagedObjectReference" type="Datastore">datastore-20</datastore>
<host xsi:type="ManagedObjectReference" type="HostSystem">host-19</host>
</spec><priority>highPriority</priority></RelocateVM_Task></soapenv:Body></soapenv:Envelope>
This request is accepted by vCenter but later it returns something like this for task status:
<?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>
<RetrievePropertiesResponse xmlns="urn:vim25"><returnval><obj type="Task">task-60</obj><propSet><name>availableField</name><val xsi:type="ArrayOfCustomFieldDef"></val></propSet><propSet><name>info</name><val xsi:type="TaskInfo"><key>task-60</key><task type="Task">task-60</task><description><key>com.vmware.vim.vpxd.vpx.vmprov.SelectDestination</key><message></message></description><name>RelocateVM_Task</name><descriptionId>VirtualMachine.relocate</descriptionId><entity type="VirtualMachine">vm-21</entity><entityName>vasya-test</entityName><state>error</state><cancelled>false</cancelled><cancelable>false</cancelable><error><fault xsi:type="InvalidArgument"></fault><localizedMessage>A specified parameter was not correct.
</localizedMessage></error><reason xsi:type="TaskReasonUser"><userName>XXX</userName></reason><queueTime>2013-01-29T04:16:58.038817Z</queueTime><startTime>2013-01-29T04:16:58.038817Z</startTime><completeTime>2013-01-29T04:16:58.226017Z</completeTime><eventChainId>398</eventChainId></val></propSet><propSet><name>value</name><val xsi:type="ArrayOfCustomFieldValue"></val></propSet></returnval></RetrievePropertiesResponse>
</soapenv:Body>
</soapenv:Envelope>
Any ides why this does not work via API?