UpCloudLtd / terraform-provider-upcloud

Terraform provider for UpCloud
https://registry.terraform.io/providers/UpCloudLtd/upcloud
MIT License
61 stars 31 forks source link

custom image cloning via terraform #68

Closed mbaaku closed 4 years ago

mbaaku commented 5 years ago

I'm trying to clone custom server created by doing a snapshot. The resource is created, but the next resource that I create destroys previously created server and replaces with the new one. Also it creates server name in upcloud dashboad that equals to hostname set in .tf file and is forbidding to set the 'title' field within. Since this functionality is working via upcloud dashboard, I would expect this to work via terraform. Or is there another way to do it?

PopoSensei commented 4 years ago

Unsure how you are doing this. In the current version of the provider we do have storage cloning. Not all the functionalities that work in the dashboard are provided even in the latest version of the provider.

What I would suggest is cloning server device containing the custom server. In the API documentation under heading "Cloning another server" (https://developers.upcloud.com/1.3/8-servers/

Or other way is to make an image and using our new storage import feature. It is implemented for the Terraform as well. Terraform has the direct upload feature that UpCloud Dashboard doesn't have. You can read more about the feature here: https://developers.upcloud.com/1.3/9-storages/#create-import.

Hope this answers your question.