Package org.globus.workspace.service.binding.vm

Examples of org.globus.workspace.service.binding.vm.VirtualMachine


                this.checkIdempotentInstanceForMismatch(resource, req, logId);

            } catch (DoesNotExistException e) {
                logger.debug("Idempotent reservation request has a terminated instance");

                final VirtualMachine vm = new VirtualMachine();
                vm.setNetwork("NONE");
                final VirtualMachineDeployment deployment = new VirtualMachineDeployment();
                vm.setDeployment(deployment);

                resource = new IdempotentInstanceResource(instance.getID(),
                        instance.getName(), null, res.getGroupId(), instances.size(),
                        instance.getLaunchIndex(), res.getCreatorId(), vm,
                        WorkspaceConstants.STATE_DESTROYING, res.getClientToken());
View Full Code Here


        Integer requestMemory = null;

        Integer instanceCpuCount = null;
        Integer requestCpuCount = null;

        final VirtualMachine vm = resource.getVM();
        if (vm != null) {
            final VirtualMachineDeployment deployment = vm.getDeployment();
            if (deployment != null) {
                instanceDuration = deployment.getMinDuration();
                instanceMemory = deployment.getIndividualPhysicalMemory();
                instanceCpuCount = deployment.getIndividualCPUCount();
            }
View Full Code Here

                                 caller.getSubject(),
                                 chargeRatio);
        }


        final VirtualMachine oneVM = bindings[0];
        final Reservation res = this.scheduleImpl(oneVM,
                bindings.length,
                groupID,
                coschedID,
                caller.getIdentity());
View Full Code Here

            if(this.persistent){
                //If the request is persistent, it is going to be considered again
                //for fulfillment, so, clone VirtualMachine and unset ID to avoid
                //garbage from previous object
                for (int i = 0; i < bindings.length; i++) {
                    VirtualMachine vm = bindings[i];
                    if(vm.getID() == vmid){
                        try {
                            //TODO: Check if this procedure is OK
                            bindings[i] = VirtualMachine.cloneOne(vm);
                            bindings[i].setID(-1);
                        } catch (Exception e) {
View Full Code Here

       
        VirtualMachine[] result = new VirtualMachine[quantity];
        int j = 0;
       
        for (int i = 0; i < bindings.length && j < quantity; i++) {
            VirtualMachine current = bindings[i];
            if(current.getID().equals(-1)){
                result[j++] = current;
            }
        }
       
        return result;
View Full Code Here

                    if (rs == null || !rs.next()) {
                        logger.error("resource with id=" + id + " not found");
                        throw new DoesNotExistException();
                    }

                    final VirtualMachine vm =
                            VirtualMachinePersistenceUtil.newVM(id, rs);

                    if (this.dbTrace) {
                        logger.trace(Lager.id(id) +
                                        ", created vm:\n" + vm.toString());
                    }

                    rs.close();

                    rs = pstmts[1].executeQuery();
                    if (rs == null || !rs.next()) {
                        logger.debug("resource with id=" + id + " has no" +
                                " deployment information");
                    } else {
                        VirtualMachinePersistenceUtil.addDeployment(vm, rs);
                        if (this.dbTrace) {
                            logger.trace("added deployment info to vm object");
                        }
                        rs.close();
                    }

                    rs = pstmts[2].executeQuery();

                    if (rs == null || !rs.next()) {
                        logger.warn("resource with id=" + id + " has no" +
                                " partitions");
                    } else {
                        final ArrayList partitions = new ArrayList(8);
                        do {
                            partitions.add(VirtualMachinePersistenceUtil.
                                                             getPartition(rs));
                        } while (rs.next());

                        final VirtualMachinePartition[] parts =
                            (VirtualMachinePartition[]) partitions.toArray(
                               new VirtualMachinePartition[partitions.size()]);
                        vm.setPartitions(parts);
                    }

                    rs = pstmts[3].executeQuery();

                    if (rs == null || !rs.next()) {
                        if (this.lager.dbLog) {
                            logger.debug("resource with id=" + id + " has no" +
                                    " customization needs");
                        }
                    } else {
                        do {
                            vm.addFileCopyNeed(
                                    VirtualMachinePersistenceUtil.getNeed(rs));
                        } while (rs.next());
                    }

                    ((VMPersistence)resource).setWorkspace(vm);
View Full Code Here

        if (rs == null || !rs.next()) {
            logger.error("resource with id=" + id + " not found");
            throw new DoesNotExistException();
        }

        final VirtualMachine vm =
                VirtualMachinePersistenceUtil.newVM(id, rs);

        if (this.dbTrace) {
            logger.trace(Lager.id(id) +
                    ", created vm:\n" + vm.toString());
        }

        rs.close();

        rs = pstmts[1].executeQuery();
        if (rs == null || !rs.next()) {
            logger.debug("resource with id=" + id + " has no" +
                    " deployment information");
        } else {
            VirtualMachinePersistenceUtil.addDeployment(vm, rs);
            if (this.dbTrace) {
                logger.trace("added deployment info to vm object");
            }
            rs.close();
        }

        rs = pstmts[2].executeQuery();

        if (rs == null || !rs.next()) {
            logger.warn("resource with id=" + id + " has no" +
                    " partitions");
        } else {
            final ArrayList partitions = new ArrayList(8);
            do {
                partitions.add(VirtualMachinePersistenceUtil.
                        getPartition(rs));
            } while (rs.next());

            final VirtualMachinePartition[] parts =
                    (VirtualMachinePartition[]) partitions.toArray(
                            new VirtualMachinePartition[partitions.size()]);
            vm.setPartitions(parts);
        }

        rs = pstmts[3].executeQuery();

        if (rs == null || !rs.next()) {
            if (this.lager.dbLog) {
                logger.debug("resource with id=" + id + " has no" +
                        " customization needs");
            }
        } else {
            do {
                vm.addFileCopyNeed(
                        VirtualMachinePersistenceUtil.getNeed(rs));
            } while (rs.next());
        }

        return vm;
View Full Code Here

        final _Schedule schedule = this.repr._newSchedule();

        schedule.setDestructionTime(resource.getTerminationTime());
        schedule.setStartTime(resource.getStartTime());

        final VirtualMachine vm = resource.getVM();
        if (vm == null) {
            throw new CannotTranslateException("null VirtualMachine?");
        }
        final VirtualMachineDeployment dep = vm.getDeployment();
        if (dep == null) {
            throw new CannotTranslateException("null deployment information?");
        }
        schedule.setDurationSeconds(dep.getMinDuration());
View Full Code Here

TOP

Related Classes of org.globus.workspace.service.binding.vm.VirtualMachine

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.