You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
all submitted Cloudlets have finished and there aren't waiting Cloudlets;
all running cloudlets have finished and there are some of them waiting their VMs to be created.
The broker should enable a new behaviour:
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.
manoelcampos
changed the title
Allow a VM belonging to a broker to be destroyed after all its Cloudlets have finished
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
changed the title
Allow a VM belonging to a broker to be destroyed after all its Cloudlets have finished, independently of the state of other running Cloudlets
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
changed the title
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
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
changed the title
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
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
The DatacenterBroker only destroys VMs after:
The broker should enable a new behaviour:
Implementation Details
A method
setVmDestructionDelayFunction(final Function<Vm, Double> function)
was introduced into theDatacenterBroker
to enable setting a Function which defines the delay to destroy an idle VM. TheFunction
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
The text was updated successfully, but these errors were encountered: