Search in sources :

Example 6 with VMOverviewTO

use of com.cloud.agent.api.to.overviews.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.agent.api.to.overviews.VMOverviewTO) Commands(com.cloud.agent.manager.Commands) VirtualRouter(com.cloud.network.router.VirtualRouter) UpdateVmOverviewCommand(com.cloud.agent.api.UpdateVmOverviewCommand)

Example 7 with VMOverviewTO

use of com.cloud.agent.api.to.overviews.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.agent.api.to.overviews.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.network.router.VirtualRouter) UpdateVmOverviewCommand(com.cloud.agent.api.UpdateVmOverviewCommand)

Aggregations

VMOverviewTO (com.cloud.agent.api.to.overviews.VMOverviewTO)7 UpdateVmOverviewCommand (com.cloud.agent.api.UpdateVmOverviewCommand)6 Commands (com.cloud.agent.manager.Commands)5 VirtualRouter (com.cloud.network.router.VirtualRouter)5 NicVO (com.cloud.vm.NicVO)4 VirtualMachineProfile (com.cloud.vm.VirtualMachineProfile)3 Network (com.cloud.network.Network)2 ArrayList (java.util.ArrayList)2 Command (com.cloud.agent.api.Command)1 NetworkUsageCommand (com.cloud.agent.api.NetworkUsageCommand)1 PlugNicCommand (com.cloud.agent.api.PlugNicCommand)1 UpdateNetworkOverviewCommand (com.cloud.agent.api.UpdateNetworkOverviewCommand)1 AggregationControlCommand (com.cloud.agent.api.routing.AggregationControlCommand)1 NetworkOverviewTO (com.cloud.agent.api.to.overviews.NetworkOverviewTO)1 Zone (com.cloud.db.model.Zone)1 DeployDestination (com.cloud.deploy.DeployDestination)1 ConcurrentOperationException (com.cloud.exception.ConcurrentOperationException)1 ResourceUnavailableException (com.cloud.exception.ResourceUnavailableException)1 Provider (com.cloud.network.Network.Provider)1 VirtualRouterProvider (com.cloud.network.VirtualRouterProvider)1