Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] resource ovh_dedicated_server_reinstall_task doesn't support import #914

Open
arhue opened this issue Mar 18, 2025 · 2 comments · May be fixed by #937
Open

[BUG] resource ovh_dedicated_server_reinstall_task doesn't support import #914

arhue opened this issue Mar 18, 2025 · 2 comments · May be fixed by #937

Comments

@arhue
Copy link

arhue commented Mar 18, 2025

Describe the bug

resource ovh_dedicated_server_reinstall_task doesn't support import

Terraform Version

Terraform v1.11.1

OVH Terraform Provider Version

v2.0.0

Affected Resource(s)

Please list the resources as a list, for example:

  • ovh_dedicated_server_reinstall_task

Terraform Configuration Files

I changed ovh_dedicated_server_install_task to ovh_dedicated_server_reinstall_task

resource ovh_dedicated_server_reinstall_task "new-server_install" {
  for_each = var.new-pve-servers
  service_name      = each.value["service_name"]
  os     = "proxmox7_64"
  customizations {
    hostname = each.value["hostname"]
    post_installation_script = "xxx"
  }
}

It then wants to reinstall my servers, so I tried importing the reinstall task, but it wouldn't work

varun@qa-docker-1:~/git/ansible-terraform/terraform/ovh$ terraform import 'ovh_dedicated_server_reinstall_task.server_install["fifth"]' ns5019797.ip-15-235-119.net/operating_system/148192957
...
data.ovh_dedicated_server.new-dedi_list["third"]: Read complete after 1s [id=ns5027515.ip-148-113-187.net]
╷
│ Error: resource ovh_dedicated_server_reinstall_task doesn't support import
│ 
│ 

Expected Behavior

ovh_dedicated_server_reinstall_task should work according to the docs.

Actual Behavior

resource ovh_dedicated_server_reinstall_task doesn't support import

@arhue
Copy link
Author

arhue commented Mar 18, 2025

Is there any other way to do upgrades from previous versions while retaining the install task?

@amstuta
Copy link
Collaborator

amstuta commented Mar 19, 2025

Hello @arhue, thanks for opening this issue.

There is an issue in the documentation, indeed the resource doesn't support import and we don't plan to add this feature as it doesn't really make sense (the resource itself represents a volatile task and may be converted to an ephemeral resource in the future as it has no real lifecycle). We'll fix the documentation to remove this part.

Regarding the migration process, we are aware that it is missing from the documentation. We are writing it at the moment so it should be available in a few days.

A quick summary of the process is:

  • Import all your dedicated servers into ovh_dedicated_server resources
  • Add your installation parameters in the new fields of the resource (customizations, storage, properties) with a lifecycle keyword to make sure that the next apply won't reinstall your servers:
lifecycle {
  ignore_changes = [ customizations, properties, storage ]
}
  • Whenever you want to reinstall your server, you'll be able to remove the lifecycle.

I'll link the related PR to this issue, don't hesitate to add suggestions/comments on this issue if you want.

@amstuta amstuta linked a pull request Apr 3, 2025 that will close this issue
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants