修复ct申请虚拟机流程

develop
guyuliang 2024-05-31 10:57:59 +08:00
parent 4a4161c71b
commit e9d69a7a47
1 changed files with 15 additions and 0 deletions

View File

@ -249,6 +249,21 @@ public class VMApplyServiceImpl implements VMApplyService {
Assert.notNull(vendor, "云平台不存在"); Assert.notNull(vendor, "云平台不存在");
CloudProvider provider = CloudProvider.valueOf(vendor.getType()); 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){ if (CloudProvider.HUAWEI == provider){
String instanceChargeType = "PostPaid"; String instanceChargeType = "PostPaid";
if (ChargeCommon.ChargeMode.PreCharge.equals(order.getChargeMode())){ if (ChargeCommon.ChargeMode.PreCharge.equals(order.getChargeMode())){