mirror of https://github.com/apache/cloudstack.git
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
This commit is contained in:
parent
50ffa95f63
commit
764678f558
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue