summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/virt/service/allocation/ReplayAllocationPolicy.kt4
-rw-r--r--opendc/opendc-format/src/main/kotlin/com/atlarge/opendc/format/trace/sc20/Sc20VmPlacementReader.kt4
2 files changed, 5 insertions, 3 deletions
diff --git a/opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/virt/service/allocation/ReplayAllocationPolicy.kt b/opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/virt/service/allocation/ReplayAllocationPolicy.kt
index 790121c4..280f3028 100644
--- a/opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/virt/service/allocation/ReplayAllocationPolicy.kt
+++ b/opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/virt/service/allocation/ReplayAllocationPolicy.kt
@@ -16,10 +16,10 @@ class ReplayAllocationPolicy(val vmPlacements: Map<String, String>) : Allocation
image: SimpleVirtProvisioningService.ImageView
): HypervisorView? {
val clusterName = vmPlacements[image.name]
- ?: throw IllegalArgumentException("Could not find placement data in VM placement file for VM ${image.name}")
+ ?: throw RuntimeException("Could not find placement data in VM placement file for VM ${image.name}")
val machinesInCluster = hypervisors.filter { it.server.name.contains(clusterName) }
return machinesInCluster.minBy { it.numberOfActiveServers }
- ?: throw IllegalArgumentException("Cloud not find any machines belonging to cluster $clusterName for image ${image.name}")
+ ?: throw RuntimeException("Cloud not find any machines belonging to cluster $clusterName for image ${image.name}")
}
}
}
diff --git a/opendc/opendc-format/src/main/kotlin/com/atlarge/opendc/format/trace/sc20/Sc20VmPlacementReader.kt b/opendc/opendc-format/src/main/kotlin/com/atlarge/opendc/format/trace/sc20/Sc20VmPlacementReader.kt
index f8ce4380..5295ae03 100644
--- a/opendc/opendc-format/src/main/kotlin/com/atlarge/opendc/format/trace/sc20/Sc20VmPlacementReader.kt
+++ b/opendc/opendc-format/src/main/kotlin/com/atlarge/opendc/format/trace/sc20/Sc20VmPlacementReader.kt
@@ -44,7 +44,9 @@ class Sc20VmPlacementReader(input: InputStream, mapper: ObjectMapper = jacksonOb
private val placements = mapper.readValue<Map<String, String>>(input)
override fun construct(): Map<String, String> {
- return placements.mapKeys { "vm__workload__${it.key}.txt" }
+ return placements
+ .mapKeys { "vm__workload__${it.key}.txt" }
+ .mapValues { it.value.split("/")[1] } // Clusters have format XX0 / X00
}
override fun close() {}