0

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

4

1 回答 1

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 中的faulinjection 包文档

于 2018-12-11T14:18:34.133 回答