Skip to content

Commit c6f0ba7

Browse files
committed
Merge pull request #1947 from ustcweizhou/RemoveSecondaryIP
CLOUDSTACK-9789: Fix releasing secondary guest IP fails with associated static nat which is actually not used * pr/1947: CLOUDSTACK-9789: Fix releasing secondary guest IP fails with associated static nat which is actually not used Signed-off-by: Rajani Karuturi <rajani.karuturi@accelerite.com>
2 parents f3d38be + 0f05424 commit c6f0ba7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server/src/com/cloud/network/NetworkServiceImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ public boolean releaseSecondaryIpFromNic(long ipAddressId) {
835835
}
836836
}
837837
//check if the secondary ip associated with any static nat rule
838-
IPAddressVO publicIpVO = _ipAddressDao.findByVmIp(secondaryIp);
838+
IPAddressVO publicIpVO = _ipAddressDao.findByIpAndNetworkId(secIpVO.getNetworkId(), secondaryIp);
839839
if (publicIpVO != null) {
840840
s_logger.debug("VM nic IP " + secondaryIp + " is associated with the static NAT rule public IP address id " + publicIpVO.getId());
841841
throw new InvalidParameterValueException("Can' remove the ip " + secondaryIp + "is associate with static NAT rule public IP address id " + publicIpVO.getId());

0 commit comments

Comments
 (0)