Skip to content
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

Closed
manoelcampos opened this issue Jun 4, 2016 · 2 comments
Closed

Vertical VM Scaling #7

manoelcampos opened this issue Jun 4, 2016 · 2 comments
Assignees
Labels

Comments

@manoelcampos
Copy link
Collaborator

manoelcampos commented Jun 4, 2016

Implement a mechanism for scaling up and down VM resources during simulation execution.

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:

  1. resizing the current resource - the current capacity of a resource such as RAM can be dynamically resized. The VM will continue to have the same number of virtual devices (such as virtual memory cards), but with a different capacity. However, doing the same for CPU may not be possible in actual hypervisors. Thus, the best approach for CPU could be the second one below.
  2. adding another virtual device to a VM - for instance, to vertically scale the RAM, a new virtual memory card can be attached to the VM. A new CPU core can be attached as well. This is like performing a horizontal scaling at the resource level (since more CPUs will be made available).

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

  • When a VM requires more resources and there are enough resources into the PM that can be assigned to the VM, in order to VM migration.
  • When a VM is requiring more resources and the PM doesn't have enough ones, but other co-hosted VM is not using all allocated resources and would lend it to the requesting VM.

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

@manoelcampos manoelcampos self-assigned this Jun 4, 2016
@giovannifs
Copy link

Hi @manoelcampos,

Are you working on this feature? Are you thinking to also implement vertical scaling for hosts?

Cheers,

@manoelcampos
Copy link
Collaborator Author

manoelcampos commented Aug 10, 2016

Hello @giovannifs,
I'm currently entirely re-engineering the network module that clearly was designed just to produce the results shown in the paper where it was presented (NetworkCloudSim paper).
It is not possible to use this module without performing changes in the source code. There is a lot of hardcoded parameters and the code is not totally reusable.

This is my top priority. After that, I will analyse the next feature to work on.

@manoelcampos manoelcampos reopened this Jan 24, 2017
manoelcampos added a commit that referenced this issue Jan 24, 2017
First implementation of VM Vertical Down Scaling.
manoelcampos added a commit that referenced this issue Jan 24, 2017
Fixed failed tests.
manoelcampos added a commit that referenced this issue Jan 28, 2017
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.
manoelcampos added a commit that referenced this issue Apr 7, 2017
- 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.
manoelcampos added a commit that referenced this issue Apr 27, 2017
- 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.
@cloudsimplus cloudsimplus deleted a comment from Jolanare Mar 26, 2018
@cloudsimplus cloudsimplus deleted a comment from Jolanare Mar 26, 2018
@cloudsimplus cloudsimplus deleted a comment from Jolanare Mar 26, 2018
@manoelcampos manoelcampos changed the title VM vertical scaling Vertical VM Scaling Oct 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants