rhtyd closed pull request #2712: reuse ip for non redundant VPC
URL: https://github.com/apache/cloudstack/pull/2712
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/server/src/com/cloud/network/router/NicProfileHelperImpl.java 
b/server/src/com/cloud/network/router/NicProfileHelperImpl.java
index 09059855319..18ab4a93297 100644
--- a/server/src/com/cloud/network/router/NicProfileHelperImpl.java
+++ b/server/src/com/cloud/network/router/NicProfileHelperImpl.java
@@ -21,6 +21,7 @@
 
 import javax.inject.Inject;
 
+import com.cloud.utils.exception.CloudRuntimeException;
 import org.cloud.network.router.deployment.RouterDeploymentDefinition;
 
 import com.cloud.network.IpAddressManager;
@@ -30,7 +31,6 @@
 import com.cloud.network.Networks.BroadcastDomainType;
 import com.cloud.network.vpc.PrivateIpAddress;
 import com.cloud.network.vpc.PrivateIpVO;
-import com.cloud.network.vpc.Vpc;
 import com.cloud.network.vpc.VpcGateway;
 import com.cloud.network.vpc.VpcManager;
 import com.cloud.network.vpc.dao.PrivateIpDao;
@@ -65,9 +65,11 @@ public NicProfile createPrivateNicProfileForGateway(final 
VpcGateway privateGate
         PrivateIpVO ipVO = 
_privateIpDao.allocateIpAddress(privateNetwork.getDataCenterId(), 
privateNetwork.getId(), privateGateway.getIp4Address());
 
         final Long vpcId = privateGateway.getVpcId();
-        final Vpc activeVpc = _vpcMgr.getActiveVpc(vpcId);
-        if (activeVpc.isRedundant() && ipVO == null) {
+        if (ipVO == null) {
             ipVO = _privateIpDao.findByIpAndVpcId(vpcId, 
privateGateway.getIp4Address());
+            if (ipVO == null) {
+                throw new CloudRuntimeException("cannot find IP address " + 
privateGateway.getIp4Address() + " to reuse for private gateway on vpc (id==" + 
vpcId + ")");
+            }
         }
 
         Nic privateNic = null;
diff --git a/test/integration/smoke/test_privategw_acl.py 
b/test/integration/smoke/test_privategw_acl.py
index a6987e97c88..27328db3eb0 100644
--- a/test/integration/smoke/test_privategw_acl.py
+++ b/test/integration/smoke/test_privategw_acl.py
@@ -720,7 +720,7 @@ def check_pvt_gw_connectivity(self, virtual_machine, 
public_ip, vms_ips):
         succeeded_pings = 0
         minimum_vms_to_pass = 2
         for vm_ip in vms_ips:
-            ssh_command = "ping -c 5 %s" % vm_ip
+            ssh_command = "ping -c 10 %s" % vm_ip
 
             # Should be able to SSH VM
             packet_loss = 100
diff --git a/test/integration/smoke/test_vpc_redundant.py 
b/test/integration/smoke/test_vpc_redundant.py
index 64b1fa67771..fe6b4108fbf 100644
--- a/test/integration/smoke/test_vpc_redundant.py
+++ b/test/integration/smoke/test_vpc_redundant.py
@@ -692,7 +692,7 @@ def do_vpc_test(self, expectFail):
     def do_default_routes_test(self):
         for o in self.networks:
             for vmObj in o.get_vms():
-                ssh_command = "ping -c 3 8.8.8.8"
+                ssh_command = "ping -c 10 8.8.8.8"
 
                 # Should be able to SSH VM
                 packet_loss = 100
diff --git a/test/integration/smoke/test_vpc_router_nics.py 
b/test/integration/smoke/test_vpc_router_nics.py
index 092a70f47e4..854ab567542 100644
--- a/test/integration/smoke/test_vpc_router_nics.py
+++ b/test/integration/smoke/test_vpc_router_nics.py
@@ -451,7 +451,7 @@ def check_ssh_into_vm(self):
     def do_default_routes_test(self):
         for o in self.networks:
             for vmObj in o.get_vms():
-                ssh_command = "ping -c 5 8.8.8.8"
+                ssh_command = "ping -c 10 8.8.8.8"
 
                 # Should be able to SSH VM
                 packet_loss = 100


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to