VirtualDeviceBackingInfo vdbi = devices[i].getBacking();
if (devices[i] instanceof VirtualDisk &&
vdbi instanceof VirtualDeviceFileBackingInfo) {
VirtualDisk diskDev = (VirtualDisk) devices[i];
/* set required values in the VirtualDevice data. */
String name = ((VirtualDeviceFileBackingInfo) vdbi).getFileName();
String changeId = null;
String uuid = null;
long capacityInKB = diskDev.getCapacityInKB();
int key = diskDev.getKey();
int unitNumber = diskDev.getUnitNumber();
String diskMode = null;
/* Get required values in the BackingInfo data. */
if (vdbi instanceof VirtualDiskFlatVer2BackingInfo) {
VirtualDiskFlatVer2BackingInfo bi
= (VirtualDiskFlatVer2BackingInfo) vdbi;
changeId = bi.getChangeId();
uuid = bi.getUuid();
diskMode = bi.getDiskMode();
} else if (vdbi instanceof VirtualDiskSparseVer2BackingInfo) {
VirtualDiskSparseVer2BackingInfo bi =
(VirtualDiskSparseVer2BackingInfo) vdbi;
changeId = bi.getChangeId();
uuid = bi.getUuid();
diskMode = bi.getDiskMode();
}
/* get the controller information */
Integer ckeyI = diskDev.getControllerKey(); assert ckeyI != null;
int ckey = ckeyI.intValue();
AdapterType type = getAdapterType(ckey);
int busNumber = getBusNumber(ckey);
/* create VmdkInfo object. */