mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CS-15503: don't send Ips in Releasing state as a part of VPC VR start
This commit is contained in:
parent
21519070fc
commit
55db112990
@ -2060,15 +2060,29 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
|
||||
}
|
||||
}
|
||||
|
||||
protected ArrayList<? extends PublicIpAddress> getPublicIpsToApply(VirtualRouter router, Provider provider, Long guestNetworkId) {
|
||||
protected ArrayList<? extends PublicIpAddress> getPublicIpsToApply(VirtualRouter router, Provider provider,
|
||||
Long guestNetworkId, com.cloud.network.IpAddress.State... skipInStates) {
|
||||
long ownerId = router.getAccountId();
|
||||
final List<IPAddressVO> userIps = _networkMgr.listPublicIpsAssignedToGuestNtwk(ownerId, guestNetworkId, null);
|
||||
List<PublicIp> allPublicIps = new ArrayList<PublicIp>();
|
||||
if (userIps != null && !userIps.isEmpty()) {
|
||||
boolean addIp = true;
|
||||
for (IPAddressVO userIp : userIps) {
|
||||
if (skipInStates != null) {
|
||||
for (IpAddress.State stateToSkip : skipInStates) {
|
||||
if (userIp.getState() == stateToSkip) {
|
||||
s_logger.debug("Skipping ip address " + userIp + " in state " + userIp.getState());
|
||||
addIp = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (addIp) {
|
||||
PublicIp publicIp = new PublicIp(userIp, _vlanDao.findById(userIp.getVlanId()),
|
||||
NetUtils.createSequenceBasedMacAddress(userIp.getMacAddress()));
|
||||
allPublicIps.add(publicIp);
|
||||
allPublicIps.add(publicIp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -18,6 +18,7 @@ import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.ejb.Local;
|
||||
|
||||
@ -1030,13 +1031,12 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
|
||||
protected void finalizeIpAssocForNetwork(Commands cmds, VirtualRouter router, Provider provider,
|
||||
Long guestNetworkId) {
|
||||
|
||||
ArrayList<? extends PublicIpAddress> publicIps = getPublicIpsToApply(router, provider, guestNetworkId);
|
||||
ArrayList<? extends PublicIpAddress> publicIps = getPublicIpsToApply(router, provider, guestNetworkId, IpAddress.State.Releasing);
|
||||
|
||||
if (publicIps != null && !publicIps.isEmpty()) {
|
||||
s_logger.debug("Found " + publicIps.size() + " ip(s) to apply as a part of domR " + router + " start.");
|
||||
// Re-apply public ip addresses - should come before PF/LB/VPN
|
||||
createVpcAssociatePublicIPCommands(router, publicIps, cmds);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -1209,4 +1209,5 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
|
||||
privateNic.setMacAddress(ip.getMacAddress());
|
||||
return privateNic;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user