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 94e26a00f4
commit 98f8e70ca9
3 changed files with 7 additions and 17 deletions

View File

@ -1258,7 +1258,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());
@ -1276,7 +1276,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 {
@ -1386,7 +1386,7 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
boolean setupPublicNetwork = false;
if (publicNetwork != null) {
setupPublicNetwork = publicNetwork.first();
}
}
//Form networks
List<Pair<NetworkVO, NicProfile>> networks = new ArrayList<Pair<NetworkVO, NicProfile>>(3);

View File

@ -396,20 +396,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

@ -1063,7 +1063,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;
}