Updated Branches:
  refs/heads/master 6ec623d2d -> a7b77f331

remove wrong storage network ip checking when setting internal ip route in NFS 
secondary
storage resource.

The bug prevent vmware setting static route to vcenter


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

Branch: refs/heads/master
Commit: a7b77f33169fd39d100cdf6fa1965341f3e24b53
Parents: 6ec623d
Author: frank <[email protected]>
Authored: Fri Sep 7 11:03:01 2012 -0700
Committer: frank <[email protected]>
Committed: Fri Sep 7 11:03:01 2012 -0700

----------------------------------------------------------------------
 .../resource/NfsSecondaryStorageResource.java      |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a7b77f33/core/src/com/cloud/storage/resource/NfsSecondaryStorageResource.java
----------------------------------------------------------------------
diff --git 
a/core/src/com/cloud/storage/resource/NfsSecondaryStorageResource.java 
b/core/src/com/cloud/storage/resource/NfsSecondaryStorageResource.java
index a0873ab..155210d 100755
--- a/core/src/com/cloud/storage/resource/NfsSecondaryStorageResource.java
+++ b/core/src/com/cloud/storage/resource/NfsSecondaryStorageResource.java
@@ -124,6 +124,7 @@ public class NfsSecondaryStorageResource extends 
ServerResourceBase implements S
        private String _storageIp;
        private String _storageNetmask;
        private String _storageGateway;
+       private List<String> nfsIps = new ArrayList<String>();
        final private String _parent = "/mnt/SecStorage";
        final private String _tmpltDir = "/var/cloudstack/template";
     final private String _tmpltpp = "template.properties";
@@ -611,6 +612,7 @@ public class NfsSecondaryStorageResource extends 
ServerResourceBase implements S
 
             configCerts(cmd.getCerts());
             
+            nfsIps.add(nfsHostIp);
             return new SecStorageSetupAnswer(dir);
         } catch (Exception e) {
             String msg = "GetRootDir for " + secUrl + " failed due to " + 
e.toString();
@@ -730,6 +732,13 @@ public class NfsSecondaryStorageResource extends 
ServerResourceBase implements S
                boolean success = true;
                StringBuilder result = new StringBuilder();
                for (String cidr: cmd.getAllowedInternalSites()) {
+                       if (nfsIps.contains(cidr)) {
+                               /*
+                                * if the internal download ip is the same with 
secondary storage ip, adding internal sites will flush
+                                * ip route to nfs through storage ip. 
+                                */
+                               continue;
+                       }
                        String tmpresult = allowOutgoingOnPrivate(cidr);
                        if (tmpresult != null) {
                                result.append(", ").append(tmpresult);
@@ -814,10 +823,7 @@ public class NfsSecondaryStorageResource extends 
ServerResourceBase implements S
                return "Error in allowing outgoing to " + destCidr + ", err=" + 
result;
        }
        
-       if (_storageIp == null) {
-           /* only set route when no storage network present */
-           addRouteToInternalIpOrCidr(_localgw, _eth1ip, _eth1mask, destCidr);
-       }
+       addRouteToInternalIpOrCidr(_localgw, _eth1ip, _eth1mask, destCidr);
        
        return null;
        }

Reply via email to