Probably trivial question. But i would like to get confirmation from experts esp w.r.t to apis (vim/vim25) and what all the versions they support.
Thank you,
Regards,
Dreamer
vSphere 5 is backwards compatibility with vSphere 4.x, meaning you can still manage and leverage the features/capblities of vSphere 4.x using the vSphere 5 SDK. However, the features/capablities in vSphere 5 are only available if you have a vSphere 5 envioronment such as Storage DRS for example.
vSphere 5 is backwards compatibility with vSphere 4.x, meaning you can still manage and leverage the features/capblities of vSphere 4.x using the vSphere 5 SDK. However, the features/capablities in vSphere 5 are only available if you have a vSphere 5 envioronment such as Storage DRS for example.
Try open source VI Java API 5.0, it's tested working with vSphere 5 and all previous versions.
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;
Hi,
Thanks for the reply. What is the difference between the vim definitions and vim25 definitons.
I am using vim25 definitions as i think its the recommnded API to use.
But adding rdm disk to vm on esx 5.0 is passing but not 4.1.
am i supposed to use vim definitions to get backward compatibility?
And the error message is not helpful at all as it simply says invalid configuration for device '0'. there are not fault messages etc...
Regards,
Naresh
Now I tried using 4.1 sdk and still getting the same error.
Not sure whats happening. Same code works for vms on 5.0 esx host with 5.0 sdk (vim25 definitions) and not for vms on 4.1 esx host (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