cloudstack icon indicating copy to clipboard operation
cloudstack copied to clipboard

Save systemvm template details for cpvm, ssvm and vr's.

Open BartJM opened this issue 1 year ago • 55 comments
trafficstars

Description

This PR adds saving systemvm template settings to the user_vm_details table. Allows systemvms to start with details specified in the systemvm template settings.

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

Change systemvm template settings to add iothreads and io.policy. Recreate ssvm, cpvm and vr and verified the details are in the db and the vms are running with the change.

Ran on a ubuntu 20.04 manager, 22.04 kvm host testing env and mbx kvm centos8 env.

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

BartJM avatar Sep 23 '24 10:09 BartJM

Congratulations on your first Pull Request and welcome to the Apache CloudStack community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md) Here are some useful points:

  • In case of a new feature add useful documentation (raise doc PR at https://github.com/apache/cloudstack-documentation)
  • Be patient and persistent. It might take some time to get a review or get the final approval from the committers.
  • Pay attention to the quality of your code, ensure tests are passing and your PR doesn't have conflicts.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Issues, Mailing list and Slack.
  • Be sure to read the CloudStack Coding Conventions. Apache CloudStack is a community-driven project and together we are making it better 🚀. In case of doubts contact the developers at: Mailing List: [email protected] (https://cloudstack.apache.org/mailing-lists.html) Slack: https://apachecloudstack.slack.com/

boring-cyborg[bot] avatar Sep 23 '24 10:09 boring-cyborg[bot]

Codecov Report

:x: Patch coverage is 31.42857% with 24 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 16.14%. Comparing base (f2a6a2f) to head (69d2347). :warning: Report is 144 commits behind head on 4.20.

Files with missing lines Patch % Lines
...in/java/com/cloud/vm/dao/UserVmDetailsDaoImpl.java 0.00% 15 Missing :warning:
...n/java/com/cloud/vm/VirtualMachineManagerImpl.java 0.00% 3 Missing :warning:
.../src/main/java/com/cloud/vm/UserVmManagerImpl.java 40.00% 3 Missing :warning:
...n/java/com/cloud/capacity/CapacityManagerImpl.java 0.00% 2 Missing :warning:
...om/cloud/network/element/VirtualRouterElement.java 0.00% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff            @@
##               4.20    #9721   +/-   ##
=========================================
  Coverage     16.13%   16.14%           
- Complexity    13239    13240    +1     
=========================================
  Files          5656     5656           
  Lines        497622   497631    +9     
  Branches      60339    60342    +3     
=========================================
+ Hits          80302    80328   +26     
+ Misses       408370   408357   -13     
+ Partials       8950     8946    -4     
Flag Coverage Δ
uitests 4.00% <ø> (ø)
unittests 16.99% <31.42%> (+<0.01%) :arrow_up:

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Sep 23 '24 14:09 codecov[bot]

@blueorangutan package

weizhouapache avatar Sep 24 '24 07:09 weizhouapache

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

blueorangutan avatar Sep 24 '24 07:09 blueorangutan

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

blueorangutan avatar Sep 24 '24 08:09 blueorangutan

@blueorangutan package

DaanHoogland avatar Sep 27 '24 09:09 DaanHoogland

@DaanHoogland 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 avatar Sep 27 '24 09:09 blueorangutan

With the new changes also tested the following on mbx centos8 kvm for user vms. All changes were reflected in the database as expected.

  • Create a vm with ssh key,
  • Create password enabled vm with ssh key.
  • Reset ssh key and password.
  • Set iothreads enabled and io.policy to storage_specific.
  • Create a vm with custom offering, change the custom values and change offering to fixed
  • Change vm with fixed offering to custom offering

BartJM avatar Sep 27 '24 09:09 BartJM

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

blueorangutan avatar Sep 27 '24 10:09 blueorangutan

@blueorangutan test

DaanHoogland avatar Sep 27 '24 11:09 DaanHoogland

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

blueorangutan avatar Sep 27 '24 11:09 blueorangutan

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

Test Result Time (s) Test File
test_03_create_iso_with_checksum_md5 Error 66.48 test_iso.py
ContextSuite context=TestISOUsage>:setup Error 0.00 test_usage.py
test_disable_oobm_ha_state_ineligible Error 288.31 test_hostha_kvm.py
test_hostha_configure_default_driver Error 77.00 test_hostha_kvm.py
test_hostha_enable_ha_when_host_disabled Error 87.68 test_hostha_kvm.py
test_hostha_enable_ha_when_host_disconected Error 156.97 test_hostha_kvm.py
test_hostha_enable_ha_when_host_in_maintenance Error 151.03 test_hostha_kvm.py
test_hostha_kvm_host_degraded Error 76.92 test_hostha_kvm.py
test_hostha_kvm_host_fencing Error 35.70 test_hostha_kvm.py
test_hostha_kvm_host_recovering Error 34.50 test_hostha_kvm.py
test_remove_ha_provider_not_possible Error 37.59 test_hostha_kvm.py

blueorangutan avatar Sep 28 '24 06:09 blueorangutan

I cannot relate any of the errors to the code (yet) trying insanity first.

DaanHoogland avatar Sep 30 '24 13:09 DaanHoogland

@blueorangutan package

DaanHoogland avatar Sep 30 '24 13:09 DaanHoogland

@DaanHoogland 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 avatar Sep 30 '24 13:09 blueorangutan

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

blueorangutan avatar Sep 30 '24 14:09 blueorangutan

@blueorangutan test

DaanHoogland avatar Sep 30 '24 15:09 DaanHoogland

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

blueorangutan avatar Sep 30 '24 15:09 blueorangutan

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

Test Result Time (s) Test File

blueorangutan avatar Oct 01 '24 05:10 blueorangutan

Not sure if we have been already using the user_vm_details table for storing the details of the system VMs but it doesn't sound right to me .

shwstppr avatar Nov 23 '24 21:11 shwstppr

Not sure if we have been already using the user_vm_details table for storing the details of the system VMs but it doesn't sound right to me .

@shwstppr , I share your concern but can you expand on your concerns?

I do agree somewhat and the systems are not user_vms thus their details should maybe be in another table, so an alternative could be creating another details table...? I think we should have a quick discuss about this.

DaanHoogland avatar Nov 25 '24 10:11 DaanHoogland

Not sure if we have been already using the user_vm_details table for storing the details of the system VMs but it doesn't sound right to me .

@shwstppr , I share your concern but can you expand on your concerns?

I do agree somewhat and the systems are not user_vms thus their details should maybe be in another table, so an alternative could be creating another details table...? I think we should have a quick discuss about this.

or rename the table to vm_instance_details for example ? it requires some sql/java changes I think it is a minor issue, we can test/merge this PR and improve it afterwards. what do you think @shwstppr @DaanHoogland

weizhouapache avatar Nov 25 '24 10:11 weizhouapache

@weizhouapache @DaanHoogland cc @BartJM I'm not against with the change as such. I agree that it is just structural change. Maybe we can create an improvement issue for tracking and continue with this PR? I'll also have a look into the code to see if I can give some suggestion for either renaming the table or using a different table.

shwstppr avatar Nov 25 '24 10:11 shwstppr

well, I'm not against fixing after merging but think we should not release with this change and then try to fix in a next release.

DaanHoogland avatar Nov 25 '24 11:11 DaanHoogland

after a short backtalk with @shwstppr and @weizhouapache , I think we can merge this PR given issue #9975

DaanHoogland avatar Nov 26 '24 10:11 DaanHoogland

@blueorangutan package

Pearl1594 avatar Feb 14 '25 14:02 Pearl1594

@Pearl1594 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 avatar Feb 14 '25 14:02 blueorangutan

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

blueorangutan avatar Feb 14 '25 15:02 blueorangutan

I've targeted this against 4.20.

Pearl1594 avatar Feb 14 '25 15:02 Pearl1594

@blueorangutan package

Pearl1594 avatar Feb 14 '25 15:02 Pearl1594