Examples of VmbkpOvf


Examples of com.cybozu.vmbkp.util.VmbkpOvf

            String ret = vmm.exportOvf();
            FileWriter fw = new FileWriter("ovf/" + vmm.getName() + ".ovf2");
            fw.write(ret);
            fw.close();
               
            VmbkpOvf ovf = new VmbkpOvf(ret);
            ovf.replaceFileLinkInReferences();
            String ret2 = ovf.toString();
            FileWriter fw2 = new FileWriter("ovf/" + vmm.getName() + ".ovf3");
            fw2.write(ret2);
            fw2.close();
        }
    }
View Full Code Here

Examples of com.cybozu.vmbkp.util.VmbkpOvf

                     vmName, vmSnapMoref, vmSnapDiskStr);
            }

            /* ovf export */
            String ret = vmm.exportOvf();
            VmbkpOvf ovf = new VmbkpOvf(ret);
            //ovf.replaceFileLinkInReferences();
            ovf.deleteFilesInReferences();
            ovf.deleteDisksInDiskSection();
            Set<String> ctrlIdSet = ovf.deleteDiskDevicesInHardwareSection();
            for (String id: ctrlIdSet) {
                System.out.printf("ctrlId:%s\n", id); /* debug */
            }
            ovf.deleteControllerDevicesWithoutChildInHardwareSection(ctrlIdSet);

            /* Delete mounted cd-rom information. */
            ovf.deleteMountedCdromInfoInHardwareSection();

            /* fix indent of xml data for human's easy read. */
            XmlIndent xmli = new XmlIndent(ovf.toString());
            xmli.fixIndent();
               
            String ret2 = xmli.toString();
            FileWriter fw2 = new FileWriter(ovfDir.getPath() +
                                            File.pathSeparator +
View Full Code Here

Examples of com.cybozu.vmbkp.util.VmbkpOvf

    public static boolean exportOvfAndSave
        (VirtualMachineManager vmm, String outOvfPath)
    {
        try {
            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;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.