VPC: CS-15486 - prepare public nic as a part of VR deployment

This commit is contained in:
Alena Prokharchyk 2012-07-06 18:14:37 -07:00
parent 8404dba5e0
commit 10dcc117c3
3 changed files with 6 additions and 16 deletions

View File

@ -1282,7 +1282,7 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
int count = routerCount - routers.size();
for (int i = 0; i < count; i++) {
DomainRouterVO router = deployRouter(owner, dest, plan, params, isRedundant, vrProvider, offeringId,
null, sourceNatIp, publicNetwork, guestNetwork, new Pair<Boolean, PublicIp>(publicNetwork, sourceNatIp));
null, publicNetwork, guestNetwork, new Pair<Boolean, PublicIp>(publicNetwork, sourceNatIp));
//add router to router network map
if (!_routerDao.isRouterPartOfGuestNetwork(router.getId(), network.getId())) {
DomainRouterVO routerVO = _routerDao.findById(router.getId());
@ -1300,7 +1300,7 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
protected DomainRouterVO deployRouter(Account owner, DeployDestination dest, DeploymentPlan plan, Map<Param, Object> params,
boolean isRedundant, VirtualRouterProvider vrProvider, long svcOffId,
Long vpcId, PublicIp sourceNatIp, boolean setupPublicNetwork, Network guestNetwork, Pair<Boolean, PublicIp> publicNetwork) throws ConcurrentOperationException,
Long vpcId, boolean setupPublicNetwork, Network guestNetwork, Pair<Boolean, PublicIp> publicNetwork) throws ConcurrentOperationException,
InsufficientAddressCapacityException, InsufficientServerCapacityException, InsufficientCapacityException,
StorageUnavailableException, ResourceUnavailableException {

View File

@ -391,20 +391,10 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
InsufficientAddressCapacityException, InsufficientServerCapacityException, InsufficientCapacityException,
StorageUnavailableException, ResourceUnavailableException {
DomainRouterVO router =
super.deployRouter(owner, dest, plan, params, isRedundant, vrProvider, svcOffId, vpcId, sourceNatIp,
false, null, null);
//Plug public nic
if (router != null && sourceNatIp != null) {
Network publicNetwork = _networkDao.listByZoneAndTrafficType(dest.getDataCenter().getId(), TrafficType.Public).get(0);
if (!addPublicIpToVpc(router, publicNetwork, sourceNatIp)) {
s_logger.warn("Failed to add router " + router + " to public network in zone " + dest.getDataCenter() + " cleaninig up");
destroyRouter(router.getId());
return null;
}
}
super.deployRouter(owner, dest, plan, params, isRedundant, vrProvider, svcOffId, vpcId, false,
null, new Pair<Boolean, PublicIp>(true, sourceNatIp));
return router;
}

View File

@ -1094,7 +1094,7 @@ public class MockNetworkManagerImpl implements NetworkManager, Manager, NetworkS
* @see com.cloud.network.NetworkManager#isPrivateGateway(com.cloud.vm.Nic)
*/
@Override
public boolean isPrivateGateway(Nic guestNic) {
public boolean isPrivateGateway(long nicId) {
// TODO Auto-generated method stub
return false;
}