incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edi...@apache.org
Subject git commit: CS-15521 Xenserver based User VM failed to HA when vrouter runs on ESXi return false as an answer when executing PingTestCommand in VMwareResource RB:https://reviews.apache.org/r/5903/ Send-by: mice_xia@tcloudcomputing.com
Date Thu, 26 Jul 2012 17:45:01 GMT
Updated Branches:
  refs/heads/master 50ffa95f6 -> 764678f55


CS-15521 Xenserver based User VM failed to HA when vrouter runs on ESXi
return false as an answer when executing PingTestCommand in
VMwareResource
RB:https://reviews.apache.org/r/5903/
Send-by: mice_xia@tcloudcomputing.com


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

Branch: refs/heads/master
Commit: 764678f558d9a1aade2c10b8f57fb7ea93ecd5c6
Parents: 50ffa95
Author: Edison Su <sudison@gmail.com>
Authored: Thu Jul 26 10:43:33 2012 -0700
Committer: Edison Su <sudison@gmail.com>
Committed: Thu Jul 26 10:43:33 2012 -0700

----------------------------------------------------------------------
 .../hypervisor/vmware/resource/VmwareResource.java |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/764678f5/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
index 685a321..208cbbe 100755
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
@@ -2786,8 +2786,18 @@ public class VmwareResource implements StoragePoolResource, ServerResource,
Vmwa
         if (s_logger.isInfoEnabled()) {
             s_logger.info("Executing resource PingTestCommand: " + _gson.toJson(cmd));
         }
-
-        return new Answer(cmd);
+        String controlIp = cmd.getRouterIp();
+        String args = " -c 1 -n -q " + cmd.getPrivateIp();
+        try {
+            VmwareManager mgr = getServiceContext().getStockObject(VmwareManager.CONTEXT_STOCK_NAME);
+            Pair<Boolean, String> result = SshHelper.sshExecute(controlIp, DEFAULT_DOMR_SSHPORT,
"root", mgr.getSystemVMKeyFile(), null, "/bin/ping" + args);
+            if(result.first())
+                return new Answer(cmd);
+        } catch (Exception e) {
+            s_logger.error("Unable to execute ping command on DomR (" + controlIp + "), domR
may not be ready yet. failure due to " 
+                    + VmwareHelper.getExceptionMessage(e), e);
+        }
+        return new Answer(cmd,false,"PingTestCommand failed");
     }
 
     protected Answer execute(CheckOnHostCommand cmd) {


Mime
View raw message