I am using 5.0 sdk. I am able to use the below code to add passthrough disk to a VM of ESX host 5.0. But the same code is failing for 4.1
I am getting "Invalid configuration for device '0'"
Please looks at http://communities.vmware.com/message/1995513?tstart=0 for more details
Any thoughts? Any help is greatly appreciated...
VirtualDisk rdmDisk = new VirtualDisk();
//disk info
rdmDisk.controllerKey = key;
rdmDisk.controllerKeySpecified = true;
rdmDisk.unitNumber = location;
rdmDisk.unitNumberSpecified = true;
//backing rawdevice info
VirtualDiskRawDiskMappingVer1BackingInfo backing = new VirtualDiskRawDiskMappingVer1BackingInfo();
backing.lunUuid = taskSpec.ScsiLun.Uuid;
backing.compatibilityMode = "physicalMode"; //TODO
backing.diskMode = "independent_persistent"; //TODO
backing.deviceName = taskSpec.ScsiLun.DeviceName;
backing.datastore = mor;
//Framework will automatically assigns filename
backing.fileName = "";
rdmDisk.backing = backing;
//config spec
VirtualDeviceConfigSpec vdConfigSpecEdit = new VirtualDeviceConfigSpec();
vdConfigSpecEdit.device = rdmDisk;
vdConfigSpecEdit.operation = VirtualDeviceConfigSpecOperation.add;
vdConfigSpecEdit.operationSpecified = true;
vdConfigSpecEdit.fileOperation = VirtualDeviceConfigSpecFileOperation.create;
vdConfigSpecEdit.fileOperationSpecified = true;
VirtualMachineConfigSpec vmConfigSpecEdit = new VirtualMachineConfigSpec();
vmConfigSpecEdit.deviceChange = new VirtualDeviceConfigSpec[1];
vmConfigSpecEdit.deviceChange[0] = vdConfigSpecEdit;
Thanks in advance,
Regards,
Naresh
I am using definitions in vim25 folder (SDK\wsdl\vim25) and i think its the recommended api to use.
Am i supposed to use definitions in (SDK\wsdl\vim) to get backward compatibility.
Regards,
Naresh
Now I am using 4.1 sdk and still getting the same error.
Not sure whats happening. Same code works for vms on 5.0 with 5.0 sdk (vim25 definitions) and not for 4.1 (both 5.0 and 4.1 sdks)
And the error doesnt give any info.
It simply says invalid configuration for device '0'.
i have no clue what does that mean.
its frustrating...
-Naresh