String ovfStr1 = vmm.exportOvf();
VmbkpOvf ovf = new VmbkpOvf(ovfStr1);
/* Export original ovf. This is just for debug. */
{
XmlIndent xmli = new XmlIndent(ovf.toString());
xmli.fixIndent();
FileWriter fw = new FileWriter(outOvfPath + ".orig");
fw.write(xmli.toString());
fw.close();
}
/* Delete scsi controller and disk information. */
ovf.deleteFilesInReferences();
ovf.deleteDisksInDiskSection();
Set<String> ctrlIdSet = ovf.deleteDiskDevicesInHardwareSection();
ovf.deleteControllerDevicesWithoutChildInHardwareSection(ctrlIdSet);
/* Delete mounted cd-rom information. */
ovf.deleteMountedCdromInfoInHardwareSection();
/* Fix indent of xml data for human's eary read. */
XmlIndent xmli = new XmlIndent(ovf.toString());
xmli.fixIndent();
String ovfStr2 = xmli.toString();
if (ovfStr2 == null) {
logger_.warning("ovf is null.");
return false;
}