Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating a firewall section resets hit count statistics #597

Closed
rokett opened this issue Mar 21, 2021 · 3 comments · Fixed by #786
Closed

Updating a firewall section resets hit count statistics #597

rokett opened this issue Mar 21, 2021 · 3 comments · Fixed by #786
Labels
enhancement Enhancement stale Stale

Comments

@rokett
Copy link

rokett commented Mar 21, 2021

The hit count statistics on each rule within a firewall policy whenever any of the following happens:

  1. An existing rule within the firewall policy is changed.
  2. A new rule is added to the firewall policy.
  3. A rule is removed from the firewall policy.

I have verified that, when doing any of these actions within the NSX Manager GUI, the stats remain. It is only when making changes via Terraform that the stats get reset.

Maybe this is an unavoidable consequence of making changes via the API? The comment at

// We need to use PUT, because PATCH will not replace the whole rule list
suggested that the whole firewall section got replaced, which aligns with the NSX-T API docs (we're using v2.5.1 currently) where a PUT replaced all of the rules. Saying that, PATCH also references a full replace, but with slightly different wording. I'm guessing a PUT is used due to the underlying way that Terraform works though.

We work around this problem at the moment by pulling out the rule stats in our CI pipeline before we apply changes, but it would be great if it was fixable so we didn't need to do that.

Any thoughts?

@annakhm annakhm added the enhancement Enhancement label Mar 25, 2021
@annakhm
Copy link
Collaborator

annakhm commented Mar 25, 2021

Thanks @rokett for this observation. We're considering rewriting the resource with Hierarchical API, which would fix this problem. This issue would be another argument for doing this.

@github-actions
Copy link

Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.

If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!

@github-actions github-actions bot added the stale Stale label Mar 21, 2022
@annakhm
Copy link
Collaborator

annakhm commented Sep 8, 2022

Reopening this - fix is in the making.

@annakhm annakhm reopened this Sep 8, 2022
@annakhm annakhm linked a pull request Sep 8, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement stale Stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants