Skip to content

Commit 7483156

Browse files
author
Sateesh Chodapuneedi
committed
CLOUDSTACK-4911 - [Mixed Hypervisor] VM Status is marked as alive when exit status of ping command is not available within command timeout
Currently during ssh execution of remote command, if no response is received within timeout, Cloudstack is returning success result. This is resulting in false positives. Fix is to check if exit status of remote command is available or not. If not, return failure result. Signed-off-by: Sateesh Chodapuneedi <sateesh@apache.org>
1 parent 90521a3 commit 7483156

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

utils/src/com/cloud/utils/ssh/SshHelper.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,12 @@ public static Pair<Boolean, String> sshExecute(String host, int port, String use
185185
}
186186

187187
String result = sbResult.toString();
188+
189+
if (sess.getExitStatus() == null) {
190+
//Exit status is NOT available. Returning failure result.
191+
return new Pair<Boolean, String>(false, result);
192+
}
193+
188194
if (sess.getExitStatus() != null && sess.getExitStatus().intValue() != 0) {
189195
s_logger.error("SSH execution of command " + command + " has an error status code in return. result output: " + result);
190196
return new Pair<Boolean, String>(false, result);

0 commit comments

Comments
 (0)