Search in sources :

Example 6 with VMOverviewTO

use of com.cloud.legacymodel.to.VMOverviewTO 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 VMOverviewTO

use of com.cloud.legacymodel.to.VMOverviewTO 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

VMOverviewTO (com.cloud.legacymodel.to.VMOverviewTO)7 UpdateVmOverviewCommand (com.cloud.legacymodel.communication.command.UpdateVmOverviewCommand)6 Commands (com.cloud.agent.manager.Commands)5 VirtualRouter (com.cloud.legacymodel.network.VirtualRouter)5 NicVO (com.cloud.vm.NicVO)4 VirtualMachineProfile (com.cloud.vm.VirtualMachineProfile)3 Network (com.cloud.legacymodel.network.Network)2 ArrayList (java.util.ArrayList)2 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 Provider (com.cloud.legacymodel.network.Network.Provider)1