mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-6205: VPC VR start - skip private gateway when create Guest nics as the nic for the private gateway is being created separately
This commit is contained in:
parent
15bf144f1a
commit
94817c1b4b
|
|
@ -201,10 +201,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);
|
||||
|
||||
|
|
|
|||
|
|
@ -1656,8 +1656,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() != _privateOfferingId.longValue()) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -805,7 +805,7 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
|
|||
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);
|
||||
|
|
@ -1237,6 +1237,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)));
|
||||
|
|
|
|||
|
|
@ -596,7 +596,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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -610,7 +610,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…
Reference in New Issue