Examples of VirtualDiskDescType


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

        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

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

                    {
                        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

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

                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

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

            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

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

                    {
                        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

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

                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

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

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

        DiskFormatOVF format = DiskFormatOVF.fromValue(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 = DiskFormatOVF.fromValue(formatUri);

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

                vdisk.setFormat(formatUri);
            }

        }

        // try
View Full Code Here

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

    {
        DiskFormatOVF format = DiskFormatOVF.fromName(disk.getDiskFileFormat());

        final Long diskSize = disk.getRequiredHDInMB();

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

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

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

    {
        DiskFormatOVF format = DiskFormatOVF.fromName(disk.getDiskFileFormat());

        final Long diskSize = disk.getRequiredHDInMB();

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

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

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

                    {
                        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
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.