mirror of
				https://github.com/apache/cloudstack.git
				synced 2025-10-26 08:42:29 +01:00 
			
		
		
		
	NaaS: Remove Redundant Virtual Router element
Would use capability instead.
This commit is contained in:
		
							parent
							
								
									d6d878c250
								
							
						
					
					
						commit
						bc86800d30
					
				| @ -1,128 +0,0 @@ | ||||
| /** | ||||
|  *  Copyright (C) 2011 Citrix Systems, Inc.  All rights reserved. | ||||
|  *  | ||||
|  * This software is licensed under the GNU General Public License v3 or later. | ||||
|  *  | ||||
|  * It is free software: you can redistribute it and/or modify | ||||
|  * it under the terms of the GNU General Public License as published by | ||||
|  * the Free Software Foundation, either version 3 of the License, or any later version. | ||||
|  * This program is distributed in the hope that it will be useful, | ||||
|  * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
|  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | ||||
|  * GNU General Public License for more details. | ||||
|  *  | ||||
|  * You should have received a copy of the GNU General Public License | ||||
|  * along with this program.  If not, see <http://www.gnu.org/licenses/>. | ||||
|  *  | ||||
|  */ | ||||
| 
 | ||||
| package com.cloud.api.commands; | ||||
| 
 | ||||
| import org.apache.log4j.Logger; | ||||
| 
 | ||||
| import com.cloud.api.ApiConstants; | ||||
| import com.cloud.api.BaseAsyncCmd; | ||||
| import com.cloud.api.BaseCmd; | ||||
| import com.cloud.api.Implementation; | ||||
| import com.cloud.api.Parameter; | ||||
| import com.cloud.api.PlugService; | ||||
| import com.cloud.api.ServerApiException; | ||||
| import com.cloud.api.response.SuccessResponse; | ||||
| import com.cloud.network.element.RedundantVirtualRouterElementService; | ||||
| import com.cloud.async.AsyncJob; | ||||
| import com.cloud.event.EventTypes; | ||||
| import com.cloud.exception.ConcurrentOperationException; | ||||
| import com.cloud.exception.InsufficientCapacityException; | ||||
| import com.cloud.exception.ResourceUnavailableException; | ||||
| import com.cloud.user.Account; | ||||
| import com.cloud.user.UserContext; | ||||
| 
 | ||||
| @Implementation(responseObject=SuccessResponse.class, description="Configures a redundant virtual router element.") | ||||
| public class ConfigureRedundantVirtualRouterElementCmd extends BaseAsyncCmd { | ||||
| 	public static final Logger s_logger = Logger.getLogger(ConfigureRedundantVirtualRouterElementCmd.class.getName()); | ||||
|     private static final String s_name = "configureredundantvirtualrouterelementresponse"; | ||||
|      | ||||
|     @PlugService | ||||
|     private RedundantVirtualRouterElementService _service; | ||||
| 
 | ||||
|     ///////////////////////////////////////////////////// | ||||
|     //////////////// API parameters ///////////////////// | ||||
|     ///////////////////////////////////////////////////// | ||||
| 
 | ||||
|     @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the network service provider ID of the virtual router element") | ||||
|     private Long nspId; | ||||
| 
 | ||||
|     @Parameter(name=ApiConstants.ENABLED, type=CommandType.BOOLEAN, required=true, description="Enabled/Disabled the service provider") | ||||
|     private Boolean enabled; | ||||
|      | ||||
|     ///////////////////////////////////////////////////// | ||||
|     /////////////////// Accessors /////////////////////// | ||||
|     ///////////////////////////////////////////////////// | ||||
| 
 | ||||
|     public void setNspId(Long nspId) { | ||||
|         this.nspId = nspId; | ||||
|     } | ||||
| 
 | ||||
|     public Long getNspId() { | ||||
|         return nspId; | ||||
|     } | ||||
| 
 | ||||
|     public void setEnabled(Boolean enabled) { | ||||
|         this.enabled = enabled; | ||||
|     } | ||||
| 
 | ||||
|     public Boolean getEnabled() { | ||||
|         return enabled; | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     ///////////////////////////////////////////////////// | ||||
|     /////////////// API Implementation/////////////////// | ||||
|     ///////////////////////////////////////////////////// | ||||
| 
 | ||||
|     @Override | ||||
|     public String getCommandName() { | ||||
|         return s_name; | ||||
|     } | ||||
|      | ||||
|     public static String getResultObjectName() { | ||||
|     	return "boolean"; | ||||
|     } | ||||
|      | ||||
|     @Override | ||||
|     public long getEntityOwnerId() { | ||||
|         return Account.ACCOUNT_ID_SYSTEM; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public String getEventType() { | ||||
|         return EventTypes.EVENT_NETWORK_ELEMENT_CONFIGURE; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public String getEventDescription() { | ||||
|         return  "configuring redundant virtual router element: " + _service.getIdByNspId(nspId); | ||||
|     } | ||||
|      | ||||
|     public AsyncJob.Type getInstanceType() { | ||||
|     	return AsyncJob.Type.None; | ||||
|     } | ||||
|      | ||||
|     public Long getInstanceId() { | ||||
|         return _service.getIdByNspId(getNspId()); | ||||
|     } | ||||
| 	 | ||||
|     @Override | ||||
|     public void execute() throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException{ | ||||
|         UserContext.current().setEventDetails("Redundant virtual router element: " + _service.getIdByNspId(nspId)); | ||||
|         Boolean result = _service.configure(this); | ||||
|         if (result){ | ||||
|             SuccessResponse response = new SuccessResponse(); | ||||
|             response.setResponseName(getCommandName()); | ||||
|             response.setSuccess(result); | ||||
|             this.setResponseObject(response); | ||||
|         } else { | ||||
|             throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to configure the redundant virtual router element"); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @ -1,112 +0,0 @@ | ||||
| /** | ||||
|  *  Copyright (C) 2011 Citrix Systems, Inc.  All rights reserved. | ||||
|  *  | ||||
|  * This software is licensed under the GNU General Public License v3 or later. | ||||
|  *  | ||||
|  * It is free software: you can redistribute it and/or modify | ||||
|  * it under the terms of the GNU General Public License as published by | ||||
|  * the Free Software Foundation, either version 3 of the License, or any later version. | ||||
|  * This program is distributed in the hope that it will be useful, | ||||
|  * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
|  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | ||||
|  * GNU General Public License for more details. | ||||
|  *  | ||||
|  * You should have received a copy of the GNU General Public License | ||||
|  * along with this program.  If not, see <http://www.gnu.org/licenses/>. | ||||
|  *  | ||||
|  */ | ||||
| 
 | ||||
| package com.cloud.api.commands; | ||||
| 
 | ||||
| import org.apache.log4j.Logger; | ||||
| 
 | ||||
| import com.cloud.api.ApiConstants; | ||||
| import com.cloud.api.BaseAsyncCreateCmd; | ||||
| import com.cloud.api.BaseCmd; | ||||
| import com.cloud.api.Implementation; | ||||
| import com.cloud.api.Parameter; | ||||
| import com.cloud.api.PlugService; | ||||
| import com.cloud.api.ServerApiException; | ||||
| import com.cloud.api.response.SuccessResponse; | ||||
| import com.cloud.network.VirtualRouterProvider; | ||||
| import com.cloud.network.element.RedundantVirtualRouterElementService; | ||||
| import com.cloud.event.EventTypes; | ||||
| import com.cloud.exception.ResourceAllocationException; | ||||
| import com.cloud.user.Account; | ||||
| import com.cloud.user.UserContext; | ||||
| 
 | ||||
| @Implementation(responseObject=SuccessResponse.class, description="Create a redundant virtual router element.") | ||||
| public class CreateRedundantVirtualRouterElementCmd extends BaseAsyncCreateCmd { | ||||
| 	public static final Logger s_logger = Logger.getLogger(CreateVirtualRouterElementCmd.class.getName()); | ||||
|     private static final String s_name = "createredundantvirtualrouterelementresponse"; | ||||
|      | ||||
|     @PlugService | ||||
|     private RedundantVirtualRouterElementService _service; | ||||
| 
 | ||||
|     ///////////////////////////////////////////////////// | ||||
|     //////////////// API parameters ///////////////////// | ||||
|     ///////////////////////////////////////////////////// | ||||
| 
 | ||||
|     @Parameter(name=ApiConstants.NETWORK_SERVICE_PROVIDER_ID, type=CommandType.LONG, required=true, description="the network service provider ID of the redundant virtual router element") | ||||
|     private Long nspId; | ||||
| 
 | ||||
|     ///////////////////////////////////////////////////// | ||||
|     /////////////////// Accessors /////////////////////// | ||||
|     ///////////////////////////////////////////////////// | ||||
| 
 | ||||
|     public void setNspId(Long nspId) { | ||||
|         this.nspId = nspId; | ||||
|     } | ||||
| 
 | ||||
|     public Long getNspId() { | ||||
|         return nspId; | ||||
|     } | ||||
|      | ||||
|     ///////////////////////////////////////////////////// | ||||
|     /////////////// API Implementation/////////////////// | ||||
|     ///////////////////////////////////////////////////// | ||||
| 
 | ||||
|     @Override | ||||
|     public String getCommandName() { | ||||
|         return s_name; | ||||
|     } | ||||
|      | ||||
|     @Override | ||||
|     public long getEntityOwnerId() { | ||||
|         return Account.ACCOUNT_ID_SYSTEM; | ||||
|     } | ||||
|      | ||||
|     @Override | ||||
|     public void execute(){ | ||||
|         UserContext.current().setEventDetails("Redundant Virtual Router Element Id: "+getEntityId()); | ||||
|         VirtualRouterProvider result = _service.getCreatedElement(getEntityId()); | ||||
|         if (result != null) { | ||||
|             SuccessResponse response = new SuccessResponse(); | ||||
|             response.setResponseName(getCommandName()); | ||||
|             response.setSuccess(true); | ||||
|             this.setResponseObject(response); | ||||
|         }else { | ||||
|             throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to add Virtual Router entity to physical network"); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public void create() throws ResourceAllocationException { | ||||
|         VirtualRouterProvider result = _service.addElement(getNspId()); | ||||
|         if (result != null) { | ||||
|             setEntityId(result.getId()); | ||||
|         } else { | ||||
|             throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to add Virtual Router entity to physical network"); | ||||
|         }         | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public String getEventType() { | ||||
|         return EventTypes.EVENT_SERVICE_PROVIDER_CREATE; | ||||
|     } | ||||
|      | ||||
|     @Override | ||||
|     public String getEventDescription() { | ||||
|         return  "Adding physical network ServiceProvider redundant virtual router: " + getEntityId(); | ||||
|     } | ||||
| } | ||||
| @ -1,7 +0,0 @@ | ||||
| package com.cloud.network.element; | ||||
| 
 | ||||
| import com.cloud.api.commands.ConfigureRedundantVirtualRouterElementCmd; | ||||
| 
 | ||||
| public interface RedundantVirtualRouterElementService extends VirtualRouterElementService { | ||||
|     boolean configure(ConfigureRedundantVirtualRouterElementCmd cmd); | ||||
| } | ||||
| @ -24,7 +24,6 @@ | ||||
|         	<adapter name="NetscalerExternalLoadBalancer" class="com.cloud.network.element.NetscalerExternalLoadBalancerElement"/> | ||||
|         	<adapter name="F5ExternalLoadBalancer" class="com.cloud.network.element.F5ExternalLoadBalancerElement"/> | ||||
|             <adapter name="DomainRouter" class="com.cloud.network.element.VirtualRouterElement"/> | ||||
|             <adapter name="RedundantVirtualRouter" class="com.cloud.network.element.RedundantVirtualRouterElement"/> | ||||
|             <adapter name="Ovs" class="com.cloud.network.element.OvsElement"/> | ||||
|             <adapter name="ExternalDhcp" class="com.cloud.network.element.ExternalDhcpElement"/> | ||||
|             <adapter name="BareMetal" class="com.cloud.network.element.BareMetalElement"/> | ||||
|  | ||||
| @ -107,7 +107,6 @@ | ||||
|         </adapters> | ||||
| 
 | ||||
|         <pluggableservice name="VirtualRouterElementService" key="com.cloud.network.element.VirtualRouterElementService" class="com.cloud.network.element.VirtualRouterElement"/> | ||||
|         <pluggableservice name="RedundantVirtualRouterElementService" key="com.cloud.network.element.RedundantVirtualRouterElementService" class="com.cloud.network.element.RedundantVirtualRouterElement"/> | ||||
|     </management-server> | ||||
| 
 | ||||
|     <configuration-server class="com.cloud.server.ConfigurationServerImpl"> | ||||
|  | ||||
| @ -3,6 +3,4 @@ | ||||
| 
 | ||||
| #### router commands | ||||
| createVirtualRouterElement=com.cloud.api.commands.CreateVirtualRouterElementCmd;7 | ||||
| createRedundantVirtualRouterElement=com.cloud.api.commands.CreateRedundantVirtualRouterElementCmd;7 | ||||
| configureVirtualRouterElement=com.cloud.api.commands.ConfigureVirtualRouterElementCmd;7 | ||||
| configureRedundantVirtualRouterElement=com.cloud.api.commands.ConfigureRedundantVirtualRouterElementCmd;7 | ||||
|  | ||||
| @ -90,8 +90,6 @@ import com.cloud.network.dao.PhysicalNetworkTrafficTypeDaoImpl; | ||||
| import com.cloud.network.dao.RemoteAccessVpnDaoImpl; | ||||
| import com.cloud.network.dao.VirtualRouterProviderDaoImpl; | ||||
| import com.cloud.network.dao.VpnUserDaoImpl; | ||||
| import com.cloud.network.element.RedundantVirtualRouterElement; | ||||
| import com.cloud.network.element.RedundantVirtualRouterElementService; | ||||
| import com.cloud.network.element.VirtualRouterElement; | ||||
| import com.cloud.network.element.VirtualRouterElementService; | ||||
| import com.cloud.network.firewall.FirewallManagerImpl; | ||||
| @ -391,7 +389,6 @@ public class DefaultComponentLibrary extends ComponentLibraryBase implements Com | ||||
|      | ||||
|     protected void populateServices() { | ||||
|         addService("VirtualRouterElementService", VirtualRouterElementService.class, VirtualRouterElement.class); | ||||
|         addService("RedundantVirtualRouterElementService", RedundantVirtualRouterElementService.class, RedundantVirtualRouterElement.class); | ||||
|     } | ||||
|      | ||||
|     @Override | ||||
|  | ||||
| @ -1,149 +0,0 @@ | ||||
| package com.cloud.network.element; | ||||
| 
 | ||||
| import java.util.HashMap; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| 
 | ||||
| import javax.ejb.Local; | ||||
| 
 | ||||
| import org.apache.log4j.Logger; | ||||
| 
 | ||||
| import com.cloud.api.commands.ConfigureRedundantVirtualRouterElementCmd; | ||||
| import com.cloud.deploy.DeployDestination; | ||||
| import com.cloud.exception.ConcurrentOperationException; | ||||
| import com.cloud.exception.InsufficientCapacityException; | ||||
| import com.cloud.exception.ResourceUnavailableException; | ||||
| import com.cloud.network.Network; | ||||
| import com.cloud.network.Network.Provider; | ||||
| import com.cloud.network.Network.Service; | ||||
| import com.cloud.network.NetworkManager; | ||||
| import com.cloud.network.PhysicalNetworkServiceProvider; | ||||
| import com.cloud.network.VirtualRouterProvider; | ||||
| import com.cloud.network.VirtualRouterProvider.VirtualRouterProviderType; | ||||
| import com.cloud.network.dao.VirtualRouterProviderDao; | ||||
| import com.cloud.network.router.VirtualRouter; | ||||
| import com.cloud.offering.NetworkOffering; | ||||
| import com.cloud.offerings.NetworkOfferingVO; | ||||
| import com.cloud.uservm.UserVm; | ||||
| import com.cloud.utils.component.Inject; | ||||
| import com.cloud.vm.DomainRouterVO; | ||||
| import com.cloud.vm.NicProfile; | ||||
| import com.cloud.vm.ReservationContext; | ||||
| import com.cloud.vm.VirtualMachine; | ||||
| import com.cloud.vm.VirtualMachineProfile; | ||||
| 
 | ||||
| @Local(value=NetworkElement.class) | ||||
| public class RedundantVirtualRouterElement extends VirtualRouterElement implements RedundantVirtualRouterElementService { | ||||
|     private static final Logger s_logger = Logger.getLogger(RedundantVirtualRouterElement.class); | ||||
|      | ||||
|     @Inject NetworkManager _networkMgr; | ||||
|     @Inject VirtualRouterProviderDao _vrElementsDao; | ||||
|      | ||||
|     @Override | ||||
|     public Provider getProvider() { | ||||
|         return Provider.RedundantVirtualRouter; | ||||
|     } | ||||
|      | ||||
|     @Override | ||||
|     public boolean implement(Network network, NetworkOffering offering, DeployDestination dest, ReservationContext context) throws ResourceUnavailableException, ConcurrentOperationException, InsufficientCapacityException { | ||||
|         if (offering.isSystemOnly()) { | ||||
|             return false; | ||||
|         } | ||||
|         if (!_networkMgr.isProviderAvailable(_networkMgr.getPhysicalNetworkId(network), "RedundantVirtualRouter")) { | ||||
|             return false; | ||||
|         } | ||||
|          | ||||
|         Map<VirtualMachineProfile.Param, Object> params = new HashMap<VirtualMachineProfile.Param, Object>(1); | ||||
|         params.put(VirtualMachineProfile.Param.ReProgramNetwork, true); | ||||
| 
 | ||||
|         _routerMgr.deployVirtualRouter(network, dest, _accountMgr.getAccount(network.getAccountId()), params, getProvider()); | ||||
| 
 | ||||
|         return true; | ||||
|     } | ||||
|      | ||||
|      | ||||
|     @Override | ||||
|     public boolean prepare(Network network, NicProfile nic, VirtualMachineProfile<? extends VirtualMachine> vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException { | ||||
|         NetworkOfferingVO offering = _networkOfferingDao.findById(network.getNetworkOfferingId()); | ||||
|         if (offering.isSystemOnly()) { | ||||
|             return false; | ||||
|         } | ||||
|         if (!_networkMgr.isProviderAvailable(_networkMgr.getPhysicalNetworkId(network), "RedundantVirtualRouter")) { | ||||
|             return false; | ||||
|         } | ||||
|          | ||||
|         if (vm.getType() != VirtualMachine.Type.User) { | ||||
|             return false; | ||||
|         } | ||||
| 
 | ||||
|         @SuppressWarnings("unchecked") | ||||
|         VirtualMachineProfile<UserVm> uservm = (VirtualMachineProfile<UserVm>)vm; | ||||
|         List<DomainRouterVO> routers = _routerMgr.deployVirtualRouter(network, dest, _accountMgr.getAccount(network.getAccountId()), uservm.getParameters(), getProvider()); | ||||
|         if ((routers == null) || (routers.size() == 0)) { | ||||
|             throw new ResourceUnavailableException("Can't find at least one running router!", this.getClass(), 0); | ||||
|         } | ||||
|         return true; | ||||
|     } | ||||
|      | ||||
|     @Override | ||||
|     public String getPropertiesFile() { | ||||
|         return "virtualrouter_commands.properties"; | ||||
|     } | ||||
|      | ||||
|     @Override | ||||
|     public boolean configure(ConfigureRedundantVirtualRouterElementCmd cmd) { | ||||
|         VirtualRouterProviderVO element = _vrElementsDao.findByNspIdAndType(cmd.getNspId(), VirtualRouterProviderType.RedundantVirtualRouter); | ||||
|         if (element == null) { | ||||
|             s_logger.trace("Can't find element with UUID " + cmd.getNspId()); | ||||
|             return false; | ||||
|         } | ||||
|         element.setEnabled(cmd.getEnabled()); | ||||
|         _vrElementsDao.persist(element); | ||||
|          | ||||
|         return true; | ||||
|     } | ||||
|      | ||||
|     @Override | ||||
|     public VirtualRouterProvider addElement(Long nspId) { | ||||
|         VirtualRouterProviderVO element = _vrElementsDao.findByNspIdAndType(nspId, VirtualRouterProviderType.RedundantVirtualRouter); | ||||
|         if (element != null) { | ||||
|             s_logger.trace("There is already a redundant virtual router element with service provider id " + nspId); | ||||
|             return null; | ||||
|         } | ||||
|         element = new VirtualRouterProviderVO(nspId, null, VirtualRouterProviderType.RedundantVirtualRouter); | ||||
|         _vrElementsDao.persist(element); | ||||
|         return element; | ||||
|     } | ||||
|      | ||||
|     @Override | ||||
|     public boolean isReady(PhysicalNetworkServiceProvider provider) { | ||||
|         VirtualRouterProviderVO element = _vrProviderDao.findByNspIdAndType(provider.getId(), VirtualRouterProviderType.RedundantVirtualRouter); | ||||
|         if (element == null) { | ||||
|             return false; | ||||
|         } | ||||
|         return element.isEnabled(); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public Long getIdByNspId(Long nspId) { | ||||
|         VirtualRouterProviderVO vr = _vrElementsDao.findByNspIdAndType(nspId, VirtualRouterProviderType.RedundantVirtualRouter); | ||||
|         return vr.getId(); | ||||
|     } | ||||
|      | ||||
|     @Override | ||||
|     public boolean shutdownProviderInstances(PhysicalNetworkServiceProvider provider, ReservationContext context) throws ConcurrentOperationException, | ||||
|             ResourceUnavailableException { | ||||
|         VirtualRouterProviderVO element = _vrProviderDao.findByNspIdAndType(provider.getId(), VirtualRouterProviderType.RedundantVirtualRouter); | ||||
|         if (element == null) { | ||||
|             return true; | ||||
|         } | ||||
|         //Find domain routers | ||||
|         long elementId = element.getId(); | ||||
|         List<DomainRouterVO> routers = _routerDao.listByElementId(elementId); | ||||
|         boolean result = true; | ||||
|         for (DomainRouterVO router : routers) { | ||||
|             result = result && (_routerMgr.destroyRouter(router.getId()) != null); | ||||
|         } | ||||
|         return result; | ||||
|     } | ||||
| } | ||||
| @ -125,7 +125,7 @@ public class VirtualRouterElement extends AdapterBase implements VirtualRouterEl | ||||
|         Map<VirtualMachineProfile.Param, Object> params = new HashMap<VirtualMachineProfile.Param, Object>(1); | ||||
|         params.put(VirtualMachineProfile.Param.ReProgramNetwork, true); | ||||
| 
 | ||||
|         _routerMgr.deployVirtualRouter(network, dest, _accountMgr.getAccount(network.getAccountId()), params, getProvider()); | ||||
|         _routerMgr.deployVirtualRouter(network, dest, _accountMgr.getAccount(network.getAccountId()), params, false); | ||||
| 
 | ||||
|         return true; | ||||
|     } | ||||
| @ -147,7 +147,7 @@ public class VirtualRouterElement extends AdapterBase implements VirtualRouterEl | ||||
| 
 | ||||
|         @SuppressWarnings("unchecked") | ||||
|         VirtualMachineProfile<UserVm> uservm = (VirtualMachineProfile<UserVm>)vm; | ||||
|         List<DomainRouterVO> routers = _routerMgr.deployVirtualRouter(network, dest, _accountMgr.getAccount(network.getAccountId()), uservm.getParameters(), getProvider()); | ||||
|         List<DomainRouterVO> routers = _routerMgr.deployVirtualRouter(network, dest, _accountMgr.getAccount(network.getAccountId()), uservm.getParameters(), false); | ||||
|         if ((routers == null) || (routers.size() == 0)) { | ||||
|             throw new ResourceUnavailableException("Can't find at least one running router!", this.getClass(), 0); | ||||
|         } | ||||
|  | ||||
| @ -69,7 +69,7 @@ public interface VirtualNetworkApplianceManager extends Manager, VirtualNetworkA | ||||
|      | ||||
|     List<DomainRouterVO> getRouters(long accountId, long zoneId); | ||||
| 	 | ||||
| 	List<DomainRouterVO> deployVirtualRouter(Network guestNetwork, DeployDestination dest, Account owner, Map<VirtualMachineProfile.Param, Object> params, Provider provider) throws InsufficientCapacityException, ResourceUnavailableException, ConcurrentOperationException; | ||||
| 	List<DomainRouterVO> deployVirtualRouter(Network guestNetwork, DeployDestination dest, Account owner, Map<VirtualMachineProfile.Param, Object> params, boolean isRedundant) throws InsufficientCapacityException, ResourceUnavailableException, ConcurrentOperationException; | ||||
| 	 | ||||
| 	List<VirtualRouter> applyDhcpEntry(Network config, NicProfile nic, VirtualMachineProfile<UserVm> vm, DeployDestination dest, ReservationContext context, List<DomainRouterVO> routers) throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException; | ||||
| 	List<VirtualRouter> applyUserData(Network config, NicProfile nic, VirtualMachineProfile<UserVm> vm, DeployDestination dest, ReservationContext context, List<DomainRouterVO> routers) throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException; | ||||
|  | ||||
| @ -1275,7 +1275,7 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian | ||||
|     } | ||||
|      | ||||
|     @Override | ||||
|     public List<DomainRouterVO> deployVirtualRouter(Network guestNetwork, DeployDestination dest, Account owner, Map<Param, Object> params, Provider provider) throws InsufficientCapacityException, | ||||
|     public List<DomainRouterVO> deployVirtualRouter(Network guestNetwork, DeployDestination dest, Account owner, Map<Param, Object> params, boolean isRedundant) throws InsufficientCapacityException, | ||||
|             ConcurrentOperationException, ResourceUnavailableException { | ||||
|         if (_networkMgr.isNetworkSystem(guestNetwork) || guestNetwork.getGuestType() == Network.GuestType.Shared) { | ||||
|             owner = _accountMgr.getAccount(Account.ACCOUNT_ID_SYSTEM); | ||||
| @ -1289,7 +1289,7 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian | ||||
|                 + guestNetwork; | ||||
|         assert guestNetwork.getTrafficType() == TrafficType.Guest; | ||||
| 
 | ||||
|         List<DomainRouterVO> routers = findOrCreateVirtualRouters(guestNetwork, dest, owner, provider == Provider.RedundantVirtualRouter); | ||||
|         List<DomainRouterVO> routers = findOrCreateVirtualRouters(guestNetwork, dest, owner, isRedundant); | ||||
|         List<DomainRouterVO> runningRouters = null; | ||||
|          | ||||
|         if (routers != null) { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user