protected void executeCommand() {
final VDS vds = getVds();
try (EngineLock monitoringLock = acquireMonitorLock("Activate host")) {
executionHandler.updateSpecificActionJobCompleted(vds.getId(), ActionType.MaintenanceVds, false);
setSucceeded(setVdsStatus(VDSStatus.Unassigned).getSucceeded());
if (getSucceeded()) {
TransactionSupport.executeInNewTransaction(() -> {
// set network to operational / non-operational
List<Network> networks = networkDao.getAllForCluster(vds.getClusterId());
networkClusterHelper.setStatus(vds.getClusterId(), networks);
return null;
});
// Start glusterd service on the node, which would haven been stopped due to maintenance
if (vds.getClusterSupportsGlusterService()) {
runVdsCommand(VDSCommandType.ManageGlusterService,
new GlusterServiceVDSParameters(vds.getId(), Arrays.asList("glusterd"), "restart"));
// starting vdo service
GlusterStatus isRunning = glusterUtil.isVDORunning(vds.getId());
switch (isRunning) {
case DOWN:
log.info("VDO service is down in host : '{}' with id '{}', starting VDO service",
vds.getHostName(),
vds.getId());
startVDOService(vds);
break;
case UP:
log.info("VDO service is up in host : '{}' with id '{}', skipping starting of VDO service",
vds.getHostName(),
vds.getId());
break;
case UNKNOWN:
log.info("VDO service is not installed host : '{}' with id '{}', ignoring to start VDO service",
vds.getHostName(),
vds.getId());
break;
}
}
}
}
}