From 31f11b972608a8f3a21d18de2db3168445cf7243 Mon Sep 17 00:00:00 2001 From: Ali Fahs Date: Thu, 6 Oct 2022 17:47:47 +0200 Subject: [PATCH] fixing the issue MOR-252 --- .../morphemic/service/ByonUtils.java | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/scheduling-abstraction-layer/src/main/java/org/activeeon/morphemic/service/ByonUtils.java b/scheduling-abstraction-layer/src/main/java/org/activeeon/morphemic/service/ByonUtils.java index 59b54130..3cfa1894 100644 --- a/scheduling-abstraction-layer/src/main/java/org/activeeon/morphemic/service/ByonUtils.java +++ b/scheduling-abstraction-layer/src/main/java/org/activeeon/morphemic/service/ByonUtils.java @@ -60,13 +60,16 @@ public class ByonUtils { //Define the properties that depend on the node type if (nodeType.equals("byon")) { - - //set the image name - image.setId("byon-image-" + RandomStringUtils.randomAlphanumeric(16)); + String bid = RandomStringUtils.randomAlphanumeric(16); + //set the image id + image.setId("byon-image-" + bid); + //set the image Name + image.setName("byon-image-name-" + np.getOperatingSystem().getOperatingSystemFamily()+ + "-" + np.getOperatingSystem().getOperatingSystemArchitecture()); //set the hardware - hardware.setId("byon-hardware-" + RandomStringUtils.randomAlphanumeric(16)); + hardware.setId("byon-hardware-" + bid); //set the location - location.setId("byon-location-" + RandomStringUtils.randomAlphanumeric(16)); + location.setId("byon-location-" + bid); //set the nc parameters nc.setNodeCandidateType(NodeCandidate.NodeCandidateTypeEnum.BYON); // set the nc jobIdForBYON @@ -75,13 +78,16 @@ public class ByonUtils { nc.setJobIdForEDGE(null); } else { //the node type is EDGE - - //set the image name - image.setId("edge-image-" + RandomStringUtils.randomAlphanumeric(16)); + String eid = RandomStringUtils.randomAlphanumeric(16); + //set the image id + image.setId("edge-image-" + eid); + //set the image Name + image.setName("edge-image-name-" + np.getOperatingSystem().getOperatingSystemFamily()+ + "-" + np.getOperatingSystem().getOperatingSystemArchitecture()); //set the hardware - hardware.setId("edge-hardware-" + RandomStringUtils.randomAlphanumeric(16)); + hardware.setId("edge-hardware-" + eid); //set the location - location.setId("edge-location-" + RandomStringUtils.randomAlphanumeric(16)); + location.setId("edge-location-" + eid); //set the nc parameters nc.setNodeCandidateType(NodeCandidate.NodeCandidateTypeEnum.EDGE); // set the nc jobIdForBYON -- GitLab