[ https://issues.apache.org/jira/browse/CLOUDSTACK-9779?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15884069#comment-15884069 ]
ASF GitHub Bot commented on CLOUDSTACK-9779: -------------------------------------------- Github user ustcweizhou commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/1972#discussion_r103072546 --- Diff: engine/schema/src/com/cloud/network/dao/LoadBalancerDaoImpl.java --- @@ -75,4 +84,40 @@ protected LoadBalancerDaoImpl() { return listBy(sc); } + @Override + public boolean isLoadBalancerRulesMappedToVmGuestIp(long instanceId, String instanceIp, long networkId, FirewallRule.Purpose purpose) + { + SearchBuilder<LoadBalancerVMMapVO> lbVmMapSearch = _loadBalancerVMMapDao.createSearchBuilder(); + lbVmMapSearch.and("instanceIp", lbVmMapSearch.entity().getInstanceIp(),SearchCriteria.Op.EQ); + lbVmMapSearch.and("instanceId", lbVmMapSearch.entity().getInstanceId(), SearchCriteria.Op.EQ); + + SearchBuilder<FirewallRuleVO> firewallRuleIdSearch = _firewallRulesDao.createSearchBuilder(); --- End diff -- You might know LoadBalancerVO extends FirewallRuleVO, you can use LoadBalancerVO instead. > Releasing secondary guest IP fails with error VM nic Ip x.x.x.x is mapped to > load balancing rule > ------------------------------------------------------------------------------------------------ > > Key: CLOUDSTACK-9779 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9779 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: Management Server > Reporter: Nitesh Sarda > > ISSUE > ================= > Releasing secondary guest IP fails with error VM nic Ip x.x.x.x is mapped to > load balancing rule > REPRO STEPS > ================== > 1. Create two isolated guest networks with same CIDR > 2. Deploy VMs on both networks > 3. Acquire secondary IP on NICs of both VMs and make sure they have the same > value, user can input the IP address. > 4. Configure Loadbalancing rule on one of the secondary IP address and try > releasing the other secondary IP address. > 5. The operation would fail > EXPECTED BEHAVIOR > ================== > Secondary IP address should be released if there are no LB rules associated > with it. > ACTUAL BEHAVIOR > ================== > Releasing secondary IP address even if there are no LB rules associated with > it. -- This message was sent by Atlassian JIRA (v6.3.15#6346)