fix devcloud reboot issue: should not start heartbeat for devcloud

This commit is contained in:
edison 2014-02-06 14:19:29 -08:00
parent 8f63c2cf9c
commit bd335d01cb
2 changed files with 19 additions and 5 deletions

View File

@ -5019,6 +5019,16 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
}
}
protected boolean launchHeartBeat(Connection conn) {
String result = callHostPluginPremium(conn, "heartbeat", "host", _host.uuid, "interval", Integer
.toString(_heartbeatInterval));
if (result == null || !result.contains("> DONE <")) {
s_logger.warn("Unable to launch the heartbeat process on " + _host.ip);
return false;
}
return true;
}
protected SetupAnswer execute(SetupCommand cmd) {
Connection conn = getConnection();
setupServer(conn);
@ -5032,12 +5042,11 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
_canBridgeFirewall = can_bridge_firewall(conn);
}
String result = callHostPluginPremium(conn, "heartbeat", "host", _host.uuid, "interval", Integer
.toString(_heartbeatInterval));
if (result == null || !result.contains("> DONE <")) {
s_logger.warn("Unable to launch the heartbeat process on " + _host.ip);
boolean r = launchHeartBeat(conn);
if (!r) {
return null;
}
cleanupTemplateSR(conn);
Host host = Host.getByUuid(conn, _host.uuid);
try {
@ -5051,7 +5060,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
s_logger.debug("multipath is already set");
}
if (cmd.needSetup() ) {
result = callHostPlugin(conn, "vmops", "setup_iscsi", "uuid", _host.uuid);
String result = callHostPlugin(conn, "vmops", "setup_iscsi", "uuid", _host.uuid);
if (!result.contains("> DONE <")) {
s_logger.warn("Unable to setup iscsi: " + result);
return new SetupAnswer(cmd, result);

View File

@ -74,6 +74,11 @@ public class XcpOssResource extends CitrixResourceBase {
cmd.setCaps(cmd.getCapabilities() + " , hvm");
}
@Override
protected boolean launchHeartBeat(Connection conn) {
return true;
}
protected StartupStorageCommand initializeLocalSR(Connection conn) {
SR extsr = getLocalEXTSR(conn);
if (extsr != null) {