We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 814dbba commit cd37b13Copy full SHA for cd37b13
1 file changed
server/src/main/java/com/cloud/network/NetworkServiceImpl.java
@@ -1075,7 +1075,11 @@ private boolean releaseIpAddressInternal(long ipAddressId) throws InsufficientAd
1075
if (networkId != null) {
1076
guestNetwork = getNetwork(networkId);
1077
}
1078
- if (ipVO.isSourceNat() && guestNetwork != null && guestNetwork.getState() != Network.State.Allocated) {
+ Vpc vpc = null;
1079
+ if (ipVO.getVpcId() != null) {
1080
+ vpc = _vpcMgr.getActiveVpc(ipVO.getVpcId());
1081
+ }
1082
+ if (ipVO.isSourceNat() && ((guestNetwork != null && guestNetwork.getState() != Network.State.Allocated) || vpc != null)) {
1083
throw new IllegalArgumentException("ip address is used for source nat purposes and can not be disassociated.");
1084
1085
0 commit comments