diff --git a/server/src/com/cloud/network/router/NicProfileHelperImpl.java b/server/src/com/cloud/network/router/NicProfileHelperImpl.java index 090598553199..18ab4a932978 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 a6987e97c883..27328db3eb02 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 64b1fa677713..fe6b4108fbf9 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 092a70f47e4a..854ab5675420 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