Search in sources :

Example 1 with GetDomRVersionCommand

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

the class VirtualNetworkApplianceManagerImpl method finalizeSshAndVersionAndNetworkUsageOnStart.

protected void finalizeSshAndVersionAndNetworkUsageOnStart(final Commands cmds, final VirtualMachineProfile profile, final DomainRouterVO router, final NicProfile controlNic) {
    final DomainRouterVO vr = _routerDao.findById(profile.getId());
    cmds.addCommand("checkSsh", new CheckSshCommand(profile.getInstanceName(), controlNic.getIPv4Address(), 3922));
    // Update router template/scripts version
    final GetDomRVersionCommand command = new GetDomRVersionCommand();
    command.setAccessDetail(NetworkElementCommand.ROUTER_IP, controlNic.getIPv4Address());
    command.setAccessDetail(NetworkElementCommand.ROUTER_NAME, router.getInstanceName());
    cmds.addCommand("getDomRVersion", command);
    // Network usage command to create iptables rules
    final boolean forVpc = vr.getVpcId() != null;
    if (!forVpc) {
        cmds.addCommand("networkUsage", new NetworkUsageCommand(controlNic.getIPv4Address(), router.getHostName(), "create", forVpc));
    }
}
Also used : GetDomRVersionCommand(com.cloud.legacymodel.communication.command.GetDomRVersionCommand) CheckSshCommand(com.cloud.legacymodel.communication.command.CheckSshCommand) NetworkUsageCommand(com.cloud.legacymodel.communication.command.NetworkUsageCommand) DomainRouterVO(com.cloud.vm.DomainRouterVO)

Aggregations

CheckSshCommand (com.cloud.legacymodel.communication.command.CheckSshCommand)1 GetDomRVersionCommand (com.cloud.legacymodel.communication.command.GetDomRVersionCommand)1 NetworkUsageCommand (com.cloud.legacymodel.communication.command.NetworkUsageCommand)1 DomainRouterVO (com.cloud.vm.DomainRouterVO)1