Skip to content

Conversation

@weizhouapache
Copy link
Member

Description

This PR fixes #9290

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)
  • build/CI
  • test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

@weizhouapache weizhouapache linked an issue Jan 20, 2025 that may be closed by this pull request
@weizhouapache
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@weizhouapache 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.

@codecov
Copy link

codecov bot commented Jan 20, 2025

Codecov Report

Attention: Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.

Project coverage is 15.86%. Comparing base (c5e8f63) to head (cc029cf).
Report is 8 commits behind head on 4.19.

Files with missing lines Patch % Lines
.../java/com/cloud/api/query/dao/HostJoinDaoImpl.java 0.00% 6 Missing ⚠️
...udstack/api/response/HostForMigrationResponse.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.19   #10218      +/-   ##
============================================
+ Coverage     15.13%   15.86%   +0.73%     
- Complexity    11274    11277       +3     
============================================
  Files          5408     5042     -366     
  Lines        474003   444186   -29817     
  Branches      57821    52629    -5192     
============================================
- Hits          71729    70471    -1258     
+ Misses       394256   365837   -28419     
+ Partials       8018     7878     -140     
Flag Coverage Δ
uitests ?
unittests 15.86% <0.00%> (+0.01%) ⬆️

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.

@weizhouapache
Copy link
Member Author

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

Test Result Time (s) Test File

Copy link
Contributor

@shwstppr shwstppr left a comment

Choose a reason for hiding this comment

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

code lgtm

@weizhouapache weizhouapache marked this pull request as ready for review January 21, 2025 13:36
DecimalFormat decimalFormat = new DecimalFormat("#.##");
if (host.getType() == Host.Type.Routing) {
float cpuOverprovisioningFactor = ApiDBUtils.getCpuOverprovisioningFactor(host.getClusterId());
hostResponse.setCpuNumber((int)(host.getCpus() * cpuOverprovisioningFactor));
Copy link
Member Author

Choose a reason for hiding this comment

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

this line is the main fix

the rest of the PR changes are on HostForMigrationResponse, which now extends HostResponse.
so removed lots of duplicated codes

cc @DaanHoogland @shwstppr

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, cpu number is already set and don't override it 👍 (see line 123)

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah,exactly

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

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

clgtm

@DaanHoogland DaanHoogland added this to the 4.19.2 milestone Jan 21, 2025
@borisstoyanov borisstoyanov self-assigned this Jan 22, 2025
Copy link
Contributor

@borisstoyanov borisstoyanov left a comment

Choose a reason for hiding this comment

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

LGTM

(localcloud) 🐱 > list hosts  filter=id,cpuallocatedvalue,cpunumber,cpusockets,cpuspeed,cpuwithoverprovisioning
{
  "count": 4,
  "host": [
    {
      "cpuallocatedvalue": 500,
      "cpunumber": 3,
      "cpusockets": 3,
      "cpuspeed": 2100,
      "cpuwithoverprovisioning": "12600",
      "id": "3358a313-2cb8-4859-b2c8-32d6e36b1369"
    }

While without the fix it shows cpunumber 6:

(localcloud) 🐱 > list hosts  filter=id,cpuallocatedvalue,cpunumber,cpusockets,cpuspeed,cpuwithoverprovisioning
{
  "count": 4,
  "host": [
    {
      "cpuallocatedvalue": 100,
      "cpunumber": 6,
      "cpusockets": 3,
      "cpuspeed": 2100,
      "cpuwithoverprovisioning": "12600",
      "id": "8e156f6f-f6c1-4551-a242-9c412a971351"
    },

@DaanHoogland DaanHoogland merged commit 09f1547 into apache:4.19 Jan 22, 2025
24 of 25 checks passed
@DaanHoogland DaanHoogland deleted the 4.19-fix-9290 branch January 22, 2025 14:44
rg9975 pushed a commit to rg9975/cloudstack that referenced this pull request Jan 31, 2025
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Jun 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong CPU mumber reported in list hosts

5 participants