cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alena1...@apache.org
Subject git commit: updated refs/heads/4.3-forward to 94817c1
Date Fri, 14 Mar 2014 18:51:48 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.3-forward 15bf144f1 -> 94817c1b4


CLOUDSTACK-6205: VPC VR start - skip private gateway when create Guest nics as the nic for
the private gateway is being created separately


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/94817c1b
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/94817c1b
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/94817c1b

Branch: refs/heads/4.3-forward
Commit: 94817c1b4b89cfa69f2db50a7060dcb7d7c39dbb
Parents: 15bf144
Author: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Authored: Fri Mar 14 11:43:40 2014 -0700
Committer: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Committed: Fri Mar 14 11:43:40 2014 -0700

----------------------------------------------------------------------
 api/src/com/cloud/network/NetworkModel.java                     | 4 ++--
 server/src/com/cloud/network/NetworkModelImpl.java              | 4 ++--
 .../network/router/VpcVirtualNetworkApplianceManagerImpl.java   | 5 ++++-
 server/test/com/cloud/network/MockNetworkModelImpl.java         | 2 +-
 server/test/com/cloud/vpc/MockNetworkModelImpl.java             | 2 +-
 5 files changed, 10 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/94817c1b/api/src/com/cloud/network/NetworkModel.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/NetworkModel.java b/api/src/com/cloud/network/NetworkModel.java
index 99ce1f5..bf6ac9a 100644
--- a/api/src/com/cloud/network/NetworkModel.java
+++ b/api/src/com/cloud/network/NetworkModel.java
@@ -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);
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/94817c1b/server/src/com/cloud/network/NetworkModelImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkModelImpl.java b/server/src/com/cloud/network/NetworkModelImpl.java
index f64c68a..1843d1c 100755
--- a/server/src/com/cloud/network/NetworkModelImpl.java
+++ b/server/src/com/cloud/network/NetworkModelImpl.java
@@ -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;
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/94817c1b/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
b/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
index c540eb7..033d52c 100644
--- a/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
@@ -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)));

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/94817c1b/server/test/com/cloud/network/MockNetworkModelImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/network/MockNetworkModelImpl.java b/server/test/com/cloud/network/MockNetworkModelImpl.java
index 04c50c0..74e0da8 100644
--- a/server/test/com/cloud/network/MockNetworkModelImpl.java
+++ b/server/test/com/cloud/network/MockNetworkModelImpl.java
@@ -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;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/94817c1b/server/test/com/cloud/vpc/MockNetworkModelImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vpc/MockNetworkModelImpl.java b/server/test/com/cloud/vpc/MockNetworkModelImpl.java
index e98253b..7361e49 100644
--- a/server/test/com/cloud/vpc/MockNetworkModelImpl.java
+++ b/server/test/com/cloud/vpc/MockNetworkModelImpl.java
@@ -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;
     }


Mime
View raw message