}
public static VcVirtualMachine createVm(final Folder parentFolder,
final ConfigSpec spec, final VcResourcePool rp, final HostSystem host,
final IVcTaskCallback callback) throws Exception {
VcTask task = VcContext.getTaskMgr().execute(new IVcTaskBody() {
public VcTask body() throws Exception {
ManagedObjectReference hostRef =
host != null ? host._getRef() : null;
ManagedObjectReference taskRef =
parentFolder.createVm(spec, rp.getMoRef(), hostRef);