-
-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vertical VM Scaling #7
Comments
Hi @manoelcampos, Are you working on this feature? Are you thinking to also implement vertical scaling for hosts? Cheers, |
Hello @giovannifs, This is my top priority. After that, I will analyse the next feature to work on. |
First implementation of VM Vertical Down Scaling.
Changed the UtilizationModelDynamic to pass a clone instance of itself to the given lambda function that is accountable to update the utilization progress, in order to pass a read-only copy of such UtilizationModel to avoid the lambda expression to change it. And since the lambda usually call the getUtilization() method internally, that in turns cal the getUtilization(double) that calls the lambda itself to increment the current utilization, passing the original UtilizationModel instance caused infinity loop. The read-only copy of the UtilizationModel passed to the lambda avoids that issue.
- Included the VerticalVmCpuScalingExample.java example - CPU Scaling works in the same way as already implemented for RAM and Bandwidth. You have just to indicate that you want to scale PEs when creating a VerticalVmScaling, such as: new VerticalVmScalingSimple(Pe.class, numberOfPesToAddOrRemove) - The method setPeVerticalScaling(VerticalVmScaling scaling) was added to the Vm class to enable setting a CPU vertical scaling object to it.
- Reduces the name of some attributes. - Improves documentation of the VerticalVmCpuScalingExample, removing unused methods and fixing documentation issues. Provides more internal comments to make it clearer how the example works. - Improves documentation of the VerticalVmScaling interfaces and classes. - Fixes an issue with the ResourceScaling defined by a lambda expression in the example. The lambda computed the amount of resource to scale as twice the defined scaling factor. However, as the simulation went to its end, the resulting value dropped down below 1.0, which when converted to long resulted in 0. After that point, VM CPU was not scaled anymore in underload conditions. The issue is fixed by changing the return type of the single method in ResourceScaling to double. Furthermore, internally it is used a Math.ceil to round the value up when calling that method.
Implement a mechanism for scaling up and down VM resources during simulation execution.
![](https://github.com/manoelcampos/cloudsim-plus/raw/master/docs/presentation/images/vertical-scaling.gif)
Included Examples
Examples are available here.
Detailed information about how the feature should work
The VM should have a property to enable vertically scaling RAM, CPU and BW.
This can be tricky in real cloud environments, once both hypervisor and guest operating systems may have to support hot adding resources such as RAM and CPU. For instance, it is reported that KVM and Microsoft Hyper-V support such a feature.
However, the guest OS has to provide a so-called "ballon driver" to enable hot addition of memory and CPU (without requiring to reboot the VM).
Approaches
There are two different ways to vertically scale a specific resource, by:
Vertical scaling of RAM, Storage and BW follows the 1st approach, by resizing the resource to scale it up or down.
Vertical scaling of PEs uses the 2nd approach. Since the VM doesn't have a List of PE objects, but just stores the number of PEs and MIPS capacity of each one, the scaling is performed by just increasing or decreasing the numberOfPes attribute to simulate the addition of a virtual CPU core.
The Processor class is currently being used in the Vm class to put together the numberOfPes and MIPS. Since the Processor implements the ResourceManageable interface, this approach enabled to detect under and overload in a polymorphic way, but the actual scaling of CPU is not implemented polymorphically, due to some design issues.
References
An example scenario where this feature should be used
A brief explanation of why you think this feature is useful
It allows physical resources to be used in a more granular and efficient way, reducing resource wastage and VM migrations.
Related Issues
The text was updated successfully, but these errors were encountered: