nodeMap.put(vNode.getVmName(), vNode);
vNode.setSuccess(false);
vNode.setFinished(false);
// generate create spec for fast clone
VmCreateSpec spec = new VmCreateSpec();
VmSchema createSchema = getVmSchema(vNode);
spec.setSchema(createSchema);
String defaultPgName = null;
GuestMachineIdSpec machineIdSpec =
new GuestMachineIdSpec(networkAdds,
vNode.fetchPortGroupToIpV4Map(),
vNode.getPrimaryMgtPgName());
logger.info("machine id of vm " + vNode.getVmName() + ":\n"
+ machineIdSpec.toString());
spec.setBootupConfigs(machineIdSpec.toGuestVariable());
// timeout is 10 mintues
StartVmPostPowerOn query =
new StartVmPostPowerOn(vNode.getNics().keySet(),
Constants.VM_POWER_ON_WAITING_SEC);
spec.setPostPowerOn(query);
spec.setPrePowerOn(getPrePowerOnFunc(vNode, reserveRawDisks));
spec.setLinkedClone(false);
spec.setTargetDs(getVcDatastore(vNode));
spec.setTargetFolder(folders.get(vNode.getGroupName()));
spec.setTargetHost(VcResourceUtils.findHost(vNode.getTargetHost()));
spec.setTargetRp(getVcResourcePool(vNode, clusterRpName));
spec.setVmName(vNode.getVmName());
specs.add(spec);
}
BaseProgressCallback callback = new BaseProgressCallback(statusUpdator);
logger.info("ClusteringService, start to clone template.");
AuAssert.check(specs.size() > 0);
VmSchema vmSchema = specs.get(0).getSchema();
VcVmUtil.checkAndCreateSnapshot(vmSchema);
// call clone service to copy templates
List<VmCreateResult<?>> results =
cloneService.createCopies(sourceSpec, cloneConcurrency, specs,