diff --git a/vmware_nsx/plugins/nsx_v/plugin.py b/vmware_nsx/plugins/nsx_v/plugin.py index 3187668912..e59e9983c3 100644 --- a/vmware_nsx/plugins/nsx_v/plugin.py +++ b/vmware_nsx/plugins/nsx_v/plugin.py @@ -1820,9 +1820,10 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin, there are, so we can decide on adding / removing the device from the exclusion list """ - filters = {'device_id': [device_id], - 'device_owner': ['compute:None']} - ports = self.get_ports(context.elevated(), filters=filters) + filters = {'device_id': [device_id]} + device_ports = self.get_ports(context.elevated(), filters=filters) + ports = [port for port in device_ports + if port['device_owner'].startswith('compute')] return len([p for p in ports if validators.is_attr_set(p.get(ext_vnic_idx.VNIC_INDEX)) and not p[psec.PORTSECURITY]])