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

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


            logger.debug("backOutAllocations: no vms");
            return; // *** EARLY RETURN ***
        }

        for (int i = 0; i < vms.length; i++) {
            final VirtualMachine vm = vms[i];
            if (vm != null) {
                this.backOutIPAllocations(vm);
            }
        }
    }
View Full Code Here


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

        final int numNodes = req.getRequestedRA().getNodeNumber();
        final VirtualMachine vm = new VirtualMachine();
       
        final String name = req.getName();
        vm.setName(name);
       
        vm.setPreemptable(req.getRequestedRA().isSpotInstance());

        if (numNodes > 1) {
            logger.debug("binding " + numNodes + " virtual machines: " + name);
        } else {
            logger.debug("binding virtual machine: " + name);
        }

        final VirtualMachineDeployment dep = new VirtualMachineDeployment();
        vm.setDeployment(dep);

        this.bindNetwork.neededAllocations(vm, req.getRequestedNics());
        this.bindResourcePool.consume(vm, req.getRequestedResourcePool());
        this.bindSchedule.consume(dep, req.getRequestedSchedule());
        this.bindInitialState.consume(vm, req.getInitialStateRequest());
        this.bindShutdownMechanism.consume(dep, req.getShutdownType());
        this.bindKernel.consume(vm, req.getRequestedKernel());
        this.bindDisks.consume(vm, req.getVMFiles());
        this.bindResourceRequest.consume(dep, req.getRequestedRA());
        this.bindVMM.consume(vm, req.getRequiredVMM());
        this.bindCustomizations.consume(vm, req.getCustomizationRequests());
        this.bindCredential.consume(vm, req.getCredential());

        // all in group get the same data
        if (req.getMdUserData() != null) {
            vm.setMdUserData(req.getMdUserData());
        }

        final VirtualMachine[] vms = new VirtualMachine[numNodes];
        for (int i = 0; i < vms.length; i++) {
            try {
View Full Code Here

        if (rs == null || !rs.next()) {
            return vms.toArray(new VirtualMachine[vms.size()]);
        }

        do {
            VirtualMachine newVM = new VirtualMachine();
            newVM.setID(rs.getInt("id"));
            newVM.setName(rs.getString("name"));
            newVM.setNode(rs.getString("node"));
            newVM.setPropagateRequired(rs.getBoolean("prop_required"));
            newVM.setUnPropagateRequired(rs.getBoolean("unprop_required"));
            newVM.setNetwork(rs.getString("network"));
            newVM.setKernel(rs.getString("kernel_parameters"));
            newVM.setVmm(rs.getString("vmm"));
            newVM.setVmmVersion(rs.getString("vmm_version"));
            newVM.setAssociationsNeeded(rs.getString("assocs_needed"));
            newVM.setMdUserData(rs.getString("md_user_data"));
            newVM.setPreemptable(rs.getBoolean("preemptable"));
            newVM.setCredentialName(rs.getString("credential_name"));

            int binding_index = rs.getInt("binding_index");

            addDeployment(newVM, asyncID, binding_index, c);
            addPartitions(newVM, asyncID, binding_index, c);
View Full Code Here

            throw new ManageException(e);
        }

        logger.debug("found resource = " + resource);

        final VirtualMachine vm = resource.getVM();
        if (vm == null) {
            throw new ProgrammingError("vm is null");
        }

        final String node = vm.getNode();
        if (node == null) {
            logger.warn(Lager.id(vmid) + " assuming no node assignment yet " +
                    "because of ensemble not-done");
            return;
        }

        final VirtualMachineDeployment vmdep = vm.getDeployment();
        if (vmdep == null) {
            throw new ProgrammingError("deployment is null");
        }
       
        boolean preemptable = vm.isPreemptable();

        final int mem = vmdep.getIndividualPhysicalMemory();

        _releaseSpace(vmid, node, preemptable, mem);
    }
View Full Code Here

    public static void putAsyncRequestBindings(AsyncRequest asyncRequest, Connection c) throws SQLException {

        VirtualMachine[] bindings = asyncRequest.getBindings();
        for (int i=0; i<bindings.length; i++) {

            VirtualMachine binding = bindings[i];
            final PreparedStatement pstmt = c.prepareStatement(SQL_INSERT_ASYNC_REQUESTS_VMS);
            pstmt.setString(1, asyncRequest.getId());
            pstmt.setInt(2, i);
            pstmt.setInt(3, binding.getID());
            pstmt.setString(4, binding.getName());
            pstmt.setString(5, binding.getNode());
            boolean propRequired = binding.isPropagateRequired();
            if (propRequired) {
                pstmt.setInt(6, 1);
            }
            else {
                pstmt.setInt(6, 0);
            }
            boolean unpropRequired = binding.isUnPropagateRequired();
            if (unpropRequired) {
                pstmt.setInt(7, 1);
            }
            else {
                pstmt.setInt(7, 0);
            }
            pstmt.setString(8, binding.getNetwork());
            pstmt.setString(9, binding.getKernelParameters());
            pstmt.setString(10, binding.getVmm());
            pstmt.setString(11, binding.getVmmVersion());
            pstmt.setString(12, binding.getAssociationsNeeded());
            pstmt.setString(13, binding.getMdUserData());
            boolean preemptable = binding.isPreemptable();
            if (preemptable) {
                pstmt.setInt(14, 1);
            }
            else {
                pstmt.setInt(14, 0);
            }
            pstmt.setString(15, binding.getCredentialName());
            pstmt.executeUpdate();
            pstmt.close();

            putAsyncRequestVMDeployment(asyncRequest, i, c);
            putAsyncRequestVMPartitions(asyncRequest, i, c);
View Full Code Here

    protected void init() throws WorkspaceException {
        this.name = "StartPaused";
        this.doFakeLag = true;

        final VirtualMachine vm = this.ctx.getVm();
        if (vm != null) {
            final ArrayList ssh = SSHUtil.constructSshCommand(vm.getNode());
            final ArrayList exe = XenUtil.constructCreateCommand(vm, true);
            ssh.addAll(exe);
            this.cmd = (String[]) ssh.toArray(new String[ssh.size()]);
        } else {
            throw new WorkspaceException("no VirtualMachine in request " +
View Full Code Here

    protected void init() throws WorkspaceException {
        this.name = "Propagate-To-Start";
        this.doFakeLag = true;
        this.async = true;

        final VirtualMachine vm = this.ctx.getVm();
        if (vm != null) {

            final ArrayList exe =
                    this.ctx.getLocator().getPropagationAdapter().
                            constructPropagateToStartCommand(vm);
View Full Code Here

    protected void init() throws WorkspaceException {
        this.name = "Unpause";
        this.doFakeLag = true;

        final VirtualMachine vm = this.ctx.getVm();
        if (vm != null) {
            final ArrayList ssh = SSHUtil.constructSshCommand(vm.getNode());
            final ArrayList exe = XenUtil.constructUnpauseCommand(vm);
            ssh.addAll(exe);
            this.cmd = (String[]) ssh.toArray(new String[ssh.size()]);
        } else {
            throw new WorkspaceException("no VirtualMachine in request " +
View Full Code Here

    protected void init() throws WorkspaceException {
        this.name = "Reboot";
        this.doFakeLag = true;

        final VirtualMachine vm = this.ctx.getVm();
        if (vm != null) {
            final ArrayList ssh = SSHUtil.constructSshCommand(vm.getNode());
            final ArrayList exe = XenUtil.constructRebootCommand(vm);
            ssh.addAll(exe);
            this.cmd = (String[]) ssh.toArray(new String[ssh.size()]);
        } else {
            throw new WorkspaceException("no VirtualMachine in request " +
View Full Code Here

    protected void init() throws WorkspaceException {
        this.name = "Propagate-Only";
        this.doFakeLag = true;
        this.async = true;

        final VirtualMachine vm = this.ctx.getVm();
        if (vm != null) {
            final ArrayList exe = this.ctx.getLocator().
                         getPropagationAdapter().constructPropagateCommand(vm);
            this.cmd = (String[]) exe.toArray(new String[exe.size()]);
        } else {
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.