hashicorp / hashicorp/packer-plugin-cloudstack

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

Đang mở
#95 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
enhancement
Ngôn ngữ chính
Go
Star
5
Fork
17
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Start in builder/cloudstack/config.go, where the existing template_* source block arguments are defined, and compare the CloudStack registerTemplate API documentation for directdownload. Confirm how registration-time template attributes are passed and verify that template_direct_download is accepted and reaches registerTemplate for KVM builds.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
go
Lĩnh vực
cloud
Loại issue
Tính năng
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
55/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.