hashicorp / hashicorp/packer-plugin-cloudstack

feat:: add `template_direct_download` support to the CloudStack builder

未关闭
#95 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
enhancement
主要语言
Go
星标
5
派生
17
PR 合并指标
30 天内没有已合并 PR

描述

Please search the existing issues for relevant feature requests, and use the reaction
feature (https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/)
to add upvotes to pre-existing requests.
#### Community Note
Please vote on this issue by adding a 👍 reaction to the original issue to help the
community and maintainers prioritize this request.
Please do not leave "+1" or "me too" comments, they generate extra noise for issue
followers and do not help prioritize the request.
If you are interested in working on this issue or have submitted a pull request,
please leave a comment.
#### Description
The CloudStack builder does not support the `directdownload` flag exposed by the
CloudStack `registerTemplate` API. This flag (KVM only) instructs CloudStack to
download the template directly to Primary Storage, bypassing Secondary Storage entirely.
All other `template_*` registration attributes (`template_featured`, `template_public`,
`template_password_enabled`, `template_requires_hvm`, `template_scalable`) are already
supported as source block arguments. `template_direct_download` is the missing
counterpart.
Because `directdownload` is a parameter of `registerTemplate` and is **not** available
on `updateTemplate`, it cannot be set after the Packer build completes — it must be
passed at registration time by the plugin.
#### Use Case(s)
- Environments where Secondary Storage is a bottleneck or unavailable on the build
network. Direct download allows KVM hosts to pull the template straight to Primary
Storage, reducing build pipeline time and avoiding a Secondary Storage dependency.
#### Potential configuration
```hcl
source "cloudstack" "example" {
api_url = "https://cloudstack.example.com/client/api"
api_key = var.cloudstack_api_key
secret_key = var.cloudstack_secret_key
zone = "ca-west-1"
network = "my-network"
service_offering = "my-offering"
source_template = "Ubuntu-24.04-LTS"
template_os = "Ubuntu 24.04 LTS"
hypervisor = "KVM"
template_name = "my-golden-image-{{timestamp}}"
template_direct_download = true # <-- proposed new argument
}
```

Potential References
- CloudStack registerTemplate API docs (parameter: directdownload):
https://cloudstack.apache.org/api/apidocs-4.19/apis/registerTemplate.html
- CloudStack updateTemplate API docs (note: directdownload is absent, confirming
it is registration-time only):
https://cloudstack.apache.org/api/apidocs-4.19/apis/updateTemplate.html
- Relevant plugin source where other Template* fields are defined:
builder/cloudstack/config.go

贡献指南

打开贡献指南

调研方向

从 builder/cloudstack/config.go 开始,现有的 template_* 源块参数就在此处定义,并对照 CloudStack 关于 directdownload 的 registerTemplate API 文档。确认注册时的模板属性如何传递,并验证在 KVM 构建中 template_direct_download 会被接受并传递到 registerTemplate。

由索引模型根据 Issue 内容生成。

评估

技术栈
go
领域
cloud
Issue 类型
功能
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
55/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。