GabrielBrascher opened a new pull request #4341:
URL: https://github.com/apache/cloudstack/pull/4341


   Service Offering allows ADMINs to set multiple parameters such as IOPS, 
memory, and CPU; however, we still are not able to configure the Root Disk size 
of a VM via service Offering.
   
   This PR adds control over the Root disk size and therefore helps providers 
that want to enforce the root disk size in the same way that it is done with 
compute offering.
   
   How does it work?
   - If the Service Offering is created without setting root disk size, all 
operations over root volume size are done as currently.
   - If a Service Offering is created with a root disk size, then there are a .
   
   1. Users cannot deploy VMs with custom root disk size when using such 
offerings
   2. Users cannot resize the VM root disk size when using such offerings
   3. the Root Volume of such VMs can only be resized when changing to another 
Service Offering with a Root disk size equals or larger than the current one.
   4. Users can change the VM offering to a service offering with a Root size 
of 0GB (default), and then customize the volume size.
   
   
   To easily view all possible service offering re
   
   | # | Service Offering Root size | new Service Offering Root | Does support 
offering resize? |
   
|---|----------------------------|---------------------------|-------------------------------|
   | 1 | 0GB (default)              | Any                       | YES           
                |
   | 2 | 5GB                        | 5GB                       | YES           
                |
   | 3 | 5GB                        | 10GB                      | YES           
                |
   | 4 | 10GB                       | 5GB                       | NO            
                |
   | 5 | Any                        | 0GB                       | YES           
                |
   
   How users can resize the root volume if the VM was deployed with a REoot 
disk size configured via its Service offering?
   - Users/Admins can at any time change to an offering with the default root 
disk size of 0; on such case, then it would be possible to resize as it is done 
nowadays.
   ## Description
   <!--- Describe your changes in detail -->
   
   <!-- For new features, provide link to FS, dev ML discussion etc. -->
   <!-- In case of bug fix, the expected and actual behaviours, steps to 
reproduce. -->
   
   <!-- When "Fixes: #<id>" is specified, the issue/PR will automatically be 
closed when this PR gets merged -->
   <!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" -->
   <!-- Fixes: # -->
   
   ## Types of changes
   <!--- What types of changes does your code introduce? Put an `x` in all the 
boxes that apply: -->
   - [ ] 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)
   - [X] Enhancement (improves an existing feature and functionality)
   - [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
   
   ## Screenshots (if appropriate):
   Setting root disk size for service offering via UI
   
![image](https://user-images.githubusercontent.com/5025148/94064212-b70ec200-fdbf-11ea-99fe-ba242b30357f.png)
   
   ## How Has This Been Tested?
   Tests:
   Created the following service offerings (via API and also via UI):
   
   -  0GB - default behavior with no Root Disk Size  configured
   -  5GB - 5GB Root
   - 10GB - 10GB Root
   - 15GB - 15GB Root
   
   Executed following tests
   
   **1. Test root volume resize.**
   _Expected result: not allowed to resize_
   Steps:
   a - deploy a VM with any of the root size configured offerings (e.g. 5GB)
   b - Change root volume size
   c - not allowed
   
   **2. Test resize via service offering.**
   _Expected result: allow 5GB -> 10GB, and 10 GB -> 15, fail to "dowsize" from 
10GB -> 5GB_
   Steps:
   a - deploy VM with offering 5GB
   b - Stop VM
   c - Change Service offering to 10GB
   d - Change offering back to 5GB, fails (as expected)
   e - Change offering to 15GB
   
   **3. Test resize via offering to a Service offering with the default root 
size (0 GB) and then customize the volume**
   _Expected result: allow 5GB -> 0GB, successfully change the root volume to a 
custom size_
   Steps:
   a - deploy VM with offering 5GB
   b - Stop VM
   c - Change Service offering to 0GB
   d - resize volume to custom size, e.g 50 GB
   
   
   
   <!-- Please read the 
[CONTRIBUTING](https://github.com/apache/cloudstack/blob/master/CONTRIBUTING.md)
 document -->
   


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