Skip to content

Optional templateid param fails for KVM VM import #13067

Description

@shwstppr

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.

Activity

  1. added this to the 4.20.4 milestone on Apr 28, 2026
  2. added theissue type on Apr 28, 2026
  3. andrijapanicsb commented on May 29, 2026

    @andrijapanicsb
    Contributor
    Image
  4. nvazquez commented on Aug 24, 2026

    @nvazquez
    Contributor

    Hi @shwstppr @andrijapanicsb I have also raised a documentation PR to address this issue: apache/cloudstack-documentation#676. Can you please review it?

    This way we will have the PR #13126 to address the API docs parameter description and the PR apache/cloudstack-documentation#676 to address the documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions