VMware {code} Community
Dipak_Patil
Contributor
Contributor

How to find the disk type IDE or SCSI using Vsphere API ?

Hi i am using vsphere java api [VMware-vSphere-SDK-5.1.0-774886] i am implementing support for creating VM and attaching disk to VM while restore in esxi server 4.1,5.0,5.1 but i am not able to find disk type is IDE or SCSI while tacking snapshot.

Thanks in Advance.

Tags (3)
0 Kudos
1 Reply
stumpr
Virtuoso
Virtuoso

Actually a good point, I don't think it's called out directly in a single property.  You'll probably have to get the VirtualMachineSnapshot object, and look at it's configuration at that point in time (config.hardware).  Then find the disk (by key or file backing), look up it's controllerKey (to get the SCSI/IDE controller type).

You should probably pull out the controller type for each disk, maybe even get the SCSI bus ID as that might be of some impact depending on their infrastructure setup.

Reuben Stump | http://www.virtuin.com | @ReubenStump