Search in sources :

Example 1 with ShutdownEventCommand

use of com.cloud.legacymodel.communication.command.agentcontrol.ShutdownEventCommand in project cosmic by MissionCriticalCloud.

the class LifecycleListener method sendShutdownEventCommand.

private void sendShutdownEventCommand(final Domain domain) {
    try {
        logger.info("Found domain " + domain.getName() + " to have been stopped, transferring a shutdown event to the management server");
        final ShutdownEventCommand shutdownEventCommand = new ShutdownEventCommand(domain.getName());
        this.libvirtComputingResource.getAgentControl().sendRequest(shutdownEventCommand, 60000);
    } catch (final LibvirtException e) {
        logger.error("Unable to gather libvirt domain name for shutdown event");
    } catch (final AgentControlChannelException e) {
        logger.error("Exception while sending shutdown event to management server");
    }
}
Also used : LibvirtException(org.libvirt.LibvirtException) AgentControlChannelException(com.cloud.legacymodel.exceptions.AgentControlChannelException) ShutdownEventCommand(com.cloud.legacymodel.communication.command.agentcontrol.ShutdownEventCommand)

Aggregations

ShutdownEventCommand (com.cloud.legacymodel.communication.command.agentcontrol.ShutdownEventCommand)1 AgentControlChannelException (com.cloud.legacymodel.exceptions.AgentControlChannelException)1 LibvirtException (org.libvirt.LibvirtException)1