use of com.cloud.legacymodel.communication.command.startup.StartupCommand in project cosmic by MissionCriticalCloud.
the class VirtualMachineManagerImpl method processConnect.
@Override
public void processConnect(final Host agent, final StartupCommand[] startupCommands, final boolean forRebalance) throws ConnectionException {
for (final StartupCommand startupCommand : startupCommands) {
if (!(startupCommand instanceof StartupRoutingCommand)) {
return;
}
s_logger.debug("Received startup command from hypervisor host. host id: " + agent.getId());
_syncMgr.resetHostSyncState(agent.getId());
if (forRebalance) {
s_logger.debug("Not processing listener " + this + " as connect happens on rebalance process");
return;
}
final Long clusterId = agent.getClusterId();
final long agentId = agent.getId();
if (agent.getHypervisorType() == HypervisorType.XenServer) {
// only for Xen
// initiate the cron job
final ClusterVMMetaDataSyncCommand syncVMMetaDataCmd = new ClusterVMMetaDataSyncCommand(ClusterVMMetaDataSyncInterval.value(), clusterId);
try {
final long seq_no = _agentMgr.send(agentId, new Commands(syncVMMetaDataCmd), this);
s_logger.debug("Cluster VM metadata sync started with jobid " + seq_no);
} catch (final AgentUnavailableException e) {
s_logger.error("The Cluster VM metadata sync process failed for cluster id " + clusterId + " with ", e);
}
}
}
}
use of com.cloud.legacymodel.communication.command.startup.StartupCommand in project cosmic by MissionCriticalCloud.
the class DeploymentPlanningManagerImpl method processConnect.
@Override
public void processConnect(final Host host, final StartupCommand[] startupCommands, final boolean forRebalance) {
for (final StartupCommand startupCommand : startupCommands) {
if (!(startupCommand instanceof StartupRoutingCommand)) {
return;
}
final PlannerHostReservationVO reservationEntry = _plannerHostReserveDao.findByHostId(host.getId());
if (reservationEntry == null) {
// record the host in this table
final PlannerHostReservationVO newHost = new PlannerHostReservationVO(host.getId(), host.getDataCenterId(), host.getPodId(), host.getClusterId());
_plannerHostReserveDao.persist(newHost);
}
}
}
Aggregations