Search in sources :

Example 26 with StartupCommand

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);
            }
        }
    }
}
Also used : StartupCommand(com.cloud.legacymodel.communication.command.startup.StartupCommand) ClusterVMMetaDataSyncCommand(com.cloud.legacymodel.communication.command.ClusterVMMetaDataSyncCommand) AgentUnavailableException(com.cloud.legacymodel.exceptions.AgentUnavailableException) Commands(com.cloud.agent.manager.Commands) StartupRoutingCommand(com.cloud.legacymodel.communication.command.startup.StartupRoutingCommand)

Example 27 with StartupCommand

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

Aggregations

StartupCommand (com.cloud.legacymodel.communication.command.startup.StartupCommand)27 StartupRoutingCommand (com.cloud.legacymodel.communication.command.startup.StartupRoutingCommand)14 AgentUnavailableException (com.cloud.legacymodel.exceptions.AgentUnavailableException)6 CloudRuntimeException (com.cloud.legacymodel.exceptions.CloudRuntimeException)6 StartupStorageCommand (com.cloud.legacymodel.communication.command.startup.StartupStorageCommand)5 HostVO (com.cloud.host.HostVO)4 StartupSecondaryStorageCommand (com.cloud.legacymodel.communication.command.startup.StartupSecondaryStorageCommand)4 Request (com.cloud.common.transport.Request)3 ClusterVO (com.cloud.dc.ClusterVO)3 ConnectionException (com.cloud.legacymodel.exceptions.ConnectionException)3 DiscoveryException (com.cloud.legacymodel.exceptions.DiscoveryException)3 InvalidParameterValueException (com.cloud.legacymodel.exceptions.InvalidParameterValueException)3 NoTransitionException (com.cloud.legacymodel.exceptions.NoTransitionException)3 ResourceInUseException (com.cloud.legacymodel.exceptions.ResourceInUseException)3 UnableDeleteHostException (com.cloud.legacymodel.exceptions.UnableDeleteHostException)3 StoragePoolHostVO (com.cloud.storage.StoragePoolHostVO)3 SshException (com.cloud.utils.ssh.SshException)3 URISyntaxException (java.net.URISyntaxException)3 ConfigurationException (javax.naming.ConfigurationException)3 Commands (com.cloud.agent.manager.Commands)2