GutoVeronezi opened a new pull request #4878:
URL: https://github.com/apache/cloudstack/pull/4878


   ### Description
   ACS has an API to scale VMs `scaleVirtualMachine`, however dynamic scale of 
VMs is limited to `XenServer` and `VMWare`.
   
   This PR intends suport live scale for VMs on `KVM`.
   
   When we are using a custom service offerings, KVM's XML only receives the 
boot memory, but with this changes it will receive the max values defined in 
the service offerings. If it is a unconstrainced service offering, max values 
will be the `vm.serviceoffering.cpu.cores.max` and 
`vm.serviceoffering.ram.size.max` values . If they are `0`, max values will be 
host or last host capacities.
   
   ### Types of changes
   - [ ] Breaking change (fix or feature that would cause existing 
functionality to change)
   - [x] 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)
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Feature/Enhancement Scale
   - [ ] Major
   - [x] Minor
   
   ### How Has This Been Tested?
   I created unit tests for the code that is being introduced here. Moreover, 
it has been tested locally in a test lab. I created multiples VMs with 
multiples definitions and tested API with they:
   
   | VM STATE | INIT CPU CORES | UP TO | INIT RAM SIZE | UP TO | SERVICE 
OFFERING | RAM SERVICE OFFERING | CPU SERVICE OFFERING | MAX RAM CONFIG | MAX 
CPU CONFIG | EXPECTED RESULT |
   | -------- | --------- | ----- | -------- | ----- | ---------------- | 
-------------------- | -------------------- | -------------- | -------------- | 
--------------- |
   | RUNNING | 1 | 3 | 64 | 128 | CONSTRAINED | 256 | 2 | 512 | 4 | FAIL |
   | RUNNING | 1 | 2 | 64 | 257 | CONSTRAINED | 256 | 2 | 512 | 4 | FAIL |
   | RUNNING | 1 | 2 | 128 | 64 | CONSTRAINED | 256 | 2 | 512 | 4 | FAIL |
   | RUNNING | 2 | 1 | 64 | 64 | CONSTRAINED | 256 | 2 | 512 | 4 | FAIL |
   | STOPPED | 1 | 3 | 64 | 128 | CONSTRAINED | 256 | 2 | 512 | 4 | FAIL |
   | STOPPED | 1 | 2 | 64 | 257 | CONSTRAINED | 256 | 2 | 512 | 4 | FAIL |
   | RUNNING | 1 | 2 | 64 | 128 | CONSTRAINED | 256 | 2 | 512 | 4 | SUCCESS |
   | RUNNING | 1 | 1 | 64 | 128 | CONSTRAINED | 256 | 2 | 512 | 4 | SUCCESS |
   | RUNNING | 1 | 2 | 64 | 64 | CONSTRAINED | 256 | 2 | 512 | 4 | SUCCESS |
   | STOPPED | 1 | 2 | 128 | 64 | CONSTRAINED | 256 | 2 | 512 | 4 | SUCCESS |
   | STOPPED | 2 | 1 | 64 | 64 | CONSTRAINED | 256 | 2 | 512 | 4 | SUCCESS |
   | STOPPED | 1 | 1 | 64 | 128 | CONSTRAINED | 256 | 2 | 512 | 4 | SUCCESS |
   | STOPPED | 1 | 1 | 128 | 64 | CONSTRAINED | 256 | 2 | 512 | 4 | SUCCESS |
   | RUNNING | 1 | 2 | 128 | 64 | UNCONSTRAINED |  |  | 512 | 4 | FAIL |
   | RUNNING | 2 | 1 | 64 | 64 | UNCONSTRAINED |  |  | 512 | 4 | FAIL |
   | STOPPED | 1 | 2 | 128 | 64 | UNCONSTRAINED |  |  | 512 | 4 | SUCCESS |
   | STOPPED | 2 | 1 | 64 | 64 | UNCONSTRAINED |  |  | 512 | 4 | SUCCESS |
   | RUNNING | 1 | 3 | 64 | 128 | UNCONSTRAINED |  |  | 512 | 4 | FAIL |
   | STOPPED | 1 | 1 | 64 | 4000 | UNCONSTRAINED |  |  | 512 | 4 | FAIL |
   | RUNNING | 1 | 2 | 64 | 128 | UNCONSTRAINED |  |  | 512 | 4 | SUCCESS |
   | RUNNING | 1 | 1 | 64 | 128 | UNCONSTRAINED |  |  | 512 | 4 | SUCCESS |
   | RUNNING | 1 | 2 | 64 | 64 | UNCONSTRAINED |  |  | 512 | 4 | SUCCESS |
   | RUNNING | 1 | 2 | 64 | 257 | UNCONSTRAINED |  |  | 512 | 4 | SUCCESS |
   | RUNNING | 1 | 1 | 64 | 700 | UNCONSTRAINED |  |  | 0 | 0 | SUCCESS |
   | STOPPED | 1 | 2 | 64 | 128 | UNCONSTRAINED |  |  | 512 | 4 | SUCCESS |
   | STOPPED | 1 | 1 | 64 | 128 | UNCONSTRAINED |  |  | 512 | 4 | SUCCESS |
   | STOPPED | 1 | 2 | 64 | 64 | UNCONSTRAINED |  |  | 512 | 4 | SUCCESS |
   | STOPPED | 1 | 2 | 64 | 257 | UNCONSTRAINED |  |  | 512 | 4 | SUCCESS |
   | STOPPED | 1 | 1 | 64 | 700 | UNCONSTRAINED |  |  | 512 | 4 | FAIL |
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to