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

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


     * 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()));

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()));

View Full Code Here

    private static VirtualHardwareSectionType createVirtualHardwareSection(final TemplateDto disk)
        throws RequiredAttributeException
    {
        VirtualHardwareSectionType vhsection = new VirtualHardwareSectionType();

        VSSDType vsystem = new VSSDType();
        vsystem.setVirtualSystemType(CIMTypesUtils.createString(VIRTUAL_SYSTEM_TYPE));
        vhsection.setSystem(vsystem);

        CIMResourceAllocationSettingDataType cpu =
            CIMResourceAllocationSettingDataUtils.createResourceAllocationSettingData("Cpu", "1",
                CIMResourceTypeEnum.Processor, disk.getCpu(), null);
View Full Code Here

    private static VirtualHardwareSectionType createVirtualHardwareSection(final TemplateDto disk)
        throws RequiredAttributeException
    {
        VirtualHardwareSectionType vhsection = new VirtualHardwareSectionType();

        VSSDType vsystem = new VSSDType();
        vsystem.setVirtualSystemType(CIMTypesUtils.createString(VIRTUAL_SYSTEM_TYPE));
        vhsection.setSystem(vsystem);

        CIMResourceAllocationSettingDataType cpu =
            CIMResourceAllocationSettingDataUtils.createResourceAllocationSettingData("Cpu", "1",
                CIMResourceTypeEnum.Processor, disk.getRequiredCpu(), null);
View Full Code Here

        DiskFormat format = DiskFormat.fromName(disk.getDiskFileFormat().name());

        final Long diskSize = disk.getDiskFileSize();

        // TODO getHDUnits
        VirtualDiskDescType diskDesc =
            OVFDiskUtils.createDiskDescription("ovfdisk", "diskFile", format, diskSize, null, null,
                null);

        DiskSectionType diskSection = new DiskSectionType();
        OVFDiskUtils.addDisk(diskSection, diskDesc);
View Full Code Here

                    {
                        throw new RequiredAttributeException(
                            "Virtual System makes reference to an undeclared disk " + diskId);
                    }

                    VirtualDiskDescType diskDescType = diskIdToDiskFormat.get(diskId);

                    String capacity = diskDescType.getCapacity();

                    hd = Long.parseLong(capacity);

                    final String allocationUnits = diskDescType.getCapacityAllocationUnits();
                    final MemorySizeUnit hdSizeUnit = getMemoryUnitsFromOVF(allocationUnits);
                }
            }// rasd

            if (cpu == null)
View Full Code Here

                else
                {
                    diskIdToVSs.get(diskId).add(vsystem.getId());
                }

                VirtualDiskDescType diskDescType = diskDescByName.get(diskId);

                String capacity = diskDescType.getCapacity();

                dReq.setHd(Long.parseLong(capacity));

                final String allocationUnits = diskDescType.getCapacityAllocationUnits();
                final MemorySizeUnit hdSizeUnit = getMemoryUnitsFromOVF(allocationUnits);

                dReq.setHdSizeUnit(hdSizeUnit);
                // dReq.setImageSize(diskDescType.get);
            }
View Full Code Here

            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 (StringUtils.isEmpty(formatUri))
        {
            final String message = "Missing ''format'' attribute for the Disk element";
            throw new InvalidSectionException(message);
        }

        DiskFormatType format = DiskFormatType.fromURI(formatUri);

        if (format == null) // the format URI isn't on the abicloud enumeration. FIX it
        {
            // vbox/vmware
            // http://www.vmware.com/interfaces/specifications/vmdk.html#streamOptimized
            // abiquo
            // http://www.vmware.com/technical-resources/interfaces/vmdk_access.html#streamOptimized

            if (formatUri.contains("interfaces/specifications/vmdk.html"))
            {
                formatUri =
                    formatUri.replace("interfaces/specifications/vmdk.html",
                        "technical-resources/interfaces/vmdk_access.html");

                format = DiskFormatType.fromURI(formatUri);

                if (format == null)
                {
                    throw new InvalidSectionException(String.format(
                        "Invalid disk format type [%s]", formatUri));
                }

                vdisk.setFormat(formatUri);
            }

        }

        // try
View Full Code Here

                    {
                        throw new RequiredAttributeException("Virtual System makes reference to an undeclared disk "
                            + diskId);
                    }

                    VirtualDiskDescType diskDescType = diskIdToDiskFormat.get(diskId);

                    String capacity = diskDescType.getCapacity();

                    hd = Long.parseLong(capacity);
                }
            }// rasd
View Full Code Here

                else
                {
                    diskIdToVSs.get(diskId).add(vsystem.getId());
                }

                VirtualDiskDescType diskDescType = diskDescByName.get(diskId);
                final String capacity = diskDescType.getCapacity();
                final String allocationUnits = diskDescType.getCapacityAllocationUnits();

                dReq.setRequiredHDInMB(getMegaByes(Long.parseLong(capacity), allocationUnits));
            }
            else if (CIMResourceTypeEnum.Ethernet_Adapter.getNumericResourceType() == resTnumeric)
            {
View Full Code Here

TOP

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

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.