new VirtualDeviceConfigSpec();
diskSpec.setOperation(VirtualDeviceConfigSpecOperation.add);
diskSpec.setFileOperation
(VirtualDeviceConfigSpecFileOperation.create);
VirtualDisk vd = new VirtualDisk();
vd.setCapacityInKB(capacityInKb_);
diskSpec.setDevice(vd);
vd.setKey(key_); /* no need to set key_ */
vd.setUnitNumber(unitNumber_);
vd.setControllerKey(controller_.getCkey());
VirtualDiskFlatVer2BackingInfo diskfileBacking =
new VirtualDiskFlatVer2BackingInfo();
String fileName = "["+ datastore_ +"]";
diskfileBacking.setFileName(fileName);
diskfileBacking.setDiskMode("persistent");
diskfileBacking.setThinProvisioned(isThinProvisioned);
vd.setBacking(diskfileBacking);
return diskSpec;
}