mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
bug 11021: Add ReservationStrategy.Managed to prevent sourceNat from release
status 11021: resolved fixed
This commit is contained in:
parent
34682b3bb0
commit
2d958c5d23
@ -83,7 +83,7 @@ public interface Nic {
|
||||
}
|
||||
|
||||
public enum ReservationStrategy {
|
||||
PlaceHolder, Create, Start;
|
||||
PlaceHolder, Create, Start, Managed;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -155,7 +155,7 @@ public class PublicNetworkGuru extends AdapterBase implements NetworkGuru {
|
||||
if (nic.getIp4Address() == null) {
|
||||
nic.setStrategy(ReservationStrategy.Start);
|
||||
} else {
|
||||
nic.setStrategy(ReservationStrategy.Create);
|
||||
nic.setStrategy(ReservationStrategy.Managed);
|
||||
}
|
||||
|
||||
return nic;
|
||||
@ -182,7 +182,7 @@ public class PublicNetworkGuru extends AdapterBase implements NetworkGuru {
|
||||
@Override
|
||||
public void deallocate(Network network, NicProfile nic, VirtualMachineProfile<? extends VirtualMachine> vm) {
|
||||
IPAddressVO ip = _ipAddressDao.findByIpAndSourceNetworkId(nic.getNetworkId(), nic.getIp4Address());
|
||||
if (ip != null) {
|
||||
if (ip != null && nic.getReservationStrategy() != ReservationStrategy.Managed) {
|
||||
_networkMgr.markIpAsUnavailable(ip.getId());
|
||||
_ipAddressDao.unassignIpAddress(ip.getId());
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user