cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tall...@apache.org
Subject [52/60] [abbrv] git commit: updated refs/heads/marvin to 0e223d6
Date Tue, 08 Apr 2014 12:26:07 GMT
CLOUDSTACK-6314: Use SSH commands for Xen VR execution

Instead of XAPI, which would make XenServer unnecessary busy.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/e8227c88
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/e8227c88
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/e8227c88

Branch: refs/heads/marvin
Commit: e8227c88d823cf525b7377c4b94f2c4af0deece4
Parents: 78a29c0
Author: Sheng Yang <sheng.yang@citrix.com>
Authored: Fri Apr 4 14:57:52 2014 -0700
Committer: Sheng Yang <sheng.yang@citrix.com>
Committed: Mon Apr 7 13:38:14 2014 -0700

----------------------------------------------------------------------
 .../hypervisor/xen/resource/CitrixResourceBase.java  | 13 +++++++++----
 scripts/vm/hypervisor/xenserver/vmops                | 15 ---------------
 2 files changed, 9 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e8227c88/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
index 0cdd335..20497b5 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
@@ -170,6 +170,7 @@ import com.cloud.utils.Ternary;
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.net.NetUtils;
 import com.cloud.utils.ssh.SSHCmdHelper;
+import com.cloud.utils.ssh.SshHelper;
 import com.cloud.vm.DiskProfile;
 import com.cloud.vm.VirtualMachine;
 import com.cloud.vm.VirtualMachine.PowerState;
@@ -558,10 +559,14 @@ public abstract class CitrixResourceBase implements ServerResource,
HypervisorRe
 
     @Override
     public ExecutionResult executeInVR(String routerIP, String script, String args, int timeout)
{
-        Connection conn = getConnection();
-        String rc = callHostPluginAsync(conn, "vmops", "routerProxy", timeout, "args", script
+ " " + routerIP + " " + args);
-        // Fail case would be start with "fail#"
-        return new ExecutionResult(rc.startsWith("succ#"), rc.substring(5));
+        Pair<Boolean, String> result;
+        try {
+            result = SshHelper.sshExecute(_host.ip, 22, _username, null, _password.peek(),
"/opt/cloud/bin/router_proxy.sh " + script + " " + routerIP + " " + args,
+                    60000, 60000, timeout * 1000);
+        } catch (Exception e) {
+            return new ExecutionResult(false, e.getMessage());
+        }
+        return new ExecutionResult(result.first(), result.second());
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e8227c88/scripts/vm/hypervisor/xenserver/vmops
----------------------------------------------------------------------
diff --git a/scripts/vm/hypervisor/xenserver/vmops b/scripts/vm/hypervisor/xenserver/vmops
index 38e368b..3f25a2e 100755
--- a/scripts/vm/hypervisor/xenserver/vmops
+++ b/scripts/vm/hypervisor/xenserver/vmops
@@ -198,20 +198,6 @@ def setLinkLocalIP(session, args):
     return txt
 
 @echo
-def routerProxy(session, args):
-    sargs = args['args']
-    cmd = sargs.split(' ')
-    cmd.insert(0, "/opt/cloud/bin/router_proxy.sh")
-    cmd.insert(0, "/bin/bash")
-    try:
-        txt = util.pread2(cmd)
-        txt = 'succ#' + txt
-    except:
-        logging.debug("routerProxy command " + sargs + " failed "  )
-        txt = 'fail#' + txt
-    return txt
-
-@echo
 def createFile(session, args):
     file_path = args['filepath']
     file_contents = args['filecontents']
@@ -1495,7 +1481,6 @@ if __name__ == "__main__":
      XenAPIPlugin.dispatch({"pingtest": pingtest, "setup_iscsi":setup_iscsi,
                             "getgateway": getgateway, "preparemigration": preparemigration,

                             "setIptables": setIptables, "pingdomr": pingdomr, "pingxenserver":
pingxenserver,  
-                            "routerProxy": routerProxy, 
                             "createFile": createFile, "deleteFile": deleteFile,
                             "network_rules":network_rules, 
                             "can_bridge_firewall":can_bridge_firewall, "default_network_rules":default_network_rules,


Mime
View raw message