Package org.dmtf.schemas.ovf.envelope._1

Examples of org.dmtf.schemas.ovf.envelope._1.VSSDType


    private static EnvelopeType fixDiskFormtatUriAndFileSizes(final EnvelopeType envelope)
        throws SectionNotPresentException, InvalidSectionException
    {

        DiskSectionType diskSection = OVFEnvelopeUtils.getSection(envelope, DiskSectionType.class);

        if (diskSection.getDisk().size() != 1)
        {
            final String message =
                "abicloud only supports single disk definition on the OVF, the current envelope contains multiple disk";
            throw new InvalidSectionException(message);
        }

        VirtualDiskDescType vdisk = diskSection.getDisk().get(0);

        String formatUri = vdisk.getFormat();

        if (formatUri == null || formatUri.isEmpty())
        {
View Full Code Here


        return envelope;
    }

    public static String getDiskFileRef(final EnvelopeType envelope)
    {
        DiskSectionType diskSection = null;
        try
        {
            diskSection = OVFEnvelopeUtils.getSection(envelope, DiskSectionType.class);
        }
        catch (Exception e)// SectionNotPresentException InvalidSectionException
        {
            throw new AMException(AMError.TEMPLATE_INVALID, "missing DiskSection");
        }

        List<VirtualDiskDescType> disks = diskSection.getDisk();

        if (disks == null || disks.isEmpty() || disks.size() != 1)
        {
            throw new AMException(AMError.TEMPLATE_INVALID, "multiple Disk not supported");
        }
View Full Code Here

            FileType fileRef =
                OVFReferenceUtils.createFileType("diskFile", diskPath,
                    BigInteger.valueOf(diskSize), null, null);
            OVFReferenceUtils.addFile(references, fileRef);

            DiskSectionType diskSection = createDiskSection(template);
            VirtualSystemType vsystem = createVirtualSystem(template);
            ProductSectionType product = createProductSection(template);
            OperatingSystemSectionType ossection = createOperatingSystemSection(template);

            OVFEnvelopeUtils.addSection(vsystem, product);
View Full Code Here

        VirtualDiskDescType diskDesc =
            OVFDiskUtils.createDiskDescription("ovfdisk", "diskFile", format, diskSize,
                DiskSizeUnit.MegaBytes, null, null);

        DiskSectionType diskSection = new DiskSectionType();
        OVFDiskUtils.addDisk(diskSection, diskDesc);

        return diskSection;
    }
View Full Code Here

    public static EnvelopeType fixFilePathsAndSize(final EnvelopeType envelope,
        final String snapshot, final String packagePath)
    {
        Set<String> diskFileIds = new HashSet<String>();

        DiskSectionType diskSection;

        try
        {

            diskSection = OVFEnvelopeUtils.getSection(envelope, DiskSectionType.class);
        }
        catch (Exception e)
        {
            throw new AMException(AMError.TEMPLATE_BOUNDLE, String.format(
                "The bundle [%s] can not be created "
                    + "because the original envelope do not exist or do not have Disk Section",
                snapshot), e);
        }

        List<VirtualDiskDescType> disks = diskSection.getDisk();

        if (disks.isEmpty())
        {

            throw new AMException(AMError.TEMPLATE_BOUNDLE, String.format(
View Full Code Here

    public static EnvelopeType fixFilePathsAndSize(final EnvelopeType envelope,
        final String relativeDiskPath, final BigInteger diskSizeInBytes)
    {
        Set<String> diskFileIds = new HashSet<String>();

        DiskSectionType diskSection;

        try
        {

            diskSection = OVFEnvelopeUtils.getSection(envelope, DiskSectionType.class);
        }
        catch (Exception e)
        {
            throw new AMException(AMError.PROMOTE_MASTER_OVF, String.format(
                "The promote [%s] can not be created "
                    + "because the original envelope do not exist or do not have Disk Section",
                relativeDiskPath), e);
        }

        List<VirtualDiskDescType> disks = diskSection.getDisk();

        if (disks.isEmpty())
        {

            throw new AMException(AMError.PROMOTE_MASTER_OVF, String.format(
View Full Code Here

    /**
     * Use the imageSize
     **/
    public static EnvelopeType createOVFEnvelopeFromTemplate(final TemplateDto template)
    {
        EnvelopeType envelope = new EnvelopeType();
        ReferencesType references = new ReferencesType();

        final String diskPath = template.getDiskFilePath();
        // final String packRelPath = getRelativePackagePath(disk.getOvfUrl(),
        // String.valueOf(disk.getIdEnterprise()));

        final Long diskSize = template.getDiskFileSize();

        // final String completPath = packRelPath +'/'+diskPath;
        // System.err.println(packRelPath);

        try
        {
            FileType fileRef =
                OVFReferenceUtils.createFileType("diskFile", diskPath,
                    BigInteger.valueOf(diskSize), null, null);
            OVFReferenceUtils.addFile(references, fileRef);

            DiskSectionType diskSection = createDiskSection(template);
            VirtualSystemType vsystem = createVirtualSystem(template);
            ProductSectionType product = createProductSection(template);
            OperatingSystemSectionType ossection = createOperatingSystemSection(template);

            OVFEnvelopeUtils.addSection(vsystem, product);           
            OVFEnvelopeUtils.addSection(vsystem, ossection);
            OVFEnvelopeUtils.addSection(envelope, diskSection);
            OVFEnvelopeUtils.addVirtualSystem(envelope, vsystem);
            envelope.setReferences(references);
        }
        catch (Exception e)
        {
            throw new AMException(AMError.TEMPLATE_INSTALL,
                "Can not create the OVF from the DiskInfo", e);
View Full Code Here

    /**
     * Use the imageSize
     **/
    public static EnvelopeType createOVFEnvelopeFromTemplate(final TemplateDto template)
    {
        EnvelopeType envelope = new EnvelopeType();
        ReferencesType references = new ReferencesType();

        final String diskPath = template.getDiskFilePath();
        // final String packRelPath = getRelativePackagePath(disk.getOvfUrl(),
        // String.valueOf(disk.getIdEnterprise()));

        final Long diskSize = template.getDiskFileSize();

        // final String completPath = packRelPath +'/'+diskPath;
        // System.err.println(packRelPath);

        try
        {
            FileType fileRef =
                OVFReferenceUtils.createFileType("diskFile", diskPath,
                    BigInteger.valueOf(diskSize), null, null);
            OVFReferenceUtils.addFile(references, fileRef);

            DiskSectionType diskSection = createDiskSection(template);
            VirtualSystemType vsystem = createVirtualSystem(template);
            ProductSectionType product = createProductSection(template);
            OperatingSystemSectionType ossection = createOperatingSystemSection(template);

            OVFEnvelopeUtils.addSection(vsystem, product);
            OVFEnvelopeUtils.addSection(vsystem, ossection);
            OVFEnvelopeUtils.addSection(envelope, diskSection);
            OVFEnvelopeUtils.addVirtualSystem(envelope, vsystem);
            envelope.setReferences(references);
        }
        catch (Exception e)
        {
            throw new AMException(AMError.TEMPLATE_INSTALL,
                "Can not create the OVF from the DiskInfo",
View Full Code Here

    /**
     * Use the imageSize
     **/
    public static EnvelopeType createOVFEnvelopeFromTemplate(final TemplateDto template)
    {
        EnvelopeType envelope = new EnvelopeType();
        ReferencesType references = new ReferencesType();

        final String diskPath = template.getDiskFilePath();
        // final String packRelPath = getRelativePackagePath(disk.getOvfUrl(),
        // String.valueOf(disk.getIdEnterprise()));

        final Long diskSize = template.getDiskFileSize();

        // final String completPath = packRelPath +'/'+diskPath;
        // System.err.println(packRelPath);

        try
        {
            FileType fileRef =
                OVFReferenceUtils.createFileType("diskFile", diskPath,
                    BigInteger.valueOf(diskSize), null, null);
            OVFReferenceUtils.addFile(references, fileRef);

            DiskSectionType diskSection = createDiskSection(template);
            VirtualSystemType vsystem = createVirtualSystem(template);
            ProductSectionType product = createProductSection(template);
            OperatingSystemSectionType ossection = createOperatingSystemSection(template);

            OVFEnvelopeUtils.addSection(vsystem, product);
            OVFEnvelopeUtils.addSection(vsystem, ossection);
            OVFEnvelopeUtils.addSection(envelope, diskSection);
            OVFEnvelopeUtils.addVirtualSystem(envelope, vsystem);
            envelope.setReferences(references);
        }
        catch (Exception e)
        {
            throw new AMException(AMError.TEMPLATE_INSTALL,
                "Can not create the OVF from the DiskInfo",
View Full Code Here

                {
                    String msg = "File Id [" + fileId + "] not found on the ReferencesSection";
                    throw new IdNotFoundException(msg);
                }

                FileType file = fileIdToFileType.get(fileId);
                final String filePath = file.getHref();
                final Long fileSize = file.getSize().longValue();

                String format = diskDescType.getFormat(); // XXX using the same format on the OVF
                // disk

                if (!diskIdToVSs.containsKey(diskId))
View Full Code Here

TOP

Related Classes of org.dmtf.schemas.ovf.envelope._1.VSSDType

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.