mirror of https://github.com/apache/cloudstack.git
bug 11021: Add ReservationStrategy.Managed to prevent sourceNat from release
status 11021: resolved fixed
This commit is contained in:
parent
7e324b099d
commit
e1de9f5bec
|
|
@ -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…
Reference in New Issue