Missing iptables in Neutron metering container

Bug #2033424 reported by Pedro Henrique Pereira Martins
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kolla-ansible
Status tracked in Caracal
Antelope
Confirmed
Low
Unassigned
Bobcat
Confirmed
Low
Pedro Henrique Pereira Martins
Caracal
In Progress
Low
Pedro Henrique Pereira Martins
Zed
Confirmed
Low
Unassigned

Bug 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

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
```

Revision history for this message
Maksim Malchuk (mmalchuk) wrote :
Changed in kolla-ansible:
status: New → Confirmed
importance: Undecided → Low
assignee: nobody → Pedro Henrique Pereira Martins (pedrohpmartins)
description: updated
description: updated
Changed in kolla-ansible:
status: Confirmed → In Progress
Revision history for this message
Maksim Malchuk (mmalchuk) wrote :

unmaintaned

no longer affects: kolla-ansible/xena
no longer affects: kolla-ansible/yoga
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.