Skip to content

Conversation

JayBeeDe
Copy link
Member

@JayBeeDe JayBeeDe commented Jun 17, 2025

Description

Issue in API call POST /dedicated/server/{serviceName}/reinstall, properties attribute is not taken into account in OS installation.
Since custom config drive (cloud init datasource) metadata doesn't make sense for some OSes such as Windows, it has been decided to move those custom config drive metadata under customizations attribute in customizations.configDriveMetadata, since it's an OS-dependent configuration.
This PR:

  • is reflecting this upcoming API change to the Terraform Provider
  • is definitely fixing initial issue with custom config drive metadata not taken into account for compatible "OSes" such as byolinux_64 and byoi_64

Fixes #PUBM-43183

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • Documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A: make testacc --debug TESTARGS="-run TestAccDedicatedServerReinstall_byolinux"
GNU Make 4.3
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Reading makefiles...
Updating makefiles....
Updating goal targets....
 File 'testacc' does not exist.
   File 'fmtcheck' does not exist.
  Must remake target 'fmtcheck'.
==> Checking that code complies with gofmt requirements...
  Successfully remade target file 'fmtcheck'.
Must remake target 'testacc'.
TF_ACC=1 go test $(go list ./... |grep -v 'vendor') -v -run TestAccDedicatedServerReinstall_byolinux -timeout 600m -p 10
?   	github.com/ovh/terraform-provider-ovh/v2	[no test files]
=== RUN   TestAccDedicatedServerReinstall_byolinux
--- PASS: TestAccDedicatedServerReinstall_byolinux (473.76s)
PASS
ok  	github.com/ovh/terraform-provider-ovh/v2/ovh	473.772s
?   	github.com/ovh/terraform-provider-ovh/v2/ovh/helpers	[no test files]
testing: warning: no tests to run
PASS
ok  	github.com/ovh/terraform-provider-ovh/v2/ovh/helpers/hashcode	(cached) [no tests to run]
?   	github.com/ovh/terraform-provider-ovh/v2/ovh/ovhwrap	[no test files]
?   	github.com/ovh/terraform-provider-ovh/v2/ovh/types	[no test files]
Successfully remade target file 'testacc'.
echo $?
0

Installation task 474427488 was performed successfully and I can see that the configDriveMetadata customization parameter was send correctly and that the value was correctly applied in the config-drive metadata:

{
  "name": "mon-tux",
  "uuid": "bcd615f7-735a-44ee-aebd-f5f6cd626c11",
  "availability_zone": "nova",
  "hostname": "mon-tux",
  "devices": [],
  "launch_index": 0,
  "project_id": "3e482327-4c63-4017-95a4-7cb80a74d49c",
  "keys": [
    {
      "name": "key1",
      "data": "XXXXXXXXXXXXXXx",
      "type": "ssh"
    }
  ],
  "public_keys": {
    "key1": "XXXXXXXXXXXXXXx"
  },
  "meta": {
    "foo": "bar",
    "hello": "world"
  }
}
  • Test B: make testacc --debug TESTARGS="-run TestAccDedicatedServerReinstall_basic"
GNU Make 4.3
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Reading makefiles...
Updating makefiles....
Updating goal targets....
 File 'testacc' does not exist.
   File 'fmtcheck' does not exist.
  Must remake target 'fmtcheck'.
==> Checking that code complies with gofmt requirements...
  Successfully remade target file 'fmtcheck'.
Must remake target 'testacc'.
TF_ACC=1 go test $(go list ./... |grep -v 'vendor') -v -run TestAccDedicatedServerReinstall_basic -timeout 600m -p 10
?   	github.com/ovh/terraform-provider-ovh/v2	[no test files]
=== RUN   TestAccDedicatedServerReinstall_basic
--- PASS: TestAccDedicatedServerReinstall_basic (895.30s)
PASS
ok  	github.com/ovh/terraform-provider-ovh/v2/ovh	895.314s
?   	github.com/ovh/terraform-provider-ovh/v2/ovh/helpers	[no test files]
testing: warning: no tests to run
PASS
ok  	github.com/ovh/terraform-provider-ovh/v2/ovh/helpers/hashcode	(cached) [no tests to run]
?   	github.com/ovh/terraform-provider-ovh/v2/ovh/ovhwrap	[no test files]
?   	github.com/ovh/terraform-provider-ovh/v2/ovh/types	[no test files]
Successfully remade target file 'testacc'.
echo $?
0

Installation task 474435484 was performed successfully

Test Configuration:

  • Terraform version: terraform version: Terraform v1.12.2

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or issues
    I have added acceptance tests that prove my fix is effective or that my feature works
  • New and existing acceptance tests pass locally with my changes
  • I ran successfully go mod vendor if I added or modify go.mod file

@JayBeeDe JayBeeDe requested a review from a team as a code owner June 17, 2025 13:58
…tions.config_drive_metadata

ref: #PUBM-43183
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 this pull request may close these issues.

1 participant