Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
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.
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.
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.
This is my top priority. After that, I will analyse the next feature to work on.
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.