VMware {code} Community
Dreamer732
Contributor
Contributor
Jump to solution

Is vim25 api works only for vSphere 5.0 or does it also works with 4.1?

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     

0 Kudos
1 Solution

Accepted Solutions
lamw
Community Manager
Community Manager
Jump to solution

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.

View solution in original post

0 Kudos
5 Replies
lamw
Community Manager
Community Manager
Jump to solution

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.

0 Kudos
Steve_Jin
Expert
Expert
Jump to solution

Try open source VI Java API 5.0, it's tested working with vSphere 5 and all previous versions.

http://vijava.sf.net

Steve JIN Author of VMware VI and vSphere SDK; Creator of open source VI Java API (http://vijava.sf.net); Blogger at http://www.doublecloud.org
0 Kudos
Dreamer732
Contributor
Contributor
Jump to solution

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;

0 Kudos
Dreamer732
Contributor
Contributor
Jump to solution

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

0 Kudos
Dreamer732
Contributor
Contributor
Jump to solution

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...

Any help/thoughts to debug the issue is greatly appreciated...

-Naresh

0 Kudos