|
202 | 202 |
|
203 | 203 | public class UnmanagedVMsManagerImpl implements UnmanagedVMsManager { |
204 | 204 | protected Logger logger = LogManager.getLogger(UnmanagedVMsManagerImpl.class); |
| 205 | + private static final long OTHER_LINUX_64_GUEST_OS_ID = 99; |
205 | 206 | private static final List<Hypervisor.HypervisorType> importUnmanagedInstancesSupportedHypervisors = |
206 | 207 | Arrays.asList(Hypervisor.HypervisorType.VMware, Hypervisor.HypervisorType.KVM); |
207 | 208 |
|
@@ -324,7 +325,7 @@ private VMTemplateVO createDefaultDummyVmImportTemplate(boolean isKVM) { |
324 | 325 | try { |
325 | 326 | template = VMTemplateVO.createSystemIso(templateDao.getNextInSequence(Long.class, "id"), templateName, templateName, true, |
326 | 327 | "", true, 64, Account.ACCOUNT_ID_SYSTEM, "", |
327 | | - "VM Import Default Template", false, 99); |
| 328 | + "VM Import Default Template", false, OTHER_LINUX_64_GUEST_OS_ID); |
328 | 329 | template.setState(VirtualMachineTemplate.State.Inactive); |
329 | 330 | template = templateDao.persist(template); |
330 | 331 | if (template == null) { |
@@ -1554,7 +1555,7 @@ protected VMTemplateVO getTemplateForImportInstance(Long templateId, Hypervisor. |
1554 | 1555 | if (template == null) { |
1555 | 1556 | template = createDefaultDummyVmImportTemplate(isKVMHypervisor); |
1556 | 1557 | if (template == null) { |
1557 | | - throw new InvalidParameterValueException(String.format("Default VM import template with unique name: %s for hypervisor: %s cannot be created. Please use templateid parameter for import", VM_IMPORT_DEFAULT_TEMPLATE_NAME, hypervisorType.toString())); |
| 1558 | + throw new InvalidParameterValueException(String.format("Default VM import template with unique name: %s for hypervisor: %s cannot be created. Please use templateid parameter for import", templateName, hypervisorType.toString())); |
1558 | 1559 | } |
1559 | 1560 | } |
1560 | 1561 | } else { |
|
0 commit comments