Title: feature: Add `directdownload` request parameter to `createTemplate` API (KVM) · Issue #12842 · apache/cloudstack · GitHub
Open Graph Title: feature: Add `directdownload` request parameter to `createTemplate` API (KVM) · Issue #12842 · apache/cloudstack
X Title: feature: Add `directdownload` request parameter to `createTemplate` API (KVM) · Issue #12842 · apache/cloudstack
Description: The required feature described as a wish Summary The createTemplate API does not accept directdownload as a request parameter. This makes it impossible for tools that create templates from a stopped VM's volume (such as HashiCorp Packer)...
Open Graph Description: The required feature described as a wish Summary The createTemplate API does not accept directdownload as a request parameter. This makes it impossible for tools that create templates from a stoppe...
X Description: The required feature described as a wish Summary The createTemplate API does not accept directdownload as a request parameter. This makes it impossible for tools that create templates from a stoppe...
Opengraph URL: https://github.com/apache/cloudstack/issues/12842
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"feature: Add `directdownload` request parameter to `createTemplate` API (KVM)","articleBody":"### The required feature described as a wish\n\n### Summary\nThe `createTemplate` API does not accept `directdownload` as a request parameter. This makes it impossible for tools that create templates from a stopped VM's volume (such as HashiCorp Packer) to produce a template with the `directdownload` flag set.\n\n### Current Behaviour\n`directdownload` is only accepted as a request parameter by `registerTemplate`. `createTemplate` and `updateTemplate` both omit it from their accepted parameters, though both include it in their response payloads (reflecting the value stored on the `vm_template` record).\nThere is no supported API path to set `directdownload = true` on a template created via `createTemplate`.\n\n### Expected Behavior\n`createTemplate` should accept an optional boolean `directdownload` parameter (KVM only), consistent with how `registerTemplate` handles it, and persist it on the resulting VMTemplateVO record.\n\n### Proposed Change\nIn CreateTemplateCmd.java, add:\n```java\n@Parameter(name = ApiConstants.DIRECT_DOWNLOAD, type = CommandType.BOOLEAN,\n description = \"KVM Only: true if template should be directly downloaded \"\n + \"to Primary Storage, bypassing Secondary Storage. Default is false.\")\nprivate Boolean directDownload;\npublic Boolean isDirectDownload() {\n return directDownload;\n}\n```\nPropagate through `TemplateProfile` and `TemplateManagerImpl.createPrivateTemplate()` - following the identical pattern already used in `RegisterTemplateCmd` and its handling.\n\nReferences\n- `RegisterTemplateCmd.java` - existing implementation to follow\n- `CreateTemplateCmd.java` - file to modify\n- Downstream: apache/cloudstack-go SDK will need SetDirectdownload() added to CreateTemplateParams once this is merged\n- Downstream: hashicorp/packer-plugin-cloudstack#95 - the packer plugin feature request blocked on this change","author":{"url":"https://github.com/ianc769","@type":"Person","name":"ianc769"},"datePublished":"2026-03-17T17:51:40.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/12842/cloudstack/issues/12842"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:1050f6c4-290c-aa9c-3ad8-229eba2a8369 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E3DA:2348DE:B8A535:BCCCC4:6A4DB84E |
| html-safe-nonce | 03b90fd1a95354f5d42e200f0eaa4275ed72be15b4bd0f21a4203d2557d340bd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFM0RBOjIzNDhERTpCOEE1MzU6QkNDQ0M0OjZBNERCODRFIiwidmlzaXRvcl9pZCI6Ijg4NzgyMjczMjQyNzAzOTM0MjIiLCJyZWdpb25fZWRnZSI6InNlYSIsInJlZ2lvbl9yZW5kZXIiOiJzZWEifQ== |
| visitor-hmac | 55554e07c934b59478af196dd8ac1df3ce7f618f2cd09fa0f9e9b0360557f2c0 |
| hovercard-subject-tag | issue:4090179442 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/apache/cloudstack/12842/issue_layout |
| twitter:image | https://opengraph.githubassets.com/64eb81e185a23d770e7853ca7d2653ca56902378bdb00045417eed2b7b26c684/apache/cloudstack/issues/12842 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/64eb81e185a23d770e7853ca7d2653ca56902378bdb00045417eed2b7b26c684/apache/cloudstack/issues/12842 |
| og:image:alt | The required feature described as a wish Summary The createTemplate API does not accept directdownload as a request parameter. This makes it impossible for tools that create templates from a stoppe... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ianc769 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33 |
| turbo-cache-control | no-preview |
| go-import | github.com/apache/cloudstack git https://github.com/apache/cloudstack.git |
| octolytics-dimension-user_id | 47359 |
| octolytics-dimension-user_login | apache |
| octolytics-dimension-repository_id | 9759448 |
| octolytics-dimension-repository_nwo | apache/cloudstack |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 9759448 |
| octolytics-dimension-repository_network_root_nwo | apache/cloudstack |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 32f7b614aca06e6bbd89842b1370df1328264f68 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width