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 on updating security groups for an instance #10493

Open
wants to merge 1 commit into
base: 4.20
Choose a base branch
from

Conversation

vishesh92
Copy link
Member

Description

This PR fixes #10347

Details

This pull request includes changes to the UserVmManagerImpl class and UI components to improve the handling of security groups for virtual machines. The most important changes include refactoring the security group update logic and adding UI support for security groups.

Backend changes:

UI changes:

  • ui/src/views/compute/EditVM.vue: Modified the security group enablement check to fall back on a Vuex store getter if the zone response does not provide the information. This ensures that the UI correctly reflects the security group support status.
  • ui/src/views/compute/InstanceTab.vue: Added a new state variable showUpdateSecurityGroupsModal to manage the visibility of the security group update modal in the instance tab. This prepares the UI for future enhancements to support security group updates directly from the instance tab.

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
  • [ x] 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?

Copy link

codecov bot commented Mar 3, 2025

Codecov Report

Attention: Patch coverage is 23.07692% with 20 lines in your changes missing coverage. Please review.

Project coverage is 15.98%. Comparing base (b92fd17) to head (351b012).

Files with missing lines Patch % Lines
.../src/main/java/com/cloud/vm/UserVmManagerImpl.java 23.07% 14 Missing and 6 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.20   #10493      +/-   ##
============================================
- Coverage     15.98%   15.98%   -0.01%     
+ Complexity    13086    13085       -1     
============================================
  Files          5650     5650              
  Lines        495756   495760       +4     
  Branches      60018    60017       -1     
============================================
- Hits          79261    79257       -4     
- Misses       407641   407646       +5     
- Partials       8854     8857       +3     
Flag Coverage Δ
uitests 4.00% <ø> (ø)
unittests 16.82% <23.07%> (-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.

@vishesh92 vishesh92 force-pushed the fixup-update-security branch from 1a1eec2 to 351b012 Compare March 3, 2025 19:18
@vishesh92
Copy link
Member Author

@blueorangutan package

@apache apache deleted a comment from blueorangutan Mar 3, 2025
@blueorangutan
Copy link

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

}
}

if (_networkModel.checkSecurityGroupSupportForNetwork(
Copy link
Member

Choose a reason for hiding this comment

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

is there any issue if check all networks instead of the default network here ?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's possible for a VM to have an isolated network as the default network and a shared network with SG as a second one. In this case if we don't check for all networks, security groups won't get updated.

@blueorangutan
Copy link

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

@vishesh92
Copy link
Member Author

@blueorangutan test keepEnv

@blueorangutan
Copy link

@vishesh92 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-12545)
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 59242 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10493-t12545-kvm-ol8.zip
Smoke tests completed. 140 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_06_purge_expunged_vm_background_task Failure 394.83 test_purge_expunged_vms.py

@Pearl1594 Pearl1594 linked an issue Mar 5, 2025 that may be closed by this pull request
@vishesh92 vishesh92 marked this pull request as ready for review March 11, 2025 19:15
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.

Unable to update the security groups of a VM
3 participants