Currently, CloudStack allows admins to configure the dynamic scaling of CPU and RAM for the VMs using a global or zone level setting “enable.dynamic.scale.vm” and through a “Dynamically Scalable” flag in templates. However, the global or zone setting applies to all VMs in a particular region or zone and there may be virtual hardware or software limitations on a VM meaning that dynamic scaling would not be applicable (e.g. OS virtual hardware support, OS licensing, application licensing, hypervisor fault tolerance, etc).
In order to let the user or admin decide whether to disable dynamic scaling of VM at a more granular level, this feature provides options to disable dynamic scaling at service offering and at VM levels. If the dynamic scaling flag is disabled either at service offering or at VM, then that VM cannot be scaled dynamically. Only if all the following settings are true, then VM can be dynamically scalable.
• Global or zone setting “enable.dynamic.scale.vm”
• Template – dynamically scalable flag
• Service Offering – dynamically scalable flag
• Virtual Machine – dynamically scalable flag
Dynamic Scaling options in the UI
- Global or zone setting “dynamic.scale.vm” – This is an existing setting both at global and zone level (no changes from previous versions):
- Template – “Register Template” panel already holds the parameter to mark the template as dynamically scalable (no changes from previous versions):
- Service Offering – As above, in the “Add Compute Offering” panel a new flag “Dynamic Scaling Enabled” has been introduced at the service offering level:
- Virtual Machine – In the “Add Instance” wizard under Advanced Mode a new flag “Dynamic Scaling Enabled” has been introduced at the VM level:
API changes
Following are the API parameters and behaviour changes:
API name | Parameter | How it behaves |
deployVirtualMachine | New: dynamicscalingenabled (boolean, default: true) | When the parameter is set to true, the VM will be marked as dynamically scalable only if all other dynamic scaling options are true, otherwise it is not.When the parameter is set to false, the VM will be marked as not dynamically scalable. |
createServiceOffering | New: dynamicscalingenabled (boolean, default: true) | When the parameter is set to true, the dynamic scaling is enabled at service offering level, otherwise it is disabled. |
updateVirtualMachine | isdynamicallyscalable (boolean) | When the parameter is set to true, VM will be marked as dynamically scalable only if all other dynamic scaling options are true, otherwise API fails.
When the parameter is set to false, the VM will be marked as not dynamically scalable. |
scaleVirtualMachine | 1. A running VM can be scaled using a new service offering only if the new and old service offerings have “Dynamic Scaling Enabled” value set to true.2. A stopped VM can be changed to any service offering. During this process, if all other dynamic scaling options are true then the VM is marked as dynamically scalable, otherwise it is not. | |
restoreVirtualMachine | When the API with the new templateId parameter is called for a VM, if all dynamic scaling options are true, then the VM is marked as dynamically scalable, otherwise it is not. |
Conclusion
With this feature, admins and users will be able to choose whether a VM can be dynamically scalable or not, at multiple levels and with more flexibility supporting more diverse use cases.
This feature is available from CloudStack version 4.16.0.
Harikrishna works at ShapeBlue as a Software Engineer, and is also engaged with active development of new features and capabilities for the Apache CloudStack project. He has been working on CloudStack since 2012 and is a committer in this project. Before joining ShapeBlue, Harikrishna worked for Citrix Systems and Accelerite. He holds an M.Tech in Computer Science and Engineering from IIT-Madras.
You can learn more about Harikrishna and his background by reading his Meet The Team blog.