How can I add more than one VM if overloading in CloudSim Plus?

158 views Asked by At

I am trying to do horizontal auto-scaling in the CloudSim Plus simulator. I need to scale up the application by more than one VM. I am trying to modify the example LoadBalancerByHorizontalVmScalingExample provided by CloudSim Plus.

The example has a setVmSupplier() function which has a createVm() parameter which returns only one VM. Moreover, the setVmSupplier() function accepts only one VM and not a list of VMs. I am not able to modify the function even in the superclass. How can I provide more than one VM?

1

There are 1 answers

0
Manoel Campos On

You don't have to make the VmSupplier return a list of VMs. If you need more than one VM to be created, you just have to ensure the isVmOverloaded method in the mentioned example contains a condition that will remain true after being called in different times.

If at the time the VM is checked, it is still overloaded, the HorizontalVmScaling object will call the VmSupplier function again to create a new VM. This is how you ensure that multiple VMs are created to balance the load.