Skip to content

[Usage] Create VPC billing#7235

Merged
DaanHoogland merged 11 commits intoapache:4.19from
scclouds:usage-vpc-billing
Apr 22, 2024
Merged

[Usage] Create VPC billing#7235
DaanHoogland merged 11 commits intoapache:4.19from
scclouds:usage-vpc-billing

Conversation

@SadiJr
Copy link
Copy Markdown
Contributor

@SadiJr SadiJr commented Feb 15, 2023

Description

The usage of VPCs are not captured and saved by the Usage plugin, which makes it impossible to charge via the Quota plugin. The Usage plugin has extended, to save the VPC events in database. When a VPC is created, the event EVENT_VPC_CREATE is used; when a VPC is removed, the event EVENT_VPC_DELETE is used. Also, this new type has the attributes value.id and value.name injected in the Quota plugin.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Feature/Enhancement Scale or Bug Severity

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

It was tested in a local lab:

  1. I created and destroyed VPCs via UI;
  2. Before, ACS did not save any VPC event in Usage;
  3. Now, ACS saves these events in Usage.

@DaanHoogland
Copy link
Copy Markdown
Contributor

Wouw, I would not have guessed this omission was there, good work @SadiJr

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 15, 2023

Codecov Report

Attention: Patch coverage is 7.64706% with 157 lines in your changes are missing coverage. Please review.

Project coverage is 30.99%. Comparing base (ffd5972) to head (518b79a).
Report is 11 commits behind head on 4.19.

Files Patch % Lines
...main/java/com/cloud/usage/dao/UsageVpcDaoImpl.java 3.12% 62 Missing ⚠️
...in/java/com/cloud/usage/parser/VpcUsageParser.java 0.00% 35 Missing ⚠️
...hema/src/main/java/com/cloud/usage/UsageVpcVO.java 8.33% 33 Missing ⚠️
...rc/main/java/com/cloud/usage/UsageManagerImpl.java 0.00% 15 Missing ⚠️
...tionrule/presetvariables/PresetVariableHelper.java 9.09% 10 Missing ⚠️
api/src/main/java/com/cloud/event/EventTypes.java 0.00% 1 Missing ⚠️
...ain/java/com/cloud/network/vpc/VpcManagerImpl.java 80.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.19    #7235      +/-   ##
============================================
+ Coverage     30.96%   30.99%   +0.02%     
- Complexity    34304    34387      +83     
============================================
  Files          5354     5359       +5     
  Lines        376105   376855     +750     
  Branches      54694    54831     +137     
============================================
+ Hits         116454   116790     +336     
- Misses       244336   244704     +368     
- Partials      15315    15361      +46     
Flag Coverage Δ
simulator-marvin-tests 24.86% <5.88%> (+0.05%) ⬆️
uitests 4.38% <ø> (-0.01%) ⬇️
unit-tests 16.56% <1.76%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment thread engine/schema/src/main/java/com/cloud/usage/dao/UsageVpcDaoImpl.java Outdated
Comment thread engine/schema/src/main/java/com/cloud/usage/dao/UsageVpcDaoImpl.java Outdated
@github-actions
Copy link
Copy Markdown

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

@sonarqubecloud
Copy link
Copy Markdown

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 11 Code Smells

0.5% 0.5% Coverage
3.5% 3.5% Duplication

Copy link
Copy Markdown
Contributor

@stephankruggg stephankruggg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM based on manual tests

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 6, 2023

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

@kiranchavala
Copy link
Copy Markdown
Member

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@kiranchavala a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result: ✖️ el7 ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 5688

@kiranchavala
Copy link
Copy Markdown
Member

@SadiJr Could you please resolve the merge conflicts

@sonarqubecloud
Copy link
Copy Markdown

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 11 Code Smells

0.5% 0.5% Coverage
3.5% 3.5% Duplication

@DaanHoogland
Copy link
Copy Markdown
Contributor

@SadiJr we can target this for 4.18.1 or for 4.19 . In any case th upgrade script needs to be altered (now using 4.17.2 to 4.18.0)

@SadiJr
Copy link
Copy Markdown
Contributor Author

SadiJr commented May 18, 2023

@DaanHoogland done, thanks for your suggestion.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 1, 2023

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Aug 7, 2023

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

@BryanMLima BryanMLima changed the base branch from main to 4.19 March 21, 2024 13:59
@BryanMLima
Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@BryanMLima a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9047

@apache apache deleted a comment from blueorangutan Apr 16, 2024
@apache apache deleted a comment from blueorangutan Apr 16, 2024
@DaanHoogland
Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

@DaanHoogland a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan
Copy link
Copy Markdown

[SF] Trillian Build Failed (tid-9853)

@blueorangutan
Copy link
Copy Markdown

[SF] Trillian Build Failed (tid-9868)

@blueorangutan
Copy link
Copy Markdown

[SF] Trillian Build Failed (tid-9872)

@blueorangutan
Copy link
Copy Markdown

[SF] Trillian test result (tid-9880)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 49576 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7235-t9880-kvm-centos7.zip
Smoke tests completed. 128 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_04_extract_Iso Failure 1.09 test_iso.py

@DaanHoogland
Copy link
Copy Markdown
Contributor

@stephankruggg did you test this?

@stephankruggg
Copy link
Copy Markdown
Contributor

@stephankruggg did you test this?

Yes, prior to approving this PR I ran the same tests as @SadiJr, as far as I can remember.

@DaanHoogland DaanHoogland merged commit 49d244f into apache:4.19 Apr 22, 2024
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request May 3, 2024
Co-authored-by: SadiJr <sadi@scclouds.com.br>
Co-authored-by: Bryan Lima <bryan.lima@hotmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Status: No status

Development

Successfully merging this pull request may close these issues.

6 participants