Search in sources :

Example 6 with UpdateVmOverviewCommand

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

the class BasicNetworkVisitor method visit.

@Override
public boolean visit(final SshKeyToRouterRules sshkey) throws ResourceUnavailableException {
    final VirtualRouter router = sshkey.getRouter();
    final VirtualMachineProfile profile = sshkey.getProfile();
    final Commands commands = new Commands(Command.OnError.Stop);
    final NicVO nicVO = sshkey.getNicVo();
    final VMTemplateVO template = sshkey.getTemplate();
    if (template != null && template.getEnablePassword()) {
        _commandSetupHelper.createPasswordCommand(router, profile, nicVO, commands);
    }
    final VMOverviewTO vmOverview = _commandSetupHelper.createVmOverviewFromRouter(router);
    final UpdateVmOverviewCommand updateVmOverviewCommand = _commandSetupHelper.createUpdateVmOverviewCommand(router, vmOverview);
    commands.addCommand(updateVmOverviewCommand);
    return _networkGeneralHelper.sendCommandsToRouter(router, commands);
}
Also used : VMOverviewTO(com.cloud.legacymodel.to.VMOverviewTO) Commands(com.cloud.agent.manager.Commands) VMTemplateVO(com.cloud.storage.VMTemplateVO) VirtualMachineProfile(com.cloud.vm.VirtualMachineProfile) NicVO(com.cloud.vm.NicVO) VirtualRouter(com.cloud.legacymodel.network.VirtualRouter) UpdateVmOverviewCommand(com.cloud.legacymodel.communication.command.UpdateVmOverviewCommand)

Example 7 with UpdateVmOverviewCommand

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

the class BasicNetworkVisitor method visit.

@Override
public boolean visit(final UserdataToRouterRules userdata) throws ResourceUnavailableException {
    final VirtualRouter router = userdata.getRouter();
    final Commands commands = new Commands(Command.OnError.Stop);
    final VMOverviewTO vmOverview = _commandSetupHelper.createVmOverviewFromRouter(router);
    final UpdateVmOverviewCommand updateVmOverviewCommand = _commandSetupHelper.createUpdateVmOverviewCommand(router, vmOverview);
    commands.addCommand(updateVmOverviewCommand);
    return _networkGeneralHelper.sendCommandsToRouter(router, commands);
}
Also used : VMOverviewTO(com.cloud.legacymodel.to.VMOverviewTO) Commands(com.cloud.agent.manager.Commands) VirtualRouter(com.cloud.legacymodel.network.VirtualRouter) UpdateVmOverviewCommand(com.cloud.legacymodel.communication.command.UpdateVmOverviewCommand)

Aggregations

UpdateVmOverviewCommand (com.cloud.legacymodel.communication.command.UpdateVmOverviewCommand)7 VMOverviewTO (com.cloud.legacymodel.to.VMOverviewTO)6 Commands (com.cloud.agent.manager.Commands)5 VirtualRouter (com.cloud.legacymodel.network.VirtualRouter)5 NicVO (com.cloud.vm.NicVO)3 VirtualMachineProfile (com.cloud.vm.VirtualMachineProfile)3 Zone (com.cloud.db.model.Zone)1 DeployDestination (com.cloud.deploy.DeployDestination)1 AggregationControlCommand (com.cloud.legacymodel.communication.command.AggregationControlCommand)1 Command (com.cloud.legacymodel.communication.command.Command)1 NetworkUsageCommand (com.cloud.legacymodel.communication.command.NetworkUsageCommand)1 PlugNicCommand (com.cloud.legacymodel.communication.command.PlugNicCommand)1 UpdateNetworkOverviewCommand (com.cloud.legacymodel.communication.command.UpdateNetworkOverviewCommand)1 CloudRuntimeException (com.cloud.legacymodel.exceptions.CloudRuntimeException)1 ConcurrentOperationException (com.cloud.legacymodel.exceptions.ConcurrentOperationException)1 ResourceUnavailableException (com.cloud.legacymodel.exceptions.ResourceUnavailableException)1 Ip (com.cloud.legacymodel.network.Ip)1 Network (com.cloud.legacymodel.network.Network)1 Provider (com.cloud.legacymodel.network.Network.Provider)1 Nic (com.cloud.legacymodel.network.Nic)1