radiumsql
Contributor
Contributor

Can not create conversion job?

Dear guys:

I made a conversion job between one esxi vm to another esxi server, which referenced by the Converter SDK c# example. my create conversion job function like following:

private ConverterServerConversionConversionJobSpec BuildConversionJobSpec()

{

ConverterServerConversionConversionJobSpec jobSpec = new ConverterServerConversionConversionJobSpec();

jobSpec.name = _conversionJobName;

jobSpec.description = _conversionJobDescription;

jobSpec.firstRunSpecified = false;

jobSpec.startSuspended = false;

jobSpec.startSuspendedSpecified = true;

jobSpec.source = BuildLiveSourceSpec();

jobSpec.conversionParams = BuildConversionParams();

jobSpec.p2vSourceModificationSpec = new ConverterServerConversionP2VSourceModificationSpec();

return jobSpec;

}

private ConverterComputerSpec BuildLiveSourceSpec() //I think is error here. {

ConverterComputerSpec liveSourceSpec = new ConverterComputerSpec();

liveSourceSpec.location = BuildEsxiVmLocation("192.168.1.149", "root", "HanWei123", "56 4d 98 3f d6 bc 50 26-50 3b 6f 74 c7 f4 04 8d");

return liveSourceSpec;

}

public ConverterComputerSpecManagedVmLocation BuildEsxiVmLocation(string hostName, string user, string password, string vmUuid)

{

ConverterComputerSpecManagedVmLocation esxiVmLocation = new ConverterComputerSpecManagedVmLocation();

ConverterVimConnectionSpec specTmp = new ConverterVimConnectionSpec();

specTmp.hostname = hostName;

ConverterVimConnectionSpecLoginVimCredentials cred = new ConverterVimConnectionSpecLoginVimCredentials();

cred.username = user;

cred.password = password;

specTmp.credentials = cred;

esxiVmLocation.vimConnect = specTmp;

esxiVmLocation.uuid = vmUuid;

return esxiVmLocation;

}

but when i submit this job use ConverterServerConversionManagerCreateJob function, the function throw a exception: "[InvalidArgument|http://communities.vmware.com/vmodl.fault.InvalidArgument.html]".

i don't know why, who can help me ?

1 Reply
POCEH
VMware Employee
VMware Employee

The ESXi machines are not of type LiveSourceSpec but of type ManagedSourceVMSpec.