This is an automated email from the ASF dual-hosted git repository.

rohit pushed a commit to branch 4.11
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/4.11 by this push:
     new 52b02de  vpc: reuse private gateway ip for non redundant VPC (#2712)
52b02de is described below

commit 52b02de43f8eaf4c25cdf3d2b514ca0bf39cb986
Author: dahn <daan.hoogl...@gmail.com>
AuthorDate: Thu Jun 21 11:36:50 2018 +0200

    vpc: reuse private gateway ip for non redundant VPC (#2712)
    
    As rolling restart does not deallocate an IP before configuring it on a new 
VR, the code must allow it to be reused on a non-redundant VPCs gateway nic.
    In crease ping counts to reduce intermittent failures in smoketests.
    
    Signed-off-by: Rohit Yadav <rohit.ya...@shapeblue.com>
---
 server/src/com/cloud/network/router/NicProfileHelperImpl.java | 8 +++++---
 test/integration/smoke/test_privategw_acl.py                  | 2 +-
 test/integration/smoke/test_vpc_redundant.py                  | 2 +-
 test/integration/smoke/test_vpc_router_nics.py                | 2 +-
 4 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/server/src/com/cloud/network/router/NicProfileHelperImpl.java 
b/server/src/com/cloud/network/router/NicProfileHelperImpl.java
index 0905985..18ab4a9 100644
--- a/server/src/com/cloud/network/router/NicProfileHelperImpl.java
+++ b/server/src/com/cloud/network/router/NicProfileHelperImpl.java
@@ -21,6 +21,7 @@ import java.net.URI;
 
 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.AddressFormat;
 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 class NicProfileHelperImpl implements 
NicProfileHelper {
         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 a6987e9..27328db 100644
--- a/test/integration/smoke/test_privategw_acl.py
+++ b/test/integration/smoke/test_privategw_acl.py
@@ -720,7 +720,7 @@ class TestPrivateGwACL(cloudstackTestCase):
         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 64b1fa6..fe6b410 100644
--- a/test/integration/smoke/test_vpc_redundant.py
+++ b/test/integration/smoke/test_vpc_redundant.py
@@ -692,7 +692,7 @@ class TestVPCRedundancy(cloudstackTestCase):
     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 092a70f..854ab56 100644
--- a/test/integration/smoke/test_vpc_router_nics.py
+++ b/test/integration/smoke/test_vpc_router_nics.py
@@ -451,7 +451,7 @@ class TestVPCNics(cloudstackTestCase):
     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

Reply via email to