Hi, Bug ID : CLOUDSTACK-6223.(removeNicFromVirtualMachine fails if another instance in another domain has a nic with the same ip and a forwarding rule configured on it)
Here is my proposed fix . Add new method to get rules by destip and instanceid so that we get rules only for that vm instead of all other vms matching the destination ip which was existing behavior. @Override public List<PortForwardingRuleVO> listByVmidAndDestIpAddr(String ip4Address,long vmid) { SearchCriteria<PortForwardingRuleVO> sc = AllFieldsSearch.create(); sc.setParameters("dstIp", ip4Address); sc.setParameters("vmId", vmid); return listBy(sc); }