2023-08-29 19:28:25 |
Maksim Malchuk |
description |
Depending on the host distribution the neutron-metering-agent is deployed, the kernel does not have the iptables-nft, for this case we should be able to enable iptables in the host as the neutron-metering-agent uses it to collect the routers usage data.
The same was done for the neutron-l3-agent, neutron-linuxbridge-agent and neutron_openvswich_agent in review https://review.opendev.org/c/openstack/kolla-ansible/+/685967 |
Depending on the host distribution the neutron-metering-agent is deployed, the kernel does not have the iptables-nft, for this case we should be able to enable iptables in the host as the neutron-metering-agent uses it to collect the routers usage data.
The same was done for the neutron-l3-agent, neutron-linuxbridge-agent and neutron_openvswich_agent in review https://review.opendev.org/c/openstack/kolla-ansible/+/685967
The error message from the container:
2023-07-20 11:21:56.694 7 WARNING neutron.services.metering.drivers.iptables.iptables_driver [-] Failed to get traffic counters for router [{'id': '64899507-23d0-4415-a6d5-9e66c06ee418', 'name': 'c_rally_b39d9d41_6VaAwfCq', 'project_id': 'f7cf295c84124c3dbfcaee0b14f38f52', 'admin_state_up': True, 'status': 'ACTIVE', 'gw_port_id': 'feb92ffe-bb6f-416e-ba73-5c3444b74c51', 'distributed': False, '_metering_labels': [{'id': '1697771b-af0e-4ceb-9637-fa97891f1e44', 'rules': [{'id': '0a5abdd4-9eda-41e1-befb-2e61bdadd9ba', 'metering_label_id': '1697771b-af0e-4ceb-9637-fa97891f1e44', 'direction': 'ingress', 'remote_ip_prefix': None, 'source_ip_prefix': None, 'destination_ip_prefix': '<hide-ip>/32', 'excluded': True}, {'id': '64b863e0-f428-4319-b70f-44701dd86ce1', 'metering_label_id': '1697771b-af0e-4ceb-9637-fa97891f1e44', 'direction': 'ingress', 'remote_ip_prefix': None, 'source_ip_prefix': None, 'destination_ip_prefix': '0.0.0.0/0', 'excluded': False}], 'shared': True, 'name': 'shared-public-ingress'}, {'id': '9412d4aa-beef-4e0d-8735-2b7602e4114a', 'rules': [{'id': '47d58698-7370-46b4-827a-537004b1b128', 'metering_label_id': '9412d4aa-beef-4e0d-8735-2b7602e4114a', 'direction': 'egress', 'remote_ip_prefix': None, 'source_ip_prefix': None, 'destination_ip_prefix': '<hide-ip>/32', 'excluded': True}, {'id': 'f581117c-8f21-49f2-9ea7-1524538dd36a', 'metering_label_id': '9412d4aa-beef-4e0d-8735-2b7602e4114a', 'direction': 'egress', 'remote_ip_prefix': None, 'source_ip_prefix': None, 'destination_ip_prefix': '0.0.0.0/0', 'excluded': False}], 'shared': True, 'name': 'shared-public-egress'}]}] due to [Exit code: 255; Cmd: ['ip', 'netns', 'exec', 'qrouter-64899507-23d0-4415-a6d5-9e66c06ee418', 'iptables', '-t', 'filter', '-L', 'neutron-meter-l-9412d4aa-bee', '-n', '-v', '-x', '-w', '10', '-Z']; Stdin: ; Stdout: ; Stderr: Cannot open network namespace "qrouter-64899507-23d0-4415-a6d5-9e66c06ee418": No such file or directory
]. This error message can happen when routers are migrated; therefore, most of the times they can be ignored.: neutron_lib.exceptions.ProcessExecutionError: Exit code: 255; Cmd: ['ip', 'netns', 'exec', 'qrouter-64899507-23d0-4415-a6d5-9e66c06ee418', 'iptables', '-t', 'filter', '-L', 'neutron-meter-l-9412d4aa-bee', '-n', '-v', '-x', '-w', '10', '-Z']; Stdin: ; Stdout: ; Stderr: Cannot open network namespace "qrouter-64899507-23d0-4415-a6d5-9e66c06ee418": No such file or directory |
|
2023-08-29 20:30:54 |
Pedro Henrique Pereira Martins |
description |
Depending on the host distribution the neutron-metering-agent is deployed, the kernel does not have the iptables-nft, for this case we should be able to enable iptables in the host as the neutron-metering-agent uses it to collect the routers usage data.
The same was done for the neutron-l3-agent, neutron-linuxbridge-agent and neutron_openvswich_agent in review https://review.opendev.org/c/openstack/kolla-ansible/+/685967
The error message from the container:
2023-07-20 11:21:56.694 7 WARNING neutron.services.metering.drivers.iptables.iptables_driver [-] Failed to get traffic counters for router [{'id': '64899507-23d0-4415-a6d5-9e66c06ee418', 'name': 'c_rally_b39d9d41_6VaAwfCq', 'project_id': 'f7cf295c84124c3dbfcaee0b14f38f52', 'admin_state_up': True, 'status': 'ACTIVE', 'gw_port_id': 'feb92ffe-bb6f-416e-ba73-5c3444b74c51', 'distributed': False, '_metering_labels': [{'id': '1697771b-af0e-4ceb-9637-fa97891f1e44', 'rules': [{'id': '0a5abdd4-9eda-41e1-befb-2e61bdadd9ba', 'metering_label_id': '1697771b-af0e-4ceb-9637-fa97891f1e44', 'direction': 'ingress', 'remote_ip_prefix': None, 'source_ip_prefix': None, 'destination_ip_prefix': '<hide-ip>/32', 'excluded': True}, {'id': '64b863e0-f428-4319-b70f-44701dd86ce1', 'metering_label_id': '1697771b-af0e-4ceb-9637-fa97891f1e44', 'direction': 'ingress', 'remote_ip_prefix': None, 'source_ip_prefix': None, 'destination_ip_prefix': '0.0.0.0/0', 'excluded': False}], 'shared': True, 'name': 'shared-public-ingress'}, {'id': '9412d4aa-beef-4e0d-8735-2b7602e4114a', 'rules': [{'id': '47d58698-7370-46b4-827a-537004b1b128', 'metering_label_id': '9412d4aa-beef-4e0d-8735-2b7602e4114a', 'direction': 'egress', 'remote_ip_prefix': None, 'source_ip_prefix': None, 'destination_ip_prefix': '<hide-ip>/32', 'excluded': True}, {'id': 'f581117c-8f21-49f2-9ea7-1524538dd36a', 'metering_label_id': '9412d4aa-beef-4e0d-8735-2b7602e4114a', 'direction': 'egress', 'remote_ip_prefix': None, 'source_ip_prefix': None, 'destination_ip_prefix': '0.0.0.0/0', 'excluded': False}], 'shared': True, 'name': 'shared-public-egress'}]}] due to [Exit code: 255; Cmd: ['ip', 'netns', 'exec', 'qrouter-64899507-23d0-4415-a6d5-9e66c06ee418', 'iptables', '-t', 'filter', '-L', 'neutron-meter-l-9412d4aa-bee', '-n', '-v', '-x', '-w', '10', '-Z']; Stdin: ; Stdout: ; Stderr: Cannot open network namespace "qrouter-64899507-23d0-4415-a6d5-9e66c06ee418": No such file or directory
]. This error message can happen when routers are migrated; therefore, most of the times they can be ignored.: neutron_lib.exceptions.ProcessExecutionError: Exit code: 255; Cmd: ['ip', 'netns', 'exec', 'qrouter-64899507-23d0-4415-a6d5-9e66c06ee418', 'iptables', '-t', 'filter', '-L', 'neutron-meter-l-9412d4aa-bee', '-n', '-v', '-x', '-w', '10', '-Z']; Stdin: ; Stdout: ; Stderr: Cannot open network namespace "qrouter-64899507-23d0-4415-a6d5-9e66c06ee418": No such file or directory |
Depending on the host distribution the neutron-metering-agent is deployed, the kernel does not have the iptables-nft, for this case we should be able to enable iptables in the host as the neutron-metering-agent uses it to collect the routers usage data.
The same was done for the neutron-l3-agent, neutron-linuxbridge-agent and neutron_openvswich_agent in review https://review.opendev.org/c/openstack/kolla-ansible/+/685967
Here is a LOG example of the neutron-metering-agente using the iptable command:
```
2023-08-29 22:22:50.324 7 ERROR neutron.services.metering.agents.metering_agent [None req-d73ec3d4-4ba4-4e45-9a5f-42ae82484097 - - - - - -] Driver neutron.services.metering.drivers.iptables.iptables_driver.IptablesMeteringDriver:update_routers runtime error: neutron_lib.exceptions.ProcessExecutionError: Exit code: 1; Cmd: ['ip', 'netns', 'exec', 'qrouter-2a8dcc06-dc10-4d3b-8a97-1c540797860e', 'iptables-save']; Stdin: ; Stdout: ; Stderr: exec of "iptables-save" failed: No such file or directory
2023-08-29 22:22:50.324 7 ERROR neutron.services.metering.agents.metering_agent Traceback (most recent call last):
2023-08-29 22:22:50.324 7 ERROR neutron.services.metering.agents.metering_agent File "/var/lib/kolla/venv/lib/python3.10/site-packages/neutron/services/metering/agents/metering_agent.py", line 247, in _invoke_driver
2023-08-29 22:22:50.324 7 ERROR neutron.services.metering.agents.metering_agent return getattr(self.metering_driver, func_name)(context, meterings)
2023-08-29 22:22:50.324 7 ERROR neutron.services.metering.agents.metering_agent File "/var/lib/kolla/venv/lib/python3.10/site-packages/oslo_log/helpers.py", line 67, in wrapper
2023-08-29 22:22:50.324 7 ERROR neutron.services.metering.agents.metering_agent return method(*args, **kwargs)
2023-08-29 22:22:50.324 7 ERROR neutron.services.metering.agents.metering_agent File "/var/lib/kolla/venv/lib/python3.10/site-packages/neutron/services/metering/drivers/iptables/iptables_driver.py", line 175, in update_routers
2023-08-29 22:22:50.324 7 ERROR neutron.services.metering.agents.metering_agent self._process_associate_metering_label(router)
2023-08-29 22:22:50.324 7 ERROR neutron.services.metering.agents.metering_agent File "/var/lib/kolla/venv/lib/python3.10/site-packages/neutron/services/metering/drivers/iptables/iptables_driver.py", line 315, in _process_associate_metering_label
2023-08-29 22:22:50.324 7 ERROR neutron.services.metering.agents.metering_agent self._process_ns_specific_metering_label(router, dev, im)
2023-08-29 22:22:50.324 7 ERROR neutron.services.metering.agents.metering_agent File "/var/lib/kolla/venv/lib/python3.10/site-packages/neutron/services/metering/drivers/iptables/iptables_driver.py", line 284, in _process_ns_specific_metering_label
2023-08-29 22:22:50.324 7 ERROR neutron.services.metering.agents.metering_agent with IptablesManagerTransaction(im):
2023-08-29 22:22:50.324 7 ERROR neutron.services.metering.agents.metering_agent File "/var/lib/kolla/venv/lib/python3.10/site-packages/neutron/services/metering/drivers/iptables/iptables_driver.py", line 59, in __exit__
2023-08-29 22:22:50.324 7 ERROR neutron.services.metering.agents.metering_agent self.im.apply()
2023-08-29 22:22:50.324 7 ERROR neutron.services.metering.agents.metering_agent File "/var/lib/kolla/venv/lib/python3.10/site-packages/neutron/agent/linux/iptables_manager.py", line 452, in apply
2023-08-29 22:22:50.324 7 ERROR neutron.services.metering.agents.metering_agent return self._apply()
2023-08-29 22:22:50.324 7 ERROR neutron.services.metering.agents.metering_agent File "/var/lib/kolla/venv/lib/python3.10/site-packages/neutron/agent/linux/iptables_manager.py", line 464, in _apply
2023-08-29 22:22:50.324 7 ERROR neutron.services.metering.agents.metering_agent first = self._apply_synchronized()
2023-08-29 22:22:50.324 7 ERROR neutron.services.metering.agents.metering_agent File "/var/lib/kolla/venv/lib/python3.10/site-packages/neutron/agent/linux/iptables_manager.py", line 588, in _apply_synchronized
2023-08-29 22:22:50.324 7 ERROR neutron.services.metering.agents.metering_agent with excutils.save_and_reraise_exception() as ctx:
2023-08-29 22:22:50.324 7 ERROR neutron.services.metering.agents.metering_agent File "/var/lib/kolla/venv/lib/python3.10/site-packages/oslo_utils/excutils.py", line 227, in __exit__
2023-08-29 22:22:50.324 7 ERROR neutron.services.metering.agents.metering_agent self.force_reraise()
2023-08-29 22:22:50.324 7 ERROR neutron.services.metering.agents.metering_agent File "/var/lib/kolla/venv/lib/python3.10/site-packages/oslo_utils/excutils.py", line 200, in force_reraise
2023-08-29 22:22:50.324 7 ERROR neutron.services.metering.agents.metering_agent raise self.value
2023-08-29 22:22:50.324 7 ERROR neutron.services.metering.agents.metering_agent File "/var/lib/kolla/venv/lib/python3.10/site-packages/neutron/agent/linux/iptables_manager.py", line 581, in _apply_synchronized
2023-08-29 22:22:50.324 7 ERROR neutron.services.metering.agents.metering_agent save_output = linux_utils.execute(args, run_as_root=True,
2023-08-29 22:22:50.324 7 ERROR neutron.services.metering.agents.metering_agent File "/var/lib/kolla/venv/lib/python3.10/site-packages/neutron/agent/linux/utils.py", line 156, in execute
2023-08-29 22:22:50.324 7 ERROR neutron.services.metering.agents.metering_agent raise exceptions.ProcessExecutionError(msg,
2023-08-29 22:22:50.324 7 ERROR neutron.services.metering.agents.metering_agent neutron_lib.exceptions.ProcessExecutionError: Exit code: 1; Cmd: ['ip', 'netns', 'exec', 'qrouter-2a8dcc06-dc10-4d3b-8a97-1c540797860e', 'iptables-save']; Stdin: ; Stdout: ; Stderr: exec of "iptables-save" failed: No such file or directory
2023-08-29 22:22:50.324 7 ERROR neutron.services.metering.agents.metering_agent
2023-08-29 22:22:50.324 7 ERROR neutron.services.metering.agents.metering_agent
``` |
|