From e9d69a7a471fd63700b550dca34affe399b8a04c Mon Sep 17 00:00:00 2001 From: guyuliang Date: Fri, 31 May 2024 10:57:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dct=E7=94=B3=E8=AF=B7=E8=99=9A?= =?UTF-8?q?=E6=8B=9F=E6=9C=BA=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ims/service/resource/VMApplyServiceImpl.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/bocloud.ims.service/src/main/java/com/bocloud/ims/service/resource/VMApplyServiceImpl.java b/bocloud.ims.service/src/main/java/com/bocloud/ims/service/resource/VMApplyServiceImpl.java index a4eda74..bfc7e69 100644 --- a/bocloud.ims.service/src/main/java/com/bocloud/ims/service/resource/VMApplyServiceImpl.java +++ b/bocloud.ims.service/src/main/java/com/bocloud/ims/service/resource/VMApplyServiceImpl.java @@ -249,6 +249,21 @@ public class VMApplyServiceImpl implements VMApplyService { Assert.notNull(vendor, "云平台不存在"); CloudProvider provider = CloudProvider.valueOf(vendor.getType()); + + if (provider == CloudProvider.CLOUDTOWER) { + //适配cloudTower + AssignParam assignParam = new AssignParam(); + assignParam.setOriginalConfigs(configs); + assignParam.setCpu(configs.getLong("cpu")); + assignParam.setMemory(configs.getBigDecimal("memory").longValue()); + assignParam.setDisk(configs.getLong("disk")); + assignParam.setTemplateDisk(configs.getLong("templateDisk")); + assignParam.setInstance(count); + assignParam.setUuid(UUID.randomUUID().toString()); + assignParam.setPoolGroupId(param.getLocation().getPoolGroupId()); + param.setAssignParam(assignParam); + } + if (CloudProvider.HUAWEI == provider){ String instanceChargeType = "PostPaid"; if (ChargeCommon.ChargeMode.PreCharge.equals(order.getChargeMode())){