Repository navigation
Count IPv6 traffic in virtual router network usage - #14620
Open
MitchDrage wants to merge 2 commits into
Open
MitchDrage wants to merge 2 commits into
MitchDrage wants to merge 2 commits into
Conversation
2 of 12 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR counts IPv6 traffic in network usage on virtual routers for isolated and VPC networks. Until now only IPv4 was counted on these networks.
IPv6 traffic on shared networks has successfully been counted due to the usage counters measure raw interface traffic which can account for IPv4 and IPv6.
This builds on #14583, which adds
network.usage.exempt.cidrs, so this branch includes that commit until #14583 merges.Related: #14607 applies the
network.usage.exempt.cidrsexemptions to VMs on KVM shared networks, for both IPv4 and IPv6. This PR doesn't depend on it.ip6 cloudstack_usagenftables table copies each IPv4NETWORK_STATSrule, so both families count the same traffic. VPC routers match on the tiers' IPv6 prefixes.configure.pyrebuilds the rules on every run, and named counters keep their counts through that.netusage.shandvpc_netusage.shappend the IPv6 counts to the IPv4 ones. Every hypervisor adds up that output in sent/received pairs, so no Java changes are needed. Resetting usage resets both families.network.usage.exempt.cidrs(from Allow exclusion of chosen addresses from virtual router usage counters #14583) are left out of the IPv6 counts on forwarded traffic, the same way Allow exclusion of chosen addresses from virtual router usage counters #14583 does it for IPv4.postinit.shresets the IPv6 counts after restoring the saved ruleset at boot, so they start from zero like the iptables ones.Release note, to be added to
PendingReleaseNotesonce a target release is assigned:Fixes: #14591
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Screenshots (if appropriate):
How Has This Been Tested?
TestCsIpv6Usage(the generated rules for isolated and VPC routers, exempt addresses, removed tiers, and routers that are left alone) andTestCsConfig.netusage.sh/vpc_netusage.shoutput, to the byte. Pings to an exempt address added nothing.How did you try to break this feature and the system with this change?
postinit.shbrought them back to zero.-rwhile per-interface counters held traffic. Only the global ones went to zero.