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

Fix NPE issues during host rolling maintenance, due to host tags and custom constrained/unconstrained service offering #9844

Open
wants to merge 2 commits into
base: 4.19
Choose a base branch
from

Conversation

sureshanaparti
Copy link
Contributor

@sureshanaparti sureshanaparti commented Oct 23, 2024

Description

This PR fixes NPE issues during host rolling maintenance, due to host tags and custom constrained/unconstrained service offering.

Fixes #9834 & #9836

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?

Tested host rolling maintenance with custom constrained/unconstrained service offering & service offering without host tags, checked the rolling maintenance cmd sent to KVM host without any NPEs.

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

…custom constrained/unconstrained service offering
@sureshanaparti
Copy link
Contributor Author

@blueorangutan package

@sureshanaparti sureshanaparti added this to the 4.19.2.0 milestone Oct 23, 2024
Copy link

codecov bot commented Oct 23, 2024

Codecov Report

Attention: Patch coverage is 45.45455% with 18 lines in your changes missing coverage. Please review.

Project coverage is 15.11%. Comparing base (175eed2) to head (e5e60d8).
Report is 1 commits behind head on 4.19.

Files with missing lines Patch % Lines
.../cloud/resource/RollingMaintenanceManagerImpl.java 45.45% 13 Missing and 5 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.19    #9844      +/-   ##
============================================
+ Coverage     15.08%   15.11%   +0.02%     
- Complexity    11203    11226      +23     
============================================
  Files          5404     5404              
  Lines        473423   473453      +30     
  Branches      59987    61557    +1570     
============================================
+ Hits          71429    71567     +138     
+ Misses       394044   393881     -163     
- Partials       7950     8005      +55     
Flag Coverage Δ
uitests 4.30% <ø> (ø)
unittests 15.83% <45.45%> (+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.

@sureshanaparti
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@sureshanaparti 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

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

@sureshanaparti
Copy link
Contributor Author

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

Test Result Time (s) Test File
test_03_secured_to_nonsecured_vm_migration Error 441.17 test_vm_life_cycle.py

Copy link
Member

@vishesh92 vishesh92 left a comment

Choose a reason for hiding this comment

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

clgtm. didn't test

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

@borisstoyanov borisstoyanov self-assigned this Nov 1, 2024
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, following the steps I couldn't reproduce

@sureshanaparti
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@sureshanaparti 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

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

@sureshanaparti
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@sureshanaparti 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

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

Copy link
Contributor

@harikrishna-patnala harikrishna-patnala 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

@rohityadavcloud
Copy link
Member

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

[SF] Trillian test result (tid-11759)
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 44924 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr9844-t11759-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

Comment on lines +690 to +705
if (serviceOffering.isDynamic()) {
List<UserVmDetailVO> vmDetails = userVmDetailsDao.listDetails(runningVM.getId());
if (CollectionUtils.isNotEmpty(vmDetails)) {
for (UserVmDetailVO vmDetail : vmDetails) {
if (vmDetail.getName() != null && vmDetail.getValue() != null) {
if (cpu == null && VmDetailConstants.CPU_NUMBER.equals(vmDetail.getName())) {
cpu = Integer.valueOf(vmDetail.getValue());
} else if (speed == null && VmDetailConstants.CPU_SPEED.equals(vmDetail.getName())) {
speed = Integer.valueOf(vmDetail.getValue());
} else if (ramSize == null && VmDetailConstants.MEMORY.equals(vmDetail.getName())) {
ramSize = Integer.valueOf(vmDetail.getValue());
}
}
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if (serviceOffering.isDynamic()) {
List<UserVmDetailVO> vmDetails = userVmDetailsDao.listDetails(runningVM.getId());
if (CollectionUtils.isNotEmpty(vmDetails)) {
for (UserVmDetailVO vmDetail : vmDetails) {
if (vmDetail.getName() != null && vmDetail.getValue() != null) {
if (cpu == null && VmDetailConstants.CPU_NUMBER.equals(vmDetail.getName())) {
cpu = Integer.valueOf(vmDetail.getValue());
} else if (speed == null && VmDetailConstants.CPU_SPEED.equals(vmDetail.getName())) {
speed = Integer.valueOf(vmDetail.getValue());
} else if (ramSize == null && VmDetailConstants.MEMORY.equals(vmDetail.getName())) {
ramSize = Integer.valueOf(vmDetail.getValue());
}
}
}
}
}
if (!serviceOffering.isDynamic()) {
return new Ternary<>(cpu, speed, ramSize);
}
List<UserVmDetailVO> vmDetails = userVmDetailsDao.listDetails(runningVM.getId());
if (CollectionUtils.isEmpty(vmDetails)) {
return new Ternary<>(cpu, speed, ramSize);
}
for (UserVmDetailVO vmDetail : vmDetails) {
if (vmDetail.getName() != null && vmDetail.getValue() != null) {
if (cpu == null && VmDetailConstants.CPU_NUMBER.equals(vmDetail.getName())) {
cpu = Integer.valueOf(vmDetail.getValue());
} else if (speed == null && VmDetailConstants.CPU_SPEED.equals(vmDetail.getName())) {
speed = Integer.valueOf(vmDetail.getValue());
} else if (ramSize == null && VmDetailConstants.MEMORY.equals(vmDetail.getName())) {
ramSize = Integer.valueOf(vmDetail.getValue());
}
}
}

Copy link
Member

Choose a reason for hiding this comment

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

It's probably something we can deal in a separate PR? cc @sureshanaparti

Copy link
Contributor

Choose a reason for hiding this comment

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

Its a very simple change for readability, do we really need another PR for it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
8 participants