apache / apache/cloudstack

Optional templateid param fails for KVM VM import

Open Beginner friendly
#13,067 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
3.1k
Forks
1.4k
Avg merge
6d 19h
Merged PRs (30d)
32

Description

### problem

When importing a KVM VM via API and if a template is not specified, import fails with error,
**Template is needed and unable to use default template for hypervisor KVM**
Even though templateid parameter is specified as optional in the API documentation:
https://cloudstack.apache.org/api/apidocs-4.22/apis/importUnmanagedInstance.html

In UI, template is a required field though.

Image

Documentation doesn't talk about this restriction on KVM
https://docs.cloudstack.apache.org/en/4.22.0.0/adminguide/virtual_machines/importing_unmanaging_vms.html

This is more of a documentation issue if the following block can not be updated:
https://github.com/apache/cloudstack/blob/4.22.0.0/server/src/main/java/org/apache/cloudstack/vm/UnmanagedVMsManagerImpl.java#L1605-L1607

### versions

4.22; Maybe other versions as well
Import VM

### The steps to reproduce the bug

_No response_

### What to do about it?

Either update the documentation or remove the restriction to use default dummy template.

Contributor guide

Open the contributing guide

Research direction

Start with the documented importUnmanagedInstance API and docs/en/4.22.0.0/adminguide/virtual_machines/importing_unmanaging_vms.html, then inspect UnmanagedVMsManagerImpl.java around lines 1605-1607 to confirm the KVM restriction. Check with maintainers whether the intended outcome is documentation-only or a code change; done means the API and administrator documentation accurately describe templateid behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.