Dynamic Scaling Of VMs In CloudStack

Dynamic Scaling of VMs (both RAM and CPU) has been introduced in Apache CloudStack 4.2.0 onwards. You can read more about its features and limitations from the Apache CloudStack Dynamic scaling of CPU and RAM Wiki. In particular, pay attention to the section on how memory settings are calculated and applied (dynamic max) to a VM based on memory overprovisioning.

I have been able to create VMs with the dynamic scaling features enabled with the following steps…

  1. Update the global setting enable.dynamic.scale.vm to true
    $ cloudmonkey api updateConfiguration name=enable.dynamic.scale.vm value=true
  2. Increase the global setting mem.overprovisioning.factor to something greater than 1. I have used 2 in my tests.
    $ cloudmonkey api updateConfiguration name=mem.overprovisioning.factor value=2
  3. Create new service offerings as applicable. Since I have 2x over provisioning enabled, I have created new offerings as below:
    1vCPU::128MB
    1vCPU::256MB
    1vCPU::512MB
    2vCPU::512MB
    1vCPU::1024MB
    2vCPU::1024MB
    1vCPU::2048MB
    2vCPU::2048MB
    1vCPU::4096MB
    2vCPU::4096MB
    ...
    
  4. Create/update OS template(s) with “Dynamically Scalable” option as enabled. The template itself needs to have XenServer guest tools installed and running.Screen Shot 2013-12-21 at 1.44.52 pm
  5. Launch a new instance from a dynamic scaling enabled template
  6. Finally, change the service offering for the instance. So if your memory over provisioning is 2x and you are running a 128MB instance, you can dynamically change to an offering which provides 256MB of memory.Screen Shot 2013-12-21 at 1.49.56 pm

Caveats:

  1. So far, I have tested dynamic scaling of CentOS 6.5 64bit and FreeBSD 10 RC2 64bit templates. While dyanamic scaling worked for the CentOS 6.5 64bit template, it failed for the FreeBSD template. XenCentre correctly shows Static maximum as 2x of Maximum memoryScreen Shot 2013-12-21 at 12.38.35 pm
  2. Guest OS support is required for dynamic scaling to work. Perhaps thats the reason why FreeBSD failed in my tests. For FreeBSD, the static maximum and maximum memory is equal (instead of being 2x).Screen Shot 2013-12-21 at 12.42.27 pm
  3. Only scaling up of the the instance is possible at this time. Attempting to scale down a VM will result in the following error:Screen Shot 2013-12-21 at 2.01.52 pm
  4. While the Wiki mentions that the feature is supported on VMware also, I don’t have an environment to test dynamic scaling on VMware.
  5. All my service offerings have the same CPU speed with CPU cap disabled. Dynamic scaling of CPU was not tested

Also see Dynamic Scaling Of CPU and RAM not working discussion started by Iliyas Shirol on the Apache CloudStack mailing list.

Shanker Balan

Shanker Balan is a devops and infrastructure freelancer with over 14 years of industry experience in large scale Internet systems. He is available for both short term and long term projects on contract. Please use the Contact Form for any enquiry.

More Posts - Website

Follow Me:
TwitterLinkedIn

Published by

Shanker Balan

Shanker Balan is a devops and infrastructure freelancer with over 14 years of industry experience in large scale Internet systems. He is available for both short term and long term projects on contract. Please use the Contact Form for any enquiry.

Leave a Reply