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

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


        if (traceLog) {
            logger.trace("Beginning propagate pre-execute");
        }

        // init would have thrown exception if null
        final VirtualMachine vm = this.ctx.getVm();

        final FileCopyNeed[] needs = vm.getFileCopyNeeds();
        if (needs == null || needs.length == 0) {
            if (traceLog) {
                logger.debug("FileCopy push: nothing to do");
            }
            return null;
View Full Code Here


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

        final VirtualMachine vm = this.ctx.getVm();
        if (vm != null) {
            final ArrayList ssh = SSHUtil.constructSshCommand(vm.getNode());
            final ArrayList exe = XenUtil.constructRemoveCommand(vm, false);
            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 = "Start";
        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, false);
            ssh.addAll(exe);
            this.cmd = (String[]) ssh.toArray(new String[ssh.size()]);
        } else {
            throw new WorkspaceException("no VirtualMachine in request " +
View Full Code Here

        if (traceLog) {
            logger.trace("Beginning start pre-execute");
        }

        final VirtualMachine vm = this.ctx.getVm();
        final FileCopyNeed[] needs = vm.getFileCopyNeeds();

        final PathConfigs paths = this.ctx.getLocator().getPathConfigs();
        final String backendDirectory = paths.getBackendTempDirPath();
        final String localDirectory = paths.getLocalTempDirPath();

        try {
            XenUtil.doFilePushRemoteTarget(vm,
                                           localDirectory,
                                           backendDirectory,
                                           fake,
                                           eventLog,
                                           traceLog);
        } catch (Exception e) {
            return e;
        }

        // todo: do not like this concept (waiting for ORM overhaul)
        final int vmid = vm.getID().intValue();
        for (int i = 0; i < needs.length; i++) {
            try {
                needs[i].setOnImage(true);
                this.ctx.getLocator().getPersistenceAdapter().
                        setFileCopyOnImage(vmid, needs[i]);
View Full Code Here

        }
    }

    public static void putAsyncRequestVMDeployment(AsyncRequest asyncRequest, int binding_index, Connection c) throws SQLException {

        VirtualMachine binding = asyncRequest.getBindings()[binding_index];
        VirtualMachineDeployment dep = binding.getDeployment();
        if (dep == null) {
            return;
        }

        PreparedStatement pstmt = c.prepareStatement(SQL_INSERT_ASYNC_REQUESTS_VM_DEPLOYMENT);

        pstmt.setString(1, asyncRequest.getId());
        pstmt.setInt(2, binding_index);
        pstmt.setInt(3, binding.getID());
        pstmt.setInt(4, dep.getRequestedState());
        pstmt.setInt(5, dep.getRequestedShutdown());
        pstmt.setInt(6, dep.getMinDuration());
        pstmt.setInt(7, dep.getIndividualPhysicalMemory());
        pstmt.setInt(8, dep.getIndividualCPUCount());
View Full Code Here

        pstmt.close();
    }

    public static void putAsyncRequestVMPartitions(AsyncRequest asyncRequest, int binding_index, Connection c) throws SQLException {

        VirtualMachine binding = asyncRequest.getBindings()[binding_index];
        VirtualMachinePartition[] partitions = binding.getPartitions();
        if (partitions == null) {
            return;
        }

        for (VirtualMachinePartition partition : binding.getPartitions()) {

            PreparedStatement pstmt = c.prepareStatement(SQL_INSERT_ASYNC_REQUESTS_VM_PARTITIONS);
            pstmt.setString(1, asyncRequest.getId());
            pstmt.setInt(2, binding_index);
            pstmt.setInt(3, binding.getID());
            pstmt.setString(4, partition.getImage());
            pstmt.setString(5, partition.getImagemount());
            boolean isReadWrite = partition.isReadwrite();
            if (isReadWrite) {
                pstmt.setInt(6, 1);
View Full Code Here

        }
    }

    public static void putAsyncRequestVMFileCopies(AsyncRequest asyncRequest, int binding_index, Connection c) throws SQLException {

        VirtualMachine binding = asyncRequest.getBindings()[binding_index];

        for (FileCopyNeed copy : binding.getFileCopyNeeds()) {

            PreparedStatement pstmt = c.prepareStatement(SQL_INSERT_ASYNC_REQUESTS_VM_FILE_COPY);

            pstmt.setString(1, asyncRequest.getId());
            pstmt.setInt(2, binding_index);
            pstmt.setInt(3, binding.getID());
            pstmt.setString(4, copy.sourcePath);
            pstmt.setString(5, copy.destPath);
            boolean onImage = copy.onImage();
            if (onImage) {
                pstmt.setInt(6, 1);
View Full Code Here

        }
    }

    private void updateCumulus()
    {
        VirtualMachine vm = this.getVM();

        try
        {
            RepoFileSystemAdaptor nsTrans = XenUtil.getNsTrans();

            VirtualMachinePartition[] parts = vm.getPartitions();

            for(int i = 0; i < parts.length; i++) {
                if (parts[i].isRootdisk()) {
                    String img = parts[i].getImage();
                    if(parts[i].getAlternateUnpropTarget() != null)
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 exe =
                    XenUtil.constructCreateCommand(vm, true);
            this.cmd = (String[]) exe.toArray(new String[exe.size()]);
        } else {
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 exe = XenUtil.constructUnpauseCommand(vm);
            this.cmd = (String[]) exe.toArray(new String[exe.size()]);
        } else {
            throw new WorkspaceException("no VirtualMachine in request " +
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.