Skip to content

Allow altering only either CPU or memory during VM live scale#8234

Merged
GutoVeronezi merged 4 commits intoapache:mainfrom
scclouds:allow_change_one_parameter_on_live_scale
Feb 14, 2024
Merged

Allow altering only either CPU or memory during VM live scale#8234
GutoVeronezi merged 4 commits intoapache:mainfrom
scclouds:allow_change_one_parameter_on_live_scale

Conversation

@GaOrtiga
Copy link
Contributor

Description

The API scaleVirtualMachine requires the specification of both vCPU quantity and memory amount, resulting in an error if either was omitted. This means that if an operator wants to increase the quantity of vCPUs while maintaining the existing memory, they were obligate to provide the current memory value as well.

An alteration has been introduced to the API to allow operators to input only the parameters they intend to modify while retaining the current values for the rest.

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

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

How Has This Been Tested?

I applied the changes in a local lab and verified that if I used the API while inputting only one of the parameters, the scale was successful, and the others kept the current value.

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.

agree with @hsato03 , code lgtm otherwise

@codecov
Copy link

codecov bot commented Nov 15, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (399bd0a) 30.90% compared to head (17f64f4) 30.74%.
Report is 19 commits behind head on main.

Files Patch % Lines
.../src/main/java/com/cloud/vm/UserVmManagerImpl.java 92.85% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8234      +/-   ##
============================================
- Coverage     30.90%   30.74%   -0.17%     
+ Complexity    34142    33040    -1102     
============================================
  Files          5353     5352       -1     
  Lines        375900   374473    -1427     
  Branches      54629    54610      -19     
============================================
- Hits         116158   115114    -1044     
+ Misses       244428   244096     -332     
+ Partials      15314    15263      -51     
Flag Coverage Δ
simulator-marvin-tests 24.58% <64.28%> (-0.13%) ⬇️
uitests 4.38% <ø> (-0.01%) ⬇️
unit-tests 16.41% <78.57%> (-0.21%) ⬇️

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.

@DaanHoogland
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@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
Copy link

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

@DaanHoogland
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

Test Result Time (s) Test File
test_02_upgrade_kubernetes_cluster Failure 565.05 test_kubernetes_clusters.py
test_08_migrate_vm Error 0.07 test_vm_life_cycle.py

Copy link
Contributor

@JoaoJandre JoaoJandre 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 it

@GutoVeronezi
Copy link
Contributor

@hsato03, are all your concerns met?

Just for the sake: @blueorangutan package

@blueorangutan
Copy link

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

Copy link
Member

@hsato03 hsato03 left a comment

Choose a reason for hiding this comment

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

@hsato03, are all your concerns met?

Just for the sake: @blueorangutan package

Yes, didn't test but CLGTM.

@blueorangutan
Copy link

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

@DaanHoogland DaanHoogland added this to the 4.19.0.0 milestone Nov 29, 2023
@borisstoyanov borisstoyanov self-assigned this Nov 29, 2023
@shwstppr
Copy link
Contributor

shwstppr commented Dec 6, 2023

@borisstoyanov are you doing tests on this?

@github-actions
Copy link

github-actions bot commented Dec 7, 2023

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

@GaOrtiga GaOrtiga force-pushed the allow_change_one_parameter_on_live_scale branch from b9759d0 to 1de263a Compare December 7, 2023 13:08
@shwstppr
Copy link
Contributor

shwstppr commented Dec 8, 2023

@blueorangutan package

@blueorangutan
Copy link

@shwstppr 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]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 7981

@DaanHoogland
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

Test Result Time (s) Test File
test_02_list_cpvm_vm Failure 0.03 test_ssvm.py
test_04_cpvm_internals Failure 0.03 test_ssvm.py

@shwstppr shwstppr removed this from the 4.19.0.0 milestone Dec 14, 2023
@github-actions
Copy link

github-actions bot commented Feb 5, 2024

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

@GaOrtiga GaOrtiga force-pushed the allow_change_one_parameter_on_live_scale branch from 1de263a to d05f25f Compare February 6, 2024 16:57
@DaanHoogland
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@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
Copy link

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

@DaanHoogland
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

Test Result Time (s) Test File

@DaanHoogland
Copy link
Contributor

@GaOrtiga this had already passed but needs new attention since the log upgrade

Co-authored-by: João Jandre <48719461+JoaoJandre@users.noreply.github.com>
@DaanHoogland
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@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
Copy link

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

@yadvr
Copy link
Member

yadvr commented Feb 13, 2024

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

Test Result Time (s) Test File

@GutoVeronezi
Copy link
Contributor

Merging based on approvals, packaging and test results.

@GutoVeronezi GutoVeronezi merged commit a31449b into apache:main Feb 14, 2024
@DaanHoogland
Copy link
Contributor

As this is merged into main, I am setting the milestone to 20

@DaanHoogland DaanHoogland modified the milestones: 4.19.1.0, 4.20.0.0 Feb 15, 2024
@weizhouapache
Copy link
Member

@DaanHoogland @GutoVeronezi
has anyone tested this PR ?


updateInstanceDetails(cmdDetails, vm, newServiceOfferingId);

boolean result = upgradeVirtualMachine(vmId, newServiceOfferingId, cmdDetails);
Copy link
Member

Choose a reason for hiding this comment

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

Sorry for late review.

@GaOrtiga
if the upgrade fail, should the details be restored to the original values ?

ping @DaanHoogland @GutoVeronezi , anyone has tested it ?

Copy link
Contributor

Choose a reason for hiding this comment

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

ping @DaanHoogland @GutoVeronezi , anyone has tested it ?

Yes, it was tested.

if the upgrade fail, should the details be restored to the original values ?

The PR does not address changes to this behavior. it remains the same; we can discuss it in an issue or another PR.

Copy link
Member

Choose a reason for hiding this comment

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

ping @DaanHoogland @GutoVeronezi , anyone has tested it ?

Yes, it was tested.

Ok, I asked it because I did not see a comment mentioning it has been manually tested ok. If not, it would be good to be manually tested.
Why has tested it, except the author?

if the upgrade fail, should the details be restored to the original values ?

The PR does not address changes to this behavior. it remains the same; we can discuss it in an issue or another PR.

Do you think it is a regression of this PR we should address?

Copy link
Contributor

Choose a reason for hiding this comment

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

Why has tested it, except the author?

I don't think I understood your question.

Do you think it is a regression of this PR we should address?

The PR does not address changes to method upgradeVirtualMachine; therefore, the topic you are questioning would not be a regression of this PR.

Copy link
Member

@weizhouapache weizhouapache Feb 16, 2024

Choose a reason for hiding this comment

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

Why has tested it, except the author?

I don't think I understood your question.

Sorry typo.
Who has tested it, except the author?

Do you think it is a regression of this PR we should address?

The PR does not address changes to method upgradeVirtualMachine; therefore, the topic you are questioning would not be a regression of this PR.

please ignore my question regarding the vm details, They are not saved in database before upgrade, so no need to restore.

Copy link
Contributor

Choose a reason for hiding this comment

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

Who has tested it, except the author?

I tested it; I do not know if anybody else has tested it too.

please ignore my question regarding the vm details, They are not saved in database before upgrade, so no need to restore.

Yes. The only thing this PR does is facilitate calling the API. For instance, without this PR, if one has a VM with 1 vCPU and 1 GB RAM and wants to scale it to 2 GB RAM, one has to call the API with both the current vCPU count and the new RAM size. With this PR, one will only have to pass the new RAM size in the parameters; ACS will retrieve the current VM's vCPU count and will add it to the details map to be updated; thus, passing the current vCPU count and the new RAM size will have the same behavior as just passing the new RAM size. It just updates the details map (if necessary) before scaling the VM. This applies to RAM, frequency and vCPU.

I created PR #8673 to improve the methods names and docs.

dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Feb 20, 2024
…#8234)

* allow change only one parameter during live scale

* Update server/src/main/java/com/cloud/vm/UserVmManagerImpl.java

Co-authored-by: sato03 <henriquesato2003@gmail.com>

* apply change method name

* Update server/src/main/java/com/cloud/vm/UserVmManagerImpl.java

Co-authored-by: João Jandre <48719461+JoaoJandre@users.noreply.github.com>

---------

Co-authored-by: Gabriel <gabriel.fernandes@scclouds.com.br>
Co-authored-by: sato03 <henriquesato2003@gmail.com>
Co-authored-by: João Jandre <48719461+JoaoJandre@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants