|
101 | 101 | import javax.persistence.TypedQuery; |
102 | 102 | import java.io.IOException; |
103 | 103 | import java.net.URI; |
104 | | -import java.security.MessageDigest; |
105 | | -import java.security.NoSuchAlgorithmException; |
106 | | -import java.util.Base64; |
107 | 104 | import java.net.URISyntaxException; |
108 | 105 | import java.time.LocalDateTime; |
109 | 106 | import java.time.format.DateTimeFormatter; |
@@ -4439,9 +4436,14 @@ protected void startVm(final VmInstanceSpec spec, final NeedReplyMessage msg, fi |
4439 | 4436 | cmd.setChassisAssetTag(NetworkGlobalProperty.CHASSIS_ASSET_TAG); |
4440 | 4437 | } |
4441 | 4438 |
|
4442 | | - String machineType = VmSystemTags.MACHINE_TYPE.getTokenByResourceUuid(cmd.getVmInstanceUuid(), |
4443 | | - VmInstanceVO.class, VmSystemTags.MACHINE_TYPE_TOKEN); |
4444 | | - cmd.setMachineType(StringUtils.isNotEmpty(machineType) ? machineType : "pc"); |
| 4439 | + if (spec.getOsSpec().getMachineType() == null) { |
| 4440 | + String machineType = VmSystemTags.MACHINE_TYPE.getTokenByResourceUuid(cmd.getVmInstanceUuid(), |
| 4441 | + VmInstanceVO.class, VmSystemTags.MACHINE_TYPE_TOKEN); |
| 4442 | + cmd.setMachineType(StringUtils.isNotEmpty(machineType) ? machineType : "pc"); |
| 4443 | + } else { |
| 4444 | + cmd.setMachineType(spec.getOsSpec().getMachineType()); |
| 4445 | + } |
| 4446 | + String machineType = cmd.getMachineType(); |
4445 | 4447 |
|
4446 | 4448 | if (KVMSystemTags.VM_PREDEFINED_PCI_BRIDGE_NUM.hasTag(spec.getVmInventory().getUuid())) { |
4447 | 4449 | cmd.setPredefinedPciBridgeNum(Integer.valueOf(KVMSystemTags.VM_PREDEFINED_PCI_BRIDGE_NUM.getTokenByResourceUuid(spec.getVmInventory().getUuid(), KVMSystemTags.VM_PREDEFINED_PCI_BRIDGE_NUM_TOKEN))); |
|
0 commit comments