summaryrefslogtreecommitdiff
path: root/opendc-compute
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-08-26 10:29:41 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2021-09-07 14:24:41 +0200
commitb6a8c642b598bfb2eaaea2a8a7e6ad6702d349b6 (patch)
tree6e8487a9924965dced4ef812dcc652ddac27730f /opendc-compute
parent2c507c6ca4b7d809b410d351f0c1c5c3ddf7bb5c (diff)
fix(compute): Use correct memory size for host memory
This change fixes an issue where all servers could not be scheduled due to the memory size of the host being computed incorrectly.
Diffstat (limited to 'opendc-compute')
-rw-r--r--opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt4
1 files changed, 2 insertions, 2 deletions
diff --git a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt
index 9a1f05fc..a4d24740 100644
--- a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt
+++ b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt
@@ -292,8 +292,8 @@ public class SimHost(
}
override fun canFit(server: Server): Boolean {
- val sufficientMemory = machine.model.memory.size >= server.flavor.memorySize
- val enoughCpus = machine.model.cpus.size >= server.flavor.cpuCount
+ val sufficientMemory = model.memorySize >= server.flavor.memorySize
+ val enoughCpus = model.cpuCount >= server.flavor.cpuCount
val canFit = hypervisor.canFit(server.flavor.toMachineModel())
return sufficientMemory && enoughCpus && canFit