mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
CLOUDSTACK-6205: VPC VR start - skip private gateway when create Guest nics as the nic for the private gateway is being created separately
Conflicts: server/src/com/cloud/network/NetworkModelImpl.java server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
This commit is contained in:
parent
3aee404a49
commit
d9e1c9c502
@ -199,10 +199,10 @@ public interface NetworkModel {
|
||||
List<? extends PhysicalNetwork> getPhysicalNtwksSupportingTrafficType(long zoneId, TrafficType trafficType);
|
||||
|
||||
/**
|
||||
* @param guestNic
|
||||
* @param ntwkId
|
||||
* @return
|
||||
*/
|
||||
boolean isPrivateGateway(Nic guestNic);
|
||||
boolean isPrivateGateway(long ntwkId);
|
||||
|
||||
Map<Service, Map<Capability, String>> getNetworkCapabilities(long networkId);
|
||||
|
||||
|
||||
@ -1671,8 +1671,8 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPrivateGateway(Nic guestNic) {
|
||||
Network network = getNetwork(guestNic.getNetworkId());
|
||||
public boolean isPrivateGateway(long ntwkId) {
|
||||
Network network = getNetwork(ntwkId);
|
||||
if (network.getTrafficType() != TrafficType.Guest || network.getNetworkOfferingId() != s_privateOfferingId.longValue()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -782,8 +782,7 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
|
||||
//plug guest nic
|
||||
PlugNicCommand plugNicCmd = new PlugNicCommand(getNicTO(router, guestNic.getNetworkId(), null), router.getInstanceName(), router.getType());
|
||||
cmds.addCommand(plugNicCmd);
|
||||
|
||||
if (!_networkModel.isPrivateGateway(guestNic)) {
|
||||
if (!_networkModel.isPrivateGateway(guestNic.getNetworkId())) {
|
||||
//set guest network
|
||||
VirtualMachine vm = _vmDao.findById(router.getId());
|
||||
NicProfile nicProfile = _networkModel.getNicProfile(vm, guestNic.getNetworkId(), null);
|
||||
@ -1210,6 +1209,9 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
|
||||
//3) allocate nic for guest gateway if needed
|
||||
List<? extends Network> guestNetworks = _vpcMgr.getVpcNetworks(vpcId);
|
||||
for (Network guestNetwork : guestNetworks) {
|
||||
if (_networkModel.isPrivateGateway(guestNetwork.getId())) {
|
||||
continue;
|
||||
}
|
||||
if (guestNetwork.getState() == Network.State.Implemented || guestNetwork.getState() == Network.State.Setup) {
|
||||
NicProfile guestNic = createGuestNicProfileForVpcRouter(guestNetwork);
|
||||
networks.put(guestNetwork, new ArrayList<NicProfile>(Arrays.asList(guestNic)));
|
||||
|
||||
@ -591,7 +591,7 @@ public class MockNetworkModelImpl extends ManagerBase implements NetworkModel {
|
||||
* @see com.cloud.network.NetworkModel#isPrivateGateway(com.cloud.vm.Nic)
|
||||
*/
|
||||
@Override
|
||||
public boolean isPrivateGateway(Nic guestNic) {
|
||||
public boolean isPrivateGateway(long ntwkId) {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -607,7 +607,7 @@ public class MockNetworkModelImpl extends ManagerBase implements NetworkModel {
|
||||
* @see com.cloud.network.NetworkModel#isPrivateGateway(com.cloud.vm.Nic)
|
||||
*/
|
||||
@Override
|
||||
public boolean isPrivateGateway(Nic guestNic) {
|
||||
public boolean isPrivateGateway(long ntwkId) {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user