cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From muralire...@apache.org
Subject git commit: updated refs/heads/master to 8b151c9
Date Fri, 27 Dec 2013 08:58:14 GMT
Updated Branches:
  refs/heads/master 4fe63f7de -> 8b151c98c


CLOUDSTACK-5403: Shared network - None of PF, LB rules work after router
restart, firewall rules dropped from iptables post restart

on VR restart, not all public IP's associated with the network are sent
with IpAssocCmd to VR. This fix will ensure all the ip's associated with
the network irrespective of the account are sent as part of
IpAssocCommand

Conflicts:
	server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java


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

Branch: refs/heads/master
Commit: 8b151c98c22e39afb0be6768666b63a17286d410
Parents: 4fe63f7
Author: Murali Reddy <muralimmreddy@gmail.com>
Authored: Fri Dec 27 13:31:44 2013 +0530
Committer: Murali Reddy <muralimmreddy@gmail.com>
Committed: Fri Dec 27 14:27:57 2013 +0530

----------------------------------------------------------------------
 api/src/com/cloud/network/NetworkModel.java            |  2 ++
 server/src/com/cloud/network/NetworkModelImpl.java     | 13 +++++++++++++
 .../router/VirtualNetworkApplianceManagerImpl.java     | 11 ++++++++++-
 .../test/com/cloud/network/MockNetworkModelImpl.java   |  9 +++++++++
 server/test/com/cloud/vpc/MockNetworkModelImpl.java    | 10 ++++++++++
 5 files changed, 44 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8b151c98/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 fcb6a2e..f6555db 100644
--- a/api/src/com/cloud/network/NetworkModel.java
+++ b/api/src/com/cloud/network/NetworkModel.java
@@ -60,6 +60,8 @@ public interface NetworkModel {
      */
     List<? extends IpAddress> listPublicIpsAssignedToGuestNtwk(long accountId, long
associatedNetworkId, Boolean sourceNat);
 
+    List<? extends IpAddress> listPublicIpsAssignedToGuestNtwk(long associatedNetworkId,
Boolean sourceNat);
+
     List<? extends NetworkOffering> getSystemAccountNetworkOfferings(String... offeringNames);
 
     List<? extends Nic> getNics(long vmId);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8b151c98/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 746faa8..52a08e1 100755
--- a/server/src/com/cloud/network/NetworkModelImpl.java
+++ b/server/src/com/cloud/network/NetworkModelImpl.java
@@ -524,6 +524,19 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel
{
     }
 
     @Override
+    public List<IPAddressVO> listPublicIpsAssignedToGuestNtwk(long associatedNetworkId,
Boolean sourceNat) {
+        SearchCriteria<IPAddressVO> sc = IpAddressSearch.create();
+        sc.setParameters("associatedWithNetworkId", associatedNetworkId);
+
+        if (sourceNat != null) {
+            sc.addAnd("sourceNat", SearchCriteria.Op.EQ, sourceNat);
+        }
+        sc.setJoinParameters("virtualNetworkVlanSB", "vlanType", VlanType.VirtualNetwork);
+
+        return _ipAddressDao.search(sc, null);
+    }
+
+    @Override
     public List<IPAddressVO> listPublicIpsAssignedToAccount(long accountId, long dcId,
Boolean sourceNat) {
         SearchCriteria<IPAddressVO> sc = IpAddressSearch.create();
         sc.setParameters("accountId", accountId);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8b151c98/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
index fdc1b27..cc66199 100755
--- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
@@ -2571,7 +2571,16 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase
implements V
     protected ArrayList<? extends PublicIpAddress> getPublicIpsToApply(VirtualRouter
router, Provider provider, Long guestNetworkId,
         com.cloud.network.IpAddress.State... skipInStates) {
         long ownerId = router.getAccountId();
-        final List<? extends IpAddress> userIps = _networkModel.listPublicIpsAssignedToGuestNtwk(ownerId,
guestNetworkId, null);
+        final List<? extends IpAddress> userIps;
+
+        Network guestNetwork = _networkDao.findById(guestNetworkId);
+        if (guestNetwork.getGuestType() == GuestType.Shared) {
+            // ignore the account id for the shared network
+            userIps = _networkModel.listPublicIpsAssignedToGuestNtwk(guestNetworkId, null);
+        } else {
+            userIps = _networkModel.listPublicIpsAssignedToGuestNtwk(ownerId, guestNetworkId,
null);
+        }
+
         List<PublicIp> allPublicIps = new ArrayList<PublicIp>();
         if (userIps != null && !userIps.isEmpty()) {
             boolean addIp = true;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8b151c98/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 6ae6ae8..6c9e597 100644
--- a/server/test/com/cloud/network/MockNetworkModelImpl.java
+++ b/server/test/com/cloud/network/MockNetworkModelImpl.java
@@ -93,6 +93,15 @@ public class MockNetworkModelImpl extends ManagerBase implements NetworkModel
{
     }
 
     /* (non-Javadoc)
+   * @see com.cloud.network.NetworkModel#listPublicIpsAssignedToGuestNtwk(long, long, java.lang.Boolean)
+   */
+    @Override
+    public List<IPAddressVO> listPublicIpsAssignedToGuestNtwk(long associatedNetworkId,
Boolean sourceNat) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
      * @see com.cloud.network.NetworkModel#getSystemAccountNetworkOfferings(java.lang.String[])
      */
     @Override

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8b151c98/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 e0583d8..67ab8e8 100644
--- a/server/test/com/cloud/vpc/MockNetworkModelImpl.java
+++ b/server/test/com/cloud/vpc/MockNetworkModelImpl.java
@@ -104,6 +104,16 @@ public class MockNetworkModelImpl extends ManagerBase implements NetworkModel
{
     }
 
     /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#listPublicIpsAssignedToGuestNtwk(long, long, java.lang.Boolean)
+     */
+    @Override
+    public List<IPAddressVO> listPublicIpsAssignedToGuestNtwk(long associatedNetworkId,
Boolean sourceNat) {
+
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
      * @see com.cloud.network.NetworkModel#getSystemAccountNetworkOfferings(java.lang.String[])
      */
     @Override


Mime
View raw message