如何在clousim中实现作业迁移容错技术?

时间:2017-12-28 06:44:41

标签: github machine-learning virtual-machine workflowservice cloudsim

我想在cloudsim中为失败的任务实现作业迁移。是否有可用的gitHub等源代码?

1 个答案:

答案 0 :(得分:0)

CloudSim不实现Cloudlet迁移或故障注入。

但是,如果您想使用CloudSim的现代,功能齐全,最先进且更易于使用的分支,请尝试CloudSim Plus。它具有一个故障注入模块,该模块不会迁移Cloudlets,但是当VM由于其主机故障而失败时,将从快照创建该VM的克隆,然后重新启动Cloudlets。

要注入故障并允许创建VM克隆,可以执行以下代码:

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)));

要检查并理解完整的示例,请遵循CloudSim Plus中的this linkfaulinjection package documentation