Container Scheduler
The "ContainerScheduler" class is responsible for allocating suitable "vHost" instances to "vContainer" instances based on the available CPU and RAM resources. The scheduling process is implemented as an event that is triggered whenever a new "vContainer" is created or a "vContainer" is terminated. Only one scheduling process can exist at any time during the simulation.
The "ContainerScheduler" class includes an abstract member function called "findHost", which allows developers to customize the conditions for determining which "vHost" instances are eligible for hosting a specific "vContainer". By implementing the "findHost" function, different scheduling strategies can be employed based on specific requirements and constraints.
PyCloudSim provides several default schedulers that can be used with the "ContainerScheduler" class:
- "Bestfit" scheduler: This scheduler finds the most utilized "vHost" instance that still has available resources to host the "vContainer" being scheduled.
- "Worstfit" scheduler: This scheduler finds the most underutilized "vHost" instance that still has available resources to host the "vContainer" being scheduled.
- "Random" scheduler: This scheduler allocates the "vContainer" to a random "vHost" instance that has sufficient resources.
Only one "ContainerScheduler" can be defined and used in the simulation. If multiple "ContainerScheduler" instances are initialized, the last one defined will be used during the simulation.
The general procedure followed by the "ContainerScheduler" involves evaluating the available resources of each "vHost" instance and selecting the most suitable "vHost" to host the "vContainer" based on the defined scheduling strategy. This process ensures efficient resource allocation and utilization in the simulated cloud environment.
BestfitContainerScheduler
Bases: ContainerScheduler
Bestfit container scheduler. It will return the host with the least amount of resources.
Source code in PyCloudSim\scheduler\container_scheduler.py
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
|
ContainerScheduler
Bases: ABC
, Entity
Base for all container schedulers.
Source code in PyCloudSim\scheduler\container_scheduler.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
|
DefaultContainerScheduler
Bases: ContainerScheduler
Default container scheduler. It will return the first available host.
Source code in PyCloudSim\scheduler\container_scheduler.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
|
WorstfitContainerScheduler
Bases: ContainerScheduler
Worstfit container scheduler. It will return the host with the most amount of resources.
Source code in PyCloudSim\scheduler\container_scheduler.py
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
|