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

Enable a VM belonging to a broker to be destroyed after all its Cloudlets have finished, independently of the state of other running VMs and according to a given delay #99

Closed
manoelcampos opened this Issue Jun 2, 2017 · 0 comments

Comments

Projects
None yet
1 participant
@manoelcampos
Owner

manoelcampos commented Jun 2, 2017

The DatacenterBroker only destroys VMs after:

  1. all submitted Cloudlets have finished and there aren't waiting Cloudlets;
  2. all running cloudlets have finished and there are some of them waiting their VMs to be created.

The broker should enable a new behaviour:

  1. allow destroying a given VM when all its Cloudlets finish executing, independently if all Cloudlets running in other VMs have finished or not. This way, that VM should be destroyed if it become idle (having no waiting or executing Cloudlets).

Implementation Details

A method setVmDestructionDelayFunction(final Function<Vm, Double> function) was introduced into the DatacenterBroker to enable setting a Function which defines the delay to destroy an idle VM. The Function given to the setter receives a VM and should return the time delay to destroy the VM after it becoming idle.

There are three different behaviours for VM destruction, considering the value returned by the given Function.

1. Default Behaviour if a Function is not set

If a Function is not set, VMs will be immediately destroyed when all submitted Cloudlets running in any VM have finished, independently if there aren't waiting VMs or not.
If a Cloudlet finishes but there are other running Cloudlets, no VM will be destroyed.

2. A Function is set and returns 0.0

When a Function is set and returns 0.0 as the destruction delay for a given VM, that VM will be destroyed immediately after it becoming idle, independently of any other condition.
That is, it doesn't matter if there are Cloudlets waiting to be created or running.

3. A Function is set and returns a positive value

When a Function is set and returns a positive value like 2 as the destruction delay for a given VM, that VM will be destroyed only after 2 seconds from becoming idle, independently of any other condition.

A brief explanation of why you think this feature is useful

While the behaviour of only destroying VMs after the broker shuts down is useful if more Cloudlets are expected to arrive (mainly after the issue #43), it is not always the case. If one wants to save resources, idle VMs should be destroyed so that VMs from other brokers can be created into the Host or even other VMs from the same broker.

On the other hand, if there is a set of VMs running in parallel to provide fault tolerance (see #81), it doesn't make sense to immediately destroy a VM after it becoming idle. Usually you may leave the VM running to simulate the waiting for user's requests or you may define an idleness limit to destroy the VM. This way, the Function<Vm,Double> allows defining such a behaviour.

Included Examples

@manoelcampos manoelcampos added the feature label Jun 2, 2017

@manoelcampos manoelcampos added this to the CloudSim Plus 2.0 milestone Jun 2, 2017

@manoelcampos manoelcampos self-assigned this Jun 2, 2017

@manoelcampos manoelcampos changed the title from Allow a VM belonging to a broker to be destroyed after all its Cloudlets have finished to Allow a VM belonging to a broker to be destroyed after all its Cloudlets have finished, independently of the state of other running Cloudlets Jun 2, 2017

@manoelcampos manoelcampos changed the title from Allow a VM belonging to a broker to be destroyed after all its Cloudlets have finished, independently of the state of other running Cloudlets to Allow a VM belonging to a broker to be destroyed after all its Cloudlets have finished, independently of the state of other running Cloudlets and according to a given delay Jun 3, 2017

@manoelcampos manoelcampos changed the title from Allow a VM belonging to a broker to be destroyed after all its Cloudlets have finished, independently of the state of other running Cloudlets and according to a given delay to Allow a VM belonging to a broker to be destroyed after all its Cloudlets have finished, independently of the state of other running VMs and according to a given delay Jun 3, 2017

manoelcampos added a commit that referenced this issue Jun 3, 2017

manoelcampos added a commit that referenced this issue Jun 3, 2017

@manoelcampos manoelcampos changed the title from Allow a VM belonging to a broker to be destroyed after all its Cloudlets have finished, independently of the state of other running VMs and according to a given delay to Enable a VM belonging to a broker to be destroyed after all its Cloudlets have finished, independently of the state of other running VMs and according to a given delay Jun 4, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment