File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
server/src/main/java/com/cloud/network Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -1075,7 +1075,11 @@ private boolean releaseIpAddressInternal(long ipAddressId) throws InsufficientAd
10751075 if (networkId != null ) {
10761076 guestNetwork = getNetwork (networkId );
10771077 }
1078- if (ipVO .isSourceNat () && guestNetwork != null && guestNetwork .getState () != Network .State .Allocated ) {
1078+ 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 )) {
10791083 throw new IllegalArgumentException ("ip address is used for source nat purposes and can not be disassociated." );
10801084 }
10811085
You can’t perform that action at this time.
0 commit comments