Package com.xensource.xenapi

Examples of com.xensource.xenapi.PGPU


        HashMap<String, HashMap<String, VgpuTypesInfo>> groupDetails = new HashMap<String, HashMap<String, VgpuTypesInfo>>();
        Host host = Host.getByUuid(conn, _host.uuid);
        Set<PGPU> pgpus = host.getPGPUs(conn);
        Iterator<PGPU> iter = pgpus.iterator();
        while (iter.hasNext()) {
            PGPU pgpu = iter.next();
            GPUGroup gpuGroup = pgpu.getGPUGroup(conn);
            Set<VGPUType> enabledVGPUTypes = gpuGroup.getEnabledVGPUTypes(conn);
            String groupName = gpuGroup.getNameLabel(conn);
            HashMap<String, VgpuTypesInfo> gpuCapacity = new HashMap<String, VgpuTypesInfo>();
            if (groupDetails.get(groupName) != null) {
                gpuCapacity = groupDetails.get(groupName);
            }
            // Get remaining capacity of all the enabled VGPU in a PGPU
            if(enabledVGPUTypes != null) {
                Iterator<VGPUType> it = enabledVGPUTypes.iterator();
                while (it.hasNext()) {
                    VGPUType type = it.next();
                    Record record = type.getRecord(conn);
                    Long remainingCapacity = pgpu.getRemainingCapacity(conn, type);
                    Long maxCapacity = pgpu.getSupportedVGPUMaxCapacities(conn).get(type);
                    VgpuTypesInfo entry;
                    if ((entry = gpuCapacity.get(record.modelName)) != null) {
                        remainingCapacity += entry.getRemainingCapacity();
                        maxCapacity += entry.getMaxCapacity();
                        entry.setRemainingCapacity(remainingCapacity);
View Full Code Here

TOP

Related Classes of com.xensource.xenapi.PGPU

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.