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

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


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

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


    protected void init() throws WorkspaceException {
        this.name = "Ready-For-Transport";
        this.doFakeLag = true;
        this.async = true;

        final VirtualMachine vm = this.ctx.getVm();
        if (vm != null) {
           
            final ArrayList exe =
                    this.ctx.getLocator().getPropagationAdapter().
                            constructUnpropagateCommand(vm);
View Full Code Here

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

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

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

        final VirtualMachine vm = this.ctx.getVm();
        if (vm != null) {
            final ArrayList exe =
                XenUtil.constructRemoveCommand(vm, true);
            this.cmd = (String[]) exe.toArray(new String[exe.size()]);
        } else {
View Full Code Here

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

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

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

        }

        try {
            // See WorkspaceResource.isVMMaccessOK() javadoc
            if (this.ctx != null && !this.ctx.isVmmAccessOK()) {
                final VirtualMachine vm = this.ctx.getVm();
                final String err;
                if (vm != null) {
                    err = "Do not run have rights to run " +
                           this.name + " for VM " + vm.getID() +
                           " on node " + vm.getNode();
                } else {
                    err = "Do not run have rights to run " +
                            this.name + " with ctx ID = " + id;
                }
                return new WorkspaceException(err);
View Full Code Here

        Context context = null;
        String testSshKeyName = "fake-ssh-key";
        Calendar testCreationTime = Calendar.getInstance();
        testCreationTime.setTimeInMillis(424242424242l);
        String testNIC = "FakeName;FakeAssociation;FAKEMAC;NetMode;IPmethod;192.168.1.42;192.168.1.1;192.168.1.2;subnetmask;dns;hostname;null;null;null;null";
        VirtualMachine testVM = new VirtualMachine();
        testVM.setID(42);
        testVM.setName("fakename");
        testVM.setNetwork(testNIC);
        testVM.setPropagateRequired(false);
        testVM.setUnPropagateRequired(true);
        VirtualMachine[] testBindings = new VirtualMachine[1];
        testBindings[0] = testVM;
        int testAllocatedVM = 42;

        DataConvert dataConvert = new DataConvert(this.locator.getReprFactory());
        NIC[] testNICs = dataConvert.getNICs(testVM);
        logger.debug("Nics: " + testNICs[0]);

        //public AsyncRequest(String id, boolean spotinstances, Double spotPrice, boolean persistent, Caller caller, String groupID, VirtualMachine[] bindings, Context context, NIC[] requestedNics, String sshKeyName, Calendar creationTime) {
        AsyncRequest testRequest = new AsyncRequest(testID, testSpotinstances, testMaxBid, testIsPersistent, testCaller, testGroupID, testBindings, context, testNICs, testSshKeyName, testCreationTime);
        testRequest.addAllocatedVM(testAllocatedVM);
        asyncRequestMap.addOrReplace(testRequest);

        String secondID = "this-is-the-other-one";
        double secondMaxBid = 4.5;
        VirtualMachine[] secondBindings = new VirtualMachine[1];
        VirtualMachine secondVM = new VirtualMachine();
        secondVM.setID(52);
        secondBindings[0] = secondVM;

        AsyncRequest secondRequest = new AsyncRequest(secondID, testSpotinstances, secondMaxBid, testIsPersistent, testCaller, testGroupID, secondBindings, context, testNICs, testSshKeyName, testCreationTime);

        allRequests = asyncRequestMap.getAll();
View Full Code Here

    public static PreparedStatement[] getInsertVM(InstanceResource resource,
                                                  int id,
                                                  Connection c)
            throws ManageException, SQLException {

        final VirtualMachine vm = resource.getVM();
        if (vm == null) {
            throw new ProgrammingError("vm is null");
        }
        return getInsertVM(vm, id, c);
    }
View Full Code Here


    public static VirtualMachine newVM(int id, ResultSet rs)
                                                throws SQLException {

        VirtualMachine vm = new VirtualMachine();
        vm.setID(id);
        vm.setName(rs.getString(1));
        vm.setNode(rs.getString(2));
        boolean propagateRequired = rs.getBoolean(3);
        vm.setPropagateRequired(propagateRequired);
        boolean unPropagateRequired = rs.getBoolean(4);
        vm.setUnPropagateRequired(unPropagateRequired);
        vm.setNetwork(rs.getString(5));
        vm.setKernelParameters(rs.getString(6));
        vm.setVmm(rs.getString(7));
        vm.setVmmVersion(rs.getString(8));
        vm.setAssociationsNeeded(rs.getString(9));
        vm.setMdUserData(rs.getString(10));
        vm.setPreemptable(rs.getBoolean(11));
        vm.setCredentialName(rs.getString(12));
        return vm;
    }
View Full Code Here

    private VMTranslation translateVM(VM vm) throws RemoteException {
        try {
            GroupAuthz groupAuthz = (GroupAuthz) authzCallout;

            String id = vm.getID();
            VirtualMachine vmlong = workspaceHome.find(id).getVM();
            String node = vmlong.getNode();
            String creatorId = vm.getCreator().getIdentity();
            String groupId = Integer.toString(groupAuthz.getGroupIDFromCaller(creatorId));
            String groupName = groupAuthz.getGroupName(creatorId);
            String state = vm.getState().getState();
            String startTime = vm.getSchedule().getStartTime().getTime().toString();
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.