ImportVmSP vm0SP = util.testImportVM(vmName, rp);
String templateId = vm0SP.getResult().getId();
final String snapshotName = "snapshotname";
TakeSnapshotSP vm0SnapSP =
util.testTakeSnapshot(vm0SP.getResult().getId(), snapshotName, "template Snapshot");
VmSchema vmSchema =
SchemaUtil.getSchema(new File("./src/test/resources/vmSchema.xml"),
VmSchema.class);
logger.info("Template vm schema: " + templateVmSchema);
logger.info("vm schema: " + vmSchema);
SchemaUtil.putXml(vmSchema, new File("vmSchema.xml"));
SchemaUtil.putXml(templateVmSchema, new File("templateVmSchema.xml"));
// Update the template information in the new VM diskSchema
// XXX : TODO need to figure out the best way to represent this
// By name or by TmObjectId. find in tx layer is by objectId
vmSchema.diskSchema.setParent(templateId.toString());
vmSchema.diskSchema.setParentSnap(snapshotName);
CreateVmSP vm1SP =
new CreateVmSP("testCompLayer", vmSchema, rp, ds, null, new QueryGuestInfo(3 * 60), null, true, vmFolder);
vm1SP.call();
logger.info("Created VM: " + vm1SP.getVM().getName());
TakeSnapshotSP vm1SnapSP =
util.testTakeSnapshot(vm1SP.getVM().getId(), snapshotName, "snap0");
VmSchema vmCloneSchema =
SchemaUtil.getSchema(new File(
"./src/test/resources/vmCloneSchema.xml"), VmSchema.class);