terraform-provider-hcloud icon indicating copy to clipboard operation
terraform-provider-hcloud copied to clipboard

[Feature]: Allow creation of server with volume(s)

Open ifeulner opened this issue 2 years ago • 7 comments

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.

ifeulner avatar Jan 30 '22 14:01 ifeulner

@LKaemmerling any comment on this? Hope I am missing something :)

ifeulner avatar Feb 04 '22 10:02 ifeulner

I would be very interested in this as well

cschlesselmann avatar Apr 22 '22 12:04 cschlesselmann

Hi @ifeulner (and @cschlesselmann),

can you describe your use case and why attaching after creation would not work for you?

apricote avatar Nov 23 '22 10:11 apricote

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?

felixscheinost avatar Nov 23 '22 14:11 felixscheinost

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.

ifeulner avatar Nov 26 '22 21:11 ifeulner

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.

CGamesPlay avatar Mar 31 '23 06:03 CGamesPlay

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.

github-actions[bot] avatar Oct 12 '23 12:10 github-actions[bot]