Package com.cloud.storage.template

Examples of com.cloud.storage.template.TemplateLocation


                processor.configure("template processor", params);
                String destPath = destFile.getAbsolutePath();

                FormatInfo info = processor.process(destPath, null, templateName);
                TemplateLocation loc = new TemplateLocation(_storage, destPath);
                loc.create(1, true, destData.getName());
                loc.addFormat(info);
                loc.save();

                TemplateProp prop = loc.getTemplateInfo();
                TemplateObjectTO newTemplate = new TemplateObjectTO();
                newTemplate.setPath(destData.getPath() + File.separator + fileName);
                newTemplate.setFormat(srcFormat);
                newTemplate.setSize(prop.getSize());
                newTemplate.setPhysicalSize(prop.getPhysicalSize());
View Full Code Here


            qcow2Processor.configure("QCOW2 Processor", params);

            FormatInfo info = qcow2Processor.process(tmpltPath, null, templateName);

            TemplateLocation loc = new TemplateLocation(storageLayer, tmpltPath);
            loc.create(1, true, templateName);
            loc.addFormat(info);
            loc.save();

            TemplateObjectTO newTemplate = new TemplateObjectTO();
            newTemplate.setPath(templateFolder + File.separator + templateName + ".qcow2");
            newTemplate.setSize(info.virtualSize);
            newTemplate.setPhysicalSize(info.size);
View Full Code Here

            qcow2Processor.configure("QCOW2 Processor", params);

            FormatInfo info = qcow2Processor.process(tmpltPath, null, templateName);

            TemplateLocation loc = new TemplateLocation(this.storageLayer, tmpltPath);
            loc.create(1, true, templateName);
            loc.addFormat(info);
            loc.save();

            TemplateObjectTO newTemplate = new TemplateObjectTO();
            newTemplate.setPath(templateFolder + File.separator + templateName + ".qcow2");
            newTemplate.setSize(info.virtualSize);
            newTemplate.setPhysicalSize(info.size);
View Full Code Here

            Processor qcow2Processor = new QCOW2Processor();
            qcow2Processor.configure("QCOW2 Processor", params);
            FormatInfo info = qcow2Processor.process(templatePath, null,
                    tmplName);

            TemplateLocation loc = new TemplateLocation(_storage, templatePath);
            loc.create(1, true, tmplName);
            loc.addFormat(info);
            loc.save();

            return new CreatePrivateTemplateAnswer(cmd, true, "", tmplPath,
                    info.virtualSize, info.size, tmplName, info.format);
        } catch (ConfigurationException e) {
            return new CreatePrivateTemplateAnswer(cmd, false, e.getMessage());
View Full Code Here

            qcow2Processor.configure("QCOW2 Processor", params);

            FormatInfo info = qcow2Processor.process(tmpltPath, null,
                    cmd.getUniqueName());

            TemplateLocation loc = new TemplateLocation(_storage, tmpltPath);
            loc.create(1, true, cmd.getUniqueName());
            loc.addFormat(info);
            loc.save();

            return new CreatePrivateTemplateAnswer(cmd, true, null,
                    templateInstallFolder + cmd.getUniqueName() + ".qcow2",
                    info.virtualSize, info.size, cmd.getUniqueName(),
                    ImageFormat.QCOW2);
View Full Code Here

            Processor qcow2Processor = new QCOW2Processor();
            qcow2Processor.configure("QCOW2 Processor", params);
            FormatInfo info = qcow2Processor.process(templatePath, null,
                    tmplName);

            TemplateLocation loc = new TemplateLocation(_storage, templatePath);
            loc.create(1, true, tmplName);
            loc.addFormat(info);
            loc.save();

            return new CreatePrivateTemplateAnswer(cmd, true, "", tmplPath,
                    info.virtualSize, info.size, tmplName, info.format);
        } catch (ConfigurationException e) {
            return new CreatePrivateTemplateAnswer(cmd, false, e.getMessage());
View Full Code Here

            qcow2Processor.configure("QCOW2 Processor", params);

            FormatInfo info = qcow2Processor.process(tmpltPath, null,
                    cmd.getUniqueName());

            TemplateLocation loc = new TemplateLocation(_storage, tmpltPath);
            loc.create(1, true, cmd.getUniqueName());
            loc.addFormat(info);
            loc.save();

            return new CreatePrivateTemplateAnswer(cmd, true, null,
                    templateInstallFolder + cmd.getUniqueName() + ".qcow2",
                    info.virtualSize, info.size, cmd.getUniqueName(),
                    ImageFormat.QCOW2);
View Full Code Here

            if ( container.startsWith("T-")) {
                String ldir = _tmpltDir + "/" + UUID.randomUUID().toString();
                createLocalDir(ldir);
                String lFullPath = ldir + "/" + _tmpltpp;
                swiftDownload(swift, container, _tmpltpp, lFullPath);
                TemplateLocation loc = new TemplateLocation(_storage, ldir);
                try {
                    if (!loc.load()) {
                        s_logger.warn("Can not parse template.properties file for template " + container);
                        continue;
                    }
                } catch (IOException e) {
                    s_logger.warn("Unable to load template location " + ldir + " due to " + e.toString(), e);
                    continue;
                }
                TemplateInfo tInfo = loc.getTemplateInfo();
                tInfo.setInstallPath(container);
                tmpltInfos.put(tInfo.getTemplateName(), tInfo);
                loc.purge();
                deleteLocalDir(ldir);
            }
        }
        return tmpltInfos;
       
View Full Code Here

            Processor qcow2Processor = new QCOW2Processor();
            qcow2Processor.configure("QCOW2 Processor", params);
            FormatInfo info = qcow2Processor.process(templatePath, null,
                    tmplName);

            TemplateLocation loc = new TemplateLocation(_storage, templatePath);
            loc.create(1, true, tmplName);
            loc.addFormat(info);
            loc.save();

            return new CreatePrivateTemplateAnswer(cmd, true, "", tmplPath,
                    info.virtualSize, info.size, tmplName, info.format);
        } catch (ConfigurationException e) {
            return new CreatePrivateTemplateAnswer(cmd, false, e.getMessage());
View Full Code Here

            qcow2Processor.configure("QCOW2 Processor", params);

            FormatInfo info = qcow2Processor.process(tmpltPath, null,
                    cmd.getUniqueName());

            TemplateLocation loc = new TemplateLocation(_storage, tmpltPath);
            loc.create(1, true, cmd.getUniqueName());
            loc.addFormat(info);
            loc.save();

            return new CreatePrivateTemplateAnswer(cmd, true, null,
                    templateInstallFolder + cmd.getUniqueName() + ".qcow2",
                    info.virtualSize, info.size, cmd.getUniqueName(),
                    ImageFormat.QCOW2);
View Full Code Here

TOP

Related Classes of com.cloud.storage.template.TemplateLocation

Copyright © 2018 www.massapicom. 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.