Search in sources :

Example 16 with StartupRoutingCommand

use of com.cloud.legacymodel.communication.command.startup.StartupRoutingCommand 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);
        }
    }
}
Also used : StartupCommand(com.cloud.legacymodel.communication.command.startup.StartupCommand) StartupRoutingCommand(com.cloud.legacymodel.communication.command.startup.StartupRoutingCommand)

Aggregations

StartupRoutingCommand (com.cloud.legacymodel.communication.command.startup.StartupRoutingCommand)16 StartupCommand (com.cloud.legacymodel.communication.command.startup.StartupCommand)14 HostVO (com.cloud.host.HostVO)4 AgentUnavailableException (com.cloud.legacymodel.exceptions.AgentUnavailableException)4 ClusterVO (com.cloud.dc.ClusterVO)3 CloudRuntimeException (com.cloud.legacymodel.exceptions.CloudRuntimeException)3 ConnectionException (com.cloud.legacymodel.exceptions.ConnectionException)3 Commands (com.cloud.agent.manager.Commands)2 HostPodVO (com.cloud.dc.HostPodVO)2 StartupSecondaryStorageCommand (com.cloud.legacymodel.communication.command.startup.StartupSecondaryStorageCommand)2 StartupStorageCommand (com.cloud.legacymodel.communication.command.startup.StartupStorageCommand)2 Before (org.junit.Before)2 Listener (com.cloud.agent.Listener)1 Response (com.cloud.common.transport.Response)1 Zone (com.cloud.db.model.Zone)1 DataCenterVO (com.cloud.dc.DataCenterVO)1 DataStore (com.cloud.engine.subsystem.api.storage.DataStore)1 ZoneScope (com.cloud.engine.subsystem.api.storage.ZoneScope)1 HostDao (com.cloud.host.dao.HostDao)1 AgentControlAnswer (com.cloud.legacymodel.communication.answer.AgentControlAnswer)1