Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Deletion of LB Rules not reported in Cloud Usage #10789

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

Open
KuasarCloud opened this issue Apr 29, 2025 · 3 comments · May be fixed by #10712
Open

Deletion of LB Rules not reported in Cloud Usage #10789

KuasarCloud opened this issue Apr 29, 2025 · 3 comments · May be fixed by #10712
Assignees
Milestone

Comments

@KuasarCloud
Copy link

KuasarCloud commented Apr 29, 2025

Problem

When a Load Balancer Rule inside a VPC tier is deleted—either explicitly or as a result of disassociating the underlying Public IP—CloudStack logs the deletion event correctly in the event table (LB.CREATE and LB.DELETE). However, the deletion is not reflected in the cloud_usage.usage_load_balancer_policy table managed by the Cloud Usage service.

As a result, the delete_date field remains NULL, and Cloud Usage continues to generate usage records indefinitely for a resource that no longer exists. This causes inaccurate usage reporting and potentially incorrect billing.

Versions

•	CloudStack version: Affected in versions > 4.18
•	Hypervisor: KVM
•	Network type: VPC with Tiers

Steps to Reproduce the Bug

1.	Create a VPC with at least one tier.
2.	Acquire a Public IP address and associate it with the tier.
3.	Create a Load Balancer Rule using that Public IP.
4.	Delete the Load Balancer Rule, or disassociate the Public IP from the tier.
5.	Confirm that CloudStack logs the LB.DELETE event in the event table.
6.	Wait for the Cloud Usage service to run and check the usage_load_balancer_policy table.
7.	Observe that the delete_date remains NULL and usage records continue to be generated.

What to Do About It

•	Investigate why the Cloud Usage service does not correctly register the LB.DELETE event into the usage_load_balancer_policy table.
•	Review the logic that processes deletion events for Load Balancer policies in the Cloud Usage module.
•	Patch the usage processor to ensure that deletions are properly handled and that the delete_date is updated.
@winterhazel
Copy link
Member

Hey @KuasarCloud, thanks for the detailed report.

The cause of this issue was already patched on 4.20.1 with #9888. The LB.DELETE event was being published and processed, but there was an error in the query used to find LB rules to stop generating usage records.

This will be addressed in 4.19.3 as well. I already opened a PR backporting #9888 to 4.19.3 (#10712), but want to make some other adjustments before the merge.

Also, I'm working on a normalization script to address environments that were affected by this bug.

@winterhazel winterhazel self-assigned this Apr 29, 2025
@KuasarCloud
Copy link
Author

Thanks @winterhazel for stepping in, so you think I may close this issue already, right?

Regards

@winterhazel
Copy link
Member

@KuasarCloud I think we can wait to close this after #10712 gets merged

@DaanHoogland DaanHoogland linked a pull request Apr 30, 2025 that will close this issue
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants