terraform-provider-hcloud
terraform-provider-hcloud copied to clipboard
[Feature]: Allow creation of server with volume(s)
What whould you like to see?
hcloud_server
does not allow to attach directly volumes when the server is created, but the API does as desribed in the docs.
Can you please support this? Or is there another way to do this? Attaching after creation would not work in my case.
Thanks.
@LKaemmerling any comment on this? Hope I am missing something :)
I would be very interested in this as well
Hi @ifeulner (and @cschlesselmann),
can you describe your use case and why attaching after creation would not work for you?
Hi, I have a usecase: I want to provision a server from the rescue system.
So I set rescue = "linux64"
and then use remote-exec
provisioners to execute commands in the rescue system.
I need a volume to be mounted in the rescue system at this point.
This runs into a sort of chicken-egg problem, as both hcloud_volume
or hcloud_volume_attachment
need a server_id
, which isn't available until after the provisioners ran, right?
Hi @apricote my usecase was /is to try to stay with immutable infrastructure and so do all the initialization / configuration within cloud-init. If that init code requires a hcloud volume it would be great to have that already mounted by the server definition. I helped myself by using the hcloud api to mount the volume within cloud-init, but via hcloud_server it would be more concise and reliable.
To describe my use case: The volume is necessary for the server to successfully boot. Since Terraform waits until the server has started booting before attaching the volume, the boot fails.
Presently my application is using a script to start the server with the hcloud CLI, and everything works. I'd like to migrate to a Terraform-based solution, but this is a blocker.
This issue has been marked as stale because it has not had recent activity. The bot will close the issue if no further action occurs.