Search in sources :

Example 6 with UpdateVmOverviewCommand

use of com.cloud.agent.api.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.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 UpdateVmOverviewCommand

use of com.cloud.agent.api.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.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

UpdateVmOverviewCommand (com.cloud.agent.api.UpdateVmOverviewCommand)7 VMOverviewTO (com.cloud.agent.api.to.overviews.VMOverviewTO)6 Commands (com.cloud.agent.manager.Commands)5 VirtualRouter (com.cloud.network.router.VirtualRouter)5 NicVO (com.cloud.vm.NicVO)3 VirtualMachineProfile (com.cloud.vm.VirtualMachineProfile)3 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 Network (com.cloud.network.Network)1 Provider (com.cloud.network.Network.Provider)1 VirtualRouterProvider (com.cloud.network.VirtualRouterProvider)1 PublicIp (com.cloud.network.addr.PublicIp)1