hashicorp / hashicorp/packer-plugin-cloudstack

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

Abierto
#95 0 comentarios 0 reacciones 0 asignados Ver en GitHub
enhancement
Lenguaje dominante
Go
Estrellas
5
Forks
17
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.