0

I want to implement job migration for the failed task in cloudsim.Is there any source code available available on gitHub etc?

Fahad Khan
  • 35
  • 6

1 Answers1

0

CloudSim does not implement Cloudlet migration or fault injection.

But if you want to use a modern, full-featured, state-of-the-art and easier-to-use fork of CloudSim, try CloudSim Plus. It has a fault-injection module that doesn't migrate Cloudlets, but when a VM fails due to a failure on its Hosts, a clone of that VM is created from a snapshot and the Cloudlets restarted.

To inject the failures and enable VM clones to be created, you can execute the following code:

long seed = System.currentTimeMillis();

//Creates a random number generator following the Poisson distribution
//MEAN_FAILURE_NUMBER_PER_HOUR is a constant you have to create
//to define the mean number of Host failures per hour.
ContinuousDistribution poisson = new PoissonDistr(MEAN_FAILURE_NUMBER_PER_HOUR, seed);

//The object that will inject random failures into Host's PEs.
HostFaultInjection fault = new HostFaultInjection(datacenter0, poisson);
fault.setMaxTimeToFailInHours(800);

//Defines a cloner function (cloneVm method) that will be called 
//when a VM from a given broker fails due to a Host failure.
//The call to addVmCloner also defines a method to clone the cloudlets
//running inside the failed VM. 
fault.addVmCloner(broker, new VmClonerSimple(this::cloneVm, this::cloneCloudlets)));

To check and understand the complete example, follow this link and the faulinjection package documentation in CloudSim Plus.

halfer
  • 19,824
  • 17
  • 99
  • 186
Manoel Campos
  • 933
  • 9
  • 12