You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: server/src/com/cloud/network/NetworkServiceImpl.java
+5-1Lines changed: 5 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -197,6 +197,7 @@
197
197
importcom.cloud.vm.dao.NicSecondaryIpVO;
198
198
importcom.cloud.vm.dao.UserVmDao;
199
199
importcom.cloud.vm.dao.VMInstanceDao;
200
+
importcom.cloud.network.dao.LoadBalancerDao;
200
201
201
202
/**
202
203
* NetworkServiceImpl implements NetworkService.
@@ -335,6 +336,9 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
335
336
@Inject
336
337
NetworkDetailsDao_networkDetailsDao;
337
338
339
+
@Inject
340
+
LoadBalancerDao_loadBalancerDao;
341
+
338
342
int_cidrLimit;
339
343
boolean_allowSubdomainNetworkAccess;
340
344
@@ -852,7 +856,7 @@ public boolean releaseSecondaryIpFromNic(long ipAddressId) {
852
856
thrownewInvalidParameterValueException("Can' remove the ip " + secondaryIp + "is associate with static NAT rule public IP address id " + publicIpVO.getId());
853
857
}
854
858
855
-
if (_lbService.isLbRuleMappedToVmGuestIp(secondaryIp)) {
859
+
if (_loadBalancerDao.isLoadBalancerRulesMappedToVmGuestIp(vm.getId(), secondaryIp, network.getId())) {
856
860
s_logger.debug("VM nic IP " + secondaryIp + " is mapped to load balancing rule");
857
861
thrownewInvalidParameterValueException("Can't remove the secondary ip " + secondaryIp + " is mapped to load balancing rule");
0 commit comments