Package org.nimbustools.api._repr.vm

Examples of org.nimbustools.api._repr.vm._VMFile


    // implements CreationManager
    // -------------------------------------------------------------------------

    public Advertised getAdvertised() {

        final _Advertised adv = this.repr._newAdvertised();
        adv.setCpuArchitectureNames(
                this.globals.getCpuArchitectureNames());
        adv.setDefaultRunningTimeSeconds(
                this.globals.getDefaultRunningTimeSeconds());
        adv.setMaxGroupSize(
                this.globals.getMaximumGroupSize());
        adv.setMaximumRunningTimeSeconds(
                this.globals.getMaximumRunningTimeSeconds());

        adv.setVmm(this.globals.getVmm());
        adv.setVmmVersions(this.globals.getVmmVersions());
       
        try {
            adv.setNetworkNames(this.networks.getAssociationNames());
        } catch (ManageException e) {
            logger.fatal(e.getMessage(), e);
            adv.setNetworkNames(null);
        }

        if (this.accounting != null) {
            adv.setChargeGranularity(this.accounting.getChargeGranularity());
        } else {
            adv.setChargeGranularity(-1);
        }

        return adv;
    }
View Full Code Here


            sb.append("\nUser: ").append(this.getRepoUser());
            sb.append("\nImage: ").append(this.getDiskImage());
            logger.debug(sb.toString());
        }

        final _AsyncCreateRequest req = this.reprFactory._newBackfillRequest();
        req.setInstanceType(SIConstants.SI_TYPE_BASIC);

        req.setName(name);
        req.setRequestedNics(this.getNetwork());
       
        final _ResourceAllocation ra = this.reprFactory._newResourceAllocation();
        req.setRequestedRA(ra);
        ra.setNodeNumber(numInstances);
        ra.setMemory(this.instanceMem);
        req.setShutdownType(CreateRequest.SHUTDOWN_TYPE_TRASH);
        req.setInitialStateRequest(CreateRequest.INITIAL_STATE_RUNNING);

        ra.setArchitecture(this.cpuArch);
        ra.setSpotInstance(true);
        final _RequiredVMM reqVMM = this.reprFactory._newRequiredVMM();
        reqVMM.setType(this.vmmType);
        reqVMM.setVersions(new String[]{this.vmmVersion});
        req.setRequiredVMM(reqVMM);

        final _VMFile file = this.reprFactory._newVMFile();
        file.setRootFile(true);
        file.setBlankSpaceName(null);
        file.setBlankSpaceSize(-1);
        file.setURI(imageURI);
        file.setMountAs(this.rootFileMountAs);
        file.setDiskPerms(VMFile.DISKPERMS_ReadWrite);
        req.setVMFiles(new _VMFile[]{file});

        return req;
    }
View Full Code Here

        return reqSI;
    }

    public AsyncCreateRequest getBackfillRequest(String name, int numNodes) throws Exception {
       
        final _AsyncCreateRequest backfill = this.repr._newBackfillRequest();
        backfill.setInstanceType(SIConstants.SI_TYPE_BASIC);               
       
        populate(backfill, 500, name, SIConstants.SI_TYPE_BASIC_MEM, numNodes, true, null, null, null);
               
        return backfill;
    }
View Full Code Here

        final boolean isSpotInstance = rs.getBoolean("spot");
        final String groupID = rs.getString("group_id");
        final boolean isPersistent = rs.getBoolean("persistent");
        final String creatorDN = rs.getString("creator_dn");
        final boolean isSuperuser = rs.getBoolean("creator_is_superuser");
        _Caller caller = repr._newCaller();
        caller.setIdentity(creatorDN);
        caller.setSuperUser(isSuperuser);
        // NOTE: this context isn't persisted because it doesn't seem to be used
        final Context context = repr._newContext();

        final long t = rs.getLong("creation_time");
        final String sshKeyName = rs.getString("ssh_key_name");
View Full Code Here

        final String creatorID = this._getManagerID(id, type);
        if (creatorID == null) {
            throw new ManageException("creatorID may not be null");
        }
       
        final _Caller caller = this.repr._newCaller();
        caller.setIdentity(creatorID);
        return new Caller[]{caller};
    }
View Full Code Here

        return gson.toJson(vmts);
    }

    public String getVMsByDN(String userDN) throws RemoteException {
        try {
            final _Caller caller = this.reprFactory._newCaller();
            caller.setIdentity(userDN);
            VM[] vms = manager.getAllByCaller(caller);

            if(vms.length == 0)
                return null;
View Full Code Here

                if(vms == null)
                    errorMsg = "No VMs with user name " + typeID + " found";
                return vms;
            }
            else if(type == SHUTDOWN_DN || type == CLEANUP_DN) {
                final _Caller caller = this.reprFactory._newCaller();
                caller.setIdentity(typeID);
                VM[] vms = manager.getAllByCaller(caller);
                if(vms.length == 0)
                    errorMsg = "No VMs with DN " + typeID + " found";
                return vms;
            }
View Full Code Here

            }
            else if(dnAlias.size() > 1)
                throw new RemoteException("User_Alias size: " + dnAlias.size());

            String aliasDN = dnAlias.get(0).getAliasName();
            final _Caller caller = this.reprFactory._newCaller();
            caller.setIdentity(aliasDN);
            VM[] vmsByCaller = manager.getAllByCaller(caller);
            return vmsByCaller;
        }
        catch (AuthzDBException e) {
            throw new RemoteException(e.getMessage());
View Full Code Here

                authz = new AuthzDBAdapter(authzDataSource);
                ArrayList<VM> allVMs = new ArrayList<VM>(0);

                for(int i = 0; i < dns.length; i++) {
                    final _Caller caller = this.reprFactory._newCaller();
                    caller.setIdentity(dns[i]);
                    VM[] vmsByCaller = manager.getAllByCaller(caller);
                    for(int j = 0; j < vmsByCaller.length; j++) {
                        allVMs.add(vmsByCaller[j]);
                    }
                }
View Full Code Here

    // TRANSLATE TO: Caller
    // -------------------------------------------------------------------------

    public Caller getCaller(String callerDN) {

        final _Caller caller = this.repr._newCaller();
        caller.setIdentity(callerDN);
        caller.setSubject(IdentityUtil.discoverSubject());
        return caller;
    }
View Full Code Here

TOP

Related Classes of org.nimbustools.api._repr.vm._VMFile

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.