Fix the issue of losing nf_conntrace* values after a reboot.

Loading ip_vs module before setting nf_conntrace_* opts.

Story: 2010795
Task: 48247
Change-Id: Ie4763e97b1414e9871f222c20efd0f532b3dfc9f
This commit is contained in:
wu.chunyang 2023-06-19 15:25:16 +08:00 committed by Gregory Thiemonge
parent e2bc07222f
commit 2643a76602
2 changed files with 7 additions and 2 deletions

View File

@ -10,6 +10,8 @@ RemainAfterExit=yes
ExecStart=-/sbin/ip netns add {{ amphora_nsname }}
# Load the system sysctl into the new namespace
ExecStart=-/sbin/ip netns exec {{ amphora_nsname }} sysctl --system
# Enable kernel module ip_vs for lvs function in amphora network namespace
ExecStart=-/sbin/ip netns exec {{ amphora_nsname }} modprobe ip_vs
# Set nf_conntrack_buckets sysctl in the main namespace (nf_conntrack_buckets
# cannot be set in another net namespace, but its value is inherited from the
# main namespace)
@ -17,8 +19,6 @@ ExecStart=-/sbin/sysctl -w net.netfilter.nf_conntrack_buckets=125000
# Update conntrack table sizes using the formula for the default values
ExecStart=-/sbin/sysctl -w net.netfilter.nf_conntrack_max=125000
ExecStart=-/sbin/sysctl -w net.netfilter.nf_conntrack_expect_max=488
# Enable kernel module ip_vs for lvs function in amphora network namespace
ExecStart=-/sbin/ip netns exec {{ amphora_nsname }} modprobe ip_vs
# Enable ip_forward and conntrack kernel configuration
ExecStart=-/sbin/ip netns exec {{ amphora_nsname }} sysctl -w net.ipv4.ip_forward=1
ExecStart=-/sbin/ip netns exec {{ amphora_nsname }} sysctl -w net.ipv4.vs.conntrack=1

View File

@ -0,0 +1,5 @@
---
fixes:
- |
Fix the issue where nf_conntrack* opts values are lost after rebooting the Amphora VM.
more details `Story 2010795 <https://storyboard.openstack.org/#!/story/2010795>`__