Package org.nimbustools.api.repr.vm

Examples of org.nimbustools.api.repr.vm.ResourceAllocation


        if (req == null) {
            throw new IllegalArgumentException("req may not be null");
        }

        final ResourceAllocation requestedRA = req.getRequestedRA();
        if (requestedRA == null) {
            throw new IllegalArgumentException("requestedRA may not be null");
        }

        final int numNodes = req.getRequestedRA().getNodeNumber();
View Full Code Here


            String groupName = groupAuthz.getGroupName(creatorId);
            String state = vm.getState().getState();
            String startTime = vm.getSchedule().getStartTime().getTime().toString();
            String endTime = vm.getSchedule().getDestructionTime().getTime().toString();

            ResourceAllocation ra = vm.getResourceAllocation();
            String memory = Integer.toString(ra.getMemory());
            String cpuCount = Integer.toString(ra.getIndCpuCount());
            String uri = vm.getVMFiles()[0].getURI().getPath();

            VMTranslation vmt = new VMTranslation(id, node, creatorId, groupId, groupName, state, startTime, endTime,
                    memory, cpuCount, uri);
            return vmt;
View Full Code Here

            throw new CannotTranslateException(
                    "ProcessorArchitectureEnumeration contains " +
                            "unrecognized value '" + archEnum.toString() + "'");
        }

        ResourceAllocation ra = req.getRequestedRA();
        if (ra == null) {
            ra = this.repr._newResourceAllocation();
            req.setRequestedRA(ra);
        }
        if (!(ra instanceof _ResourceAllocation)) {
View Full Code Here

            throw new CannotTranslateException("vm may not be null");
        }

        final ResourceAllocation_Type alloc = new ResourceAllocation_Type();

        final ResourceAllocation ra = vm.getResourceAllocation();
        if (ra == null) {
            return alloc; // *** EARLY RETURN ***
        }

        this.setCPU(ra, alloc);

        final int raMem = ra.getMemory();
        if (raMem > -1) {
            final Exact_Type ex = new Exact_Type(raMem);
            final Exact_Type[] exacts = {ex};
            alloc.setIndividualPhysicalMemory(
                    new RangeValue_Type(exacts,null,null,null));
        }

        final int raCpus = ra.getIndCpuCount();
        if (raCpus > -1) {
            final Exact_Type ex = new Exact_Type(raCpus);
            final Exact_Type[] exacts = {ex};
            alloc.setIndividualCPUCount(
                    new RangeValue_Type(exacts,null,null,null));
        }

        final int raCpuPercent = ra.getCpuPercentage();
        if (raCpuPercent > -1) {
            final Exact_Type ex = new Exact_Type(raCpuPercent);
            final Exact_Type[] exacts = {ex};
            alloc.setCPUPercentage(
                    new RangeValue_Type(exacts,null,null,null));
View Full Code Here

            custRequests = null;
        }


        final String raType = launchSpec.getInstanceType();
        final ResourceAllocation ra = this.RAs.getMatchingRA(raType,
                                                             req.getInstanceCount().intValue(),
                                                             req.getInstanceCount().intValue(),
                                                             true);
        final NIC[] nics = this.getNICs(ra.getPublicNetwork(), ra.getPrivateNetwork());

        final RequiredVMM reqVMM = this.RAs.getRequiredVMM();

        String userData = null;
        final UserDataType t_userData = launchSpec.getUserData();
View Full Code Here

        if (vm == null) {
            throw new CannotTranslateException("vm is missing");
        }

        final ResourceAllocation ra = vm.getResourceAllocation();
        if (ra == null) {
            throw new CannotTranslateException("ra is missing");
        }

        return this.RAs.getMatchingName(vm, ra, this.networks.getManagerPublicNetworkName(), this.networks.getManagerPrivateNetworkName());
View Full Code Here

        } else {
            custRequests = null;
        }

        final String raType = req.getInstanceType();
        final ResourceAllocation ra = this.RAs.getMatchingRA(raType,
                                                             req.getMinCount(),
                                                             req.getMaxCount(),
                                                             false);
        final NIC[] nics = this.getNICs(ra.getPublicNetwork(), ra.getPrivateNetwork());
        final RequiredVMM reqVMM = this.RAs.getRequiredVMM();

        String userData = null;
        final UserDataType t_userData = req.getUserData();
        if (t_userData != null) {
View Full Code Here

        if (request.getRequestedSchedule() != null) {
            requestDuration = request.getRequestedSchedule().getDurationSeconds();
        }

        final ResourceAllocation ra = request.getRequestedRA();
        if (ra != null) {
            requestMemory = ra.getMemory();
            requestCpuCount = ra.getIndCpuCount();
        }

        final String msg = logId + "Idempotent request failed because of a parameter mismatch: ";
        if (instanceDuration != null && requestDuration != null) {
            if (!instanceDuration.equals(requestDuration)) {
View Full Code Here

    protected String getType(CreateRequest req) {
        if (req == null) {
            return "UNKNOWN";
        }
        final ResourceAllocation requestedRA = req.getRequestedRA();
        if (requestedRA == null) {
            return "UNKNOWN";
        }

        final String suffix;
View Full Code Here

TOP

Related Classes of org.nimbustools.api.repr.vm.ResourceAllocation

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.