Skip to content

Commit a02e455

Browse files
review comments
1 parent 5d88f30 commit a02e455

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

server/src/main/java/org/apache/cloudstack/vm/UnmanagedVMsManagerImpl.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@
202202

203203
public class UnmanagedVMsManagerImpl implements UnmanagedVMsManager {
204204
protected Logger logger = LogManager.getLogger(UnmanagedVMsManagerImpl.class);
205+
private static final long OTHER_LINUX_64_GUEST_OS_ID = 99;
205206
private static final List<Hypervisor.HypervisorType> importUnmanagedInstancesSupportedHypervisors =
206207
Arrays.asList(Hypervisor.HypervisorType.VMware, Hypervisor.HypervisorType.KVM);
207208

@@ -324,7 +325,7 @@ private VMTemplateVO createDefaultDummyVmImportTemplate(boolean isKVM) {
324325
try {
325326
template = VMTemplateVO.createSystemIso(templateDao.getNextInSequence(Long.class, "id"), templateName, templateName, true,
326327
"", 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);
328329
template.setState(VirtualMachineTemplate.State.Inactive);
329330
template = templateDao.persist(template);
330331
if (template == null) {
@@ -1554,7 +1555,7 @@ protected VMTemplateVO getTemplateForImportInstance(Long templateId, Hypervisor.
15541555
if (template == null) {
15551556
template = createDefaultDummyVmImportTemplate(isKVMHypervisor);
15561557
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()));
15581559
}
15591560
}
15601561
} else {

0 commit comments

Comments
 (0)