NSX: Cleanup PF rule associated to an expunged VM

This commit is contained in:
Pearl Dsilva 2024-02-22 11:40:30 -05:00
parent 35357dc8f9
commit 3c2bf12a93

View File

@ -509,8 +509,7 @@ public class NsxElement extends AdapterBase implements DhcpServiceProvider, Dns
for (PortForwardingRule rule : rules) {
IPAddressVO publicIp = ApiDBUtils.findIpAddressById(rule.getSourceIpAddressId());
UserVm vm = ApiDBUtils.findUserVmById(rule.getVirtualMachineId());
if ((vm == null && (rule.getState() != FirewallRule.State.Revoke)) ||
(vm != null && networkModel.getNicInNetwork(vm.getId(), network.getId()) == null)) {
if (vm == null && rule.getState() != FirewallRule.State.Revoke) {
continue;
}
NsxOpObject nsxObject = getNsxOpObject(network);