diff --git a/docs/guides/dedicated_server_migration.md b/docs/guides/dedicated_server_migration.md index 085f45f4f..2094a0566 100644 --- a/docs/guides/dedicated_server_migration.md +++ b/docs/guides/dedicated_server_migration.md @@ -92,7 +92,7 @@ resource "ovh_dedicated_server" "srv" { # lifecycle { - ignore_changes = [os, customizations, properties, storage] + ignore_changes = [os, customizations, storage] } } ``` diff --git a/docs/resources/dedicated_server.md b/docs/resources/dedicated_server.md index 285a24553..9e5c1818b 100644 --- a/docs/resources/dedicated_server.md +++ b/docs/resources/dedicated_server.md @@ -140,7 +140,6 @@ resource "ovh_dedicated_server" "server" { * `raid_level` - Software raid type * `size` - Partition size in MiB * `scheme_name` - Partitioning scheme (if applicable with selected operating system) -* `properties` - Deprecated, has no effect ### Arguments used to control the lifecycle of a dedicated server diff --git a/docs/resources/dedicated_server_reinstall_task.md b/docs/resources/dedicated_server_reinstall_task.md index 5624ea0d0..ce36cd37e 100644 --- a/docs/resources/dedicated_server_reinstall_task.md +++ b/docs/resources/dedicated_server_reinstall_task.md @@ -239,8 +239,6 @@ The following arguments are supported: ~> **WARNING** Some customizations may be required on some Operating Systems. [Check how to list the available and required customization(s) for your operating system](https://help.ovhcloud.com/csm/en-dedicated-servers-api-os-installation?id=kb_article_view&sysparm_article=KB0061951#os-inputs) (do not forget to adapt camel case customization name to snake case parameter). -* `properties` - Deprecated, has no effect - * `storage`: OS reinstallation storage configurations. [More details about disks, hardware/software RAID and partitioning configuration](https://help.ovhcloud.com/csm/en-dedicated-servers-api-partitioning?id=kb_article_view&sysparm_article=KB0043882) (do not forget to adapt camel case parameters to snake case parameters). * `disk_group_id`: Disk group id to install the OS to (default is 0, meaning automatic). * `hardware_raid`: Hardware Raid configurations (if not specified, all disks of the chosen disk group id will be configured in JBOD mode). diff --git a/examples/resources/dedicated_server_reinstall_task/example_4.tf b/examples/resources/dedicated_server_reinstall_task/example_4.tf index a737cb839..279299bd4 100644 --- a/examples/resources/dedicated_server_reinstall_task/example_4.tf +++ b/examples/resources/dedicated_server_reinstall_task/example_4.tf @@ -19,6 +19,6 @@ resource "ovh_dedicated_server_reinstall_task" "server_install" { http_headers = { Authorization = "Basic bG9naW46cGFzc3dvcmQ=" } - image_url = "https://github.com/ashmonger/akution_test/releases/download/0.5-compress/deb11k6.qcow2" + image_url = "https://github.com/ashmonger/akution_test/releases/latest/download/deb11k6.qcow2" } } diff --git a/ovh/resource_dedicated_server.go b/ovh/resource_dedicated_server.go index 1f7c75ef1..06a2c4a1e 100644 --- a/ovh/resource_dedicated_server.go +++ b/ovh/resource_dedicated_server.go @@ -302,10 +302,9 @@ func (r *dedicatedServerResource) Update(ctx context.Context, req resource.Updat responseData.MergeWith(&stateData) responseData.ID = responseData.ServiceName - // Explicitely set Customizations/Properties/Storage to what was defined in the plan + // Explicitely set Customizations/Storage to what was defined in the plan // as we can't determine the right thing to do in MergeWith function responseData.Customizations = planData.Customizations - responseData.Properties = planData.Properties responseData.Storage = planData.Storage // Same thing for the flags to control reinstallation, set the plan value explicitly @@ -464,8 +463,7 @@ func (r *dedicatedServerResource) reinstallDedicatedServer(ctx context.Context, if planData.Os.ValueString() != "" && stateData.Os.ValueString() != planData.Os.ValueString() || !stateData.Customizations.Equal(planData.Customizations) || - !stateData.Storage.Equal(planData.Storage) || - !stateData.Properties.Equal(planData.Properties) { + !stateData.Storage.Equal(planData.Storage) { shouldReinstall = true } } diff --git a/ovh/resource_dedicated_server_gen.go b/ovh/resource_dedicated_server_gen.go index b66e96d34..6c6bb339e 100644 --- a/ovh/resource_dedicated_server_gen.go +++ b/ovh/resource_dedicated_server_gen.go @@ -350,13 +350,6 @@ func DedicatedServerResourceSchema(ctx context.Context) schema.Schema { boolplanmodifier.UseStateForUnknown(), }, }, - "properties": schema.MapAttribute{ - CustomType: ovhtypes.NewTfMapNestedType[ovhtypes.TfStringValue](ctx), - Optional: true, - Description: "Arbitrary properties to pass to cloud-init's config drive datasource", - MarkdownDescription: "Arbitrary properties to pass to cloud-init's config drive datasource", - DeprecationMessage: "Attribute 'properties' is deprecated and has no effect", - }, "rack": schema.StringAttribute{ CustomType: ovhtypes.TfStringType{}, Computed: true, @@ -715,7 +708,6 @@ type DedicatedServerModel struct { Os ovhtypes.TfStringValue `tfsdk:"os" json:"os"` PowerState ovhtypes.TfStringValue `tfsdk:"power_state" json:"powerState"` ProfessionalUse ovhtypes.TfBoolValue `tfsdk:"professional_use" json:"professionalUse"` - Properties ovhtypes.TfMapNestedValue[ovhtypes.TfStringValue] `tfsdk:"properties" json:"properties"` Rack ovhtypes.TfStringValue `tfsdk:"rack" json:"rack"` PreventInstallOnCreate ovhtypes.TfBoolValue `tfsdk:"prevent_install_on_create" json:"-"` PreventInstallOnImport ovhtypes.TfBoolValue `tfsdk:"prevent_install_on_import" json:"-"` @@ -810,10 +802,6 @@ func (v *DedicatedServerModel) MergeWith(other *DedicatedServerModel) { v.Os = other.Os } - if (v.Properties.IsUnknown() || v.Properties.IsNull()) && !other.Properties.IsUnknown() { - v.Properties = other.Properties - } - if (v.PowerState.IsUnknown() || v.PowerState.IsNull()) && !other.PowerState.IsUnknown() { v.PowerState = other.PowerState } @@ -822,10 +810,6 @@ func (v *DedicatedServerModel) MergeWith(other *DedicatedServerModel) { v.ProfessionalUse = other.ProfessionalUse } - if (v.Properties.IsUnknown() || v.Properties.IsNull()) && !other.Properties.IsUnknown() { - v.Properties = other.Properties - } - if (v.Rack.IsUnknown() || v.Rack.IsNull()) && !other.Rack.IsUnknown() { v.Rack = other.Rack } @@ -932,19 +916,18 @@ func (v *DedicatedServerModel) ToOrder() *OrderModel { } type DedicatedServerWritableModel struct { - BootId *ovhtypes.TfInt64Value `tfsdk:"boot_id" json:"bootId,omitempty"` - BootScript *ovhtypes.TfStringValue `tfsdk:"boot_script" json:"bootScript,omitempty"` - Customizations *CustomizationsWritableValue `tfsdk:"customizations" json:"customizations,omitempty"` - EfiBootloaderPath *ovhtypes.TfStringValue `tfsdk:"efi_bootloader_path" json:"efiBootloaderPath,omitempty"` - Monitoring *ovhtypes.TfBoolValue `tfsdk:"monitoring" json:"monitoring,omitempty"` - NoIntervention *ovhtypes.TfBoolValue `tfsdk:"no_intervention" json:"noIntervention,omitempty"` - Properties *ovhtypes.TfMapNestedValue[ovhtypes.TfStringValue] `tfsdk:"properties" json:"properties,omitempty"` - RescueMail *ovhtypes.TfStringValue `tfsdk:"rescue_mail" json:"rescueMail,omitempty"` - RescueSshKey *ovhtypes.TfStringValue `tfsdk:"rescue_ssh_key" json:"rescueSshKey,omitempty"` - RootDevice *ovhtypes.TfStringValue `tfsdk:"root_device" json:"rootDevice,omitempty"` - State *ovhtypes.TfStringValue `tfsdk:"state" json:"state,omitempty"` - Storage []*StorageWritableValue `tfsdk:"storage" json:"storage,omitempty"` - Os *ovhtypes.TfStringValue `tfsdk:"os" json:"operatingSystem,omitempty"` + BootId *ovhtypes.TfInt64Value `tfsdk:"boot_id" json:"bootId,omitempty"` + BootScript *ovhtypes.TfStringValue `tfsdk:"boot_script" json:"bootScript,omitempty"` + Customizations *CustomizationsWritableValue `tfsdk:"customizations" json:"customizations,omitempty"` + EfiBootloaderPath *ovhtypes.TfStringValue `tfsdk:"efi_bootloader_path" json:"efiBootloaderPath,omitempty"` + Monitoring *ovhtypes.TfBoolValue `tfsdk:"monitoring" json:"monitoring,omitempty"` + NoIntervention *ovhtypes.TfBoolValue `tfsdk:"no_intervention" json:"noIntervention,omitempty"` + RescueMail *ovhtypes.TfStringValue `tfsdk:"rescue_mail" json:"rescueMail,omitempty"` + RescueSshKey *ovhtypes.TfStringValue `tfsdk:"rescue_ssh_key" json:"rescueSshKey,omitempty"` + RootDevice *ovhtypes.TfStringValue `tfsdk:"root_device" json:"rootDevice,omitempty"` + State *ovhtypes.TfStringValue `tfsdk:"state" json:"state,omitempty"` + Storage []*StorageWritableValue `tfsdk:"storage" json:"storage,omitempty"` + Os *ovhtypes.TfStringValue `tfsdk:"os" json:"operatingSystem,omitempty"` } func (v DedicatedServerModel) ToCreate() *DedicatedServerWritableModel { @@ -1006,10 +989,6 @@ func (v DedicatedServerModel) ToReinstall(onlyOS bool) *DedicatedServerWritableM res.Storage = append(res.Storage, elem.(StorageValue).ToCreate()) } } - - if !v.Properties.IsUnknown() && !v.Properties.IsNull() { - res.Properties = &v.Properties - } } return res diff --git a/ovh/resource_dedicated_server_reinstall_task.go b/ovh/resource_dedicated_server_reinstall_task.go index f74b69e11..17f497131 100644 --- a/ovh/resource_dedicated_server_reinstall_task.go +++ b/ovh/resource_dedicated_server_reinstall_task.go @@ -135,15 +135,6 @@ func resourceDedicatedServerReinstallTask() *schema.Resource { }, }, }, - "properties": { - Type: schema.TypeMap, - Optional: true, - ForceNew: true, - Description: "Attribute 'properties' is deprecated and has no effect", - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, "storage": { Type: schema.TypeList, Optional: true, diff --git a/ovh/resource_dedicated_server_reinstall_task_test.go b/ovh/resource_dedicated_server_reinstall_task_test.go index 84999e42d..91ec0e9b9 100644 --- a/ovh/resource_dedicated_server_reinstall_task_test.go +++ b/ovh/resource_dedicated_server_reinstall_task_test.go @@ -292,7 +292,7 @@ resource "ovh_dedicated_server_reinstall_task" "server_reinstall" { os = "byolinux_64" customizations { hostname = "mon-tux" - image_url = "https://github.com/ashmonger/akution_test/releases/download/0.6-fixCache/deb11k6.qcow2" + image_url = "https://github.com/ashmonger/akution_test/releases/latest/download/deb11k6.qcow2" efi_bootloader_path = "\\efi\\debian\\grubx64.efi" ssh_key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIrODOo0SvY5f0TlQNvGHIRKzr4bHPa+D5bYF18RiOgP email@example.com" config_drive_user_data = "c3NoX2F1dGhvcml6ZWRfa2V5czoKICAtIHNzaC1yc2EgQUFBQUI4ZGpZaXc9PSBteXNlbGZAbXlkb21haW4ubmV0Cgp1c2VyczoKICAtIG5hbWU6IHBhdGllbnQwCiAgICBzdWRvOiBBTEw9KEFMTCkgTk9QQVNTV0Q6QUxMCiAgICBncm91cHM6IHVzZXJzLCBzdWRvCiAgICBzaGVsbDogL2Jpbi9iYXNoCiAgICBsb2NrX3Bhc3N3ZDogZmFsc2UKICAgIHNzaF9hdXRob3JpemVkX2tleXM6CiAgICAgIC0gc3NoLXJzYSBBQUFBQjhkallpdz09IG15c2VsZkBteWRvbWFpbi5uZXQKZGlzYWJsZV9yb290OiBmYWxzZQpwYWNrYWdlczoKICAtIHZpbQogIC0gdHJlZQpmaW5hbF9tZXNzYWdlOiBUaGUgc3lzdGVtIGlzIGZpbmFsbHkgdXAsIGFmdGVyICRVUFRJTUUgc2Vjb25kcw==" diff --git a/ovh/types_dedicated_server.go b/ovh/types_dedicated_server.go index ff855ef04..ef5e76b3e 100644 --- a/ovh/types_dedicated_server.go +++ b/ovh/types_dedicated_server.go @@ -119,7 +119,6 @@ type DedicatedServerTask struct { type DedicatedServerReinstallTaskCreateOpts struct { Os string `json:"operatingSystem"` Customizations *DedicatedServerReinstallTaskCustomizations `json:"customizations,omitempty"` - Properties map[string]interface{} `json:"properties,omitempty"` Storage []DedicatedServerReinstallTaskStorage `json:"storage,omitempty"` } @@ -131,11 +130,6 @@ func (opts *DedicatedServerReinstallTaskCreateOpts) FromResource(d *schema.Resou opts.Customizations = (&DedicatedServerReinstallTaskCustomizations{}).FromResource(d, "customizations.0") } - Properties := d.Get("properties").(map[string]interface{}) - if len(Properties) >= 1 { - opts.Properties = d.Get("properties").(map[string]interface{}) - } - Storage := d.Get("storage").([]interface{}) if len(Storage) >= 1 { opts.Storage = make([]DedicatedServerReinstallTaskStorage, len(Storage)) diff --git a/templates/guides/dedicated_server_migration.md b/templates/guides/dedicated_server_migration.md index 085f45f4f..2094a0566 100644 --- a/templates/guides/dedicated_server_migration.md +++ b/templates/guides/dedicated_server_migration.md @@ -92,7 +92,7 @@ resource "ovh_dedicated_server" "srv" { # lifecycle { - ignore_changes = [os, customizations, properties, storage] + ignore_changes = [os, customizations, storage] } } ``` diff --git a/templates/resources/dedicated_server.md.tmpl b/templates/resources/dedicated_server.md.tmpl index e3e52df42..b0d3b25ae 100644 --- a/templates/resources/dedicated_server.md.tmpl +++ b/templates/resources/dedicated_server.md.tmpl @@ -87,7 +87,6 @@ Use this resource to order and manage a dedicated server. * `raid_level` - Software raid type * `size` - Partition size in MiB * `scheme_name` - Partitioning scheme (if applicable with selected operating system) -* `properties` - Attribute 'properties' is deprecated and has no effect ### Arguments used to control the lifecycle of a dedicated server diff --git a/templates/resources/dedicated_server_reinstall_task.md.tmpl b/templates/resources/dedicated_server_reinstall_task.md.tmpl index 109dfe30c..df8f30f4b 100644 --- a/templates/resources/dedicated_server_reinstall_task.md.tmpl +++ b/templates/resources/dedicated_server_reinstall_task.md.tmpl @@ -85,8 +85,6 @@ The following arguments are supported: ~> **WARNING** Some customizations may be required on some Operating Systems. [Check how to list the available and required customization(s) for your operating system](https://help.ovhcloud.com/csm/en-dedicated-servers-api-os-installation?id=kb_article_view&sysparm_article=KB0061951#os-inputs) (do not forget to adapt camel case customization name to snake case parameter). -* `properties` - Attribute 'properties' is deprecated and has no effect. - * `storage`: OS reinstallation storage configurations. [More details about disks, hardware/software RAID and partitioning configuration](https://help.ovhcloud.com/csm/en-dedicated-servers-api-partitioning?id=kb_article_view&sysparm_article=KB0043882) (do not forget to adapt camel case parameters to snake case parameters). * `disk_group_id`: Disk group id to install the OS to (default is 0, meaning automatic). * `hardware_raid`: Hardware Raid configurations (if not specified, all disks of the chosen disk group id will be configured in JBOD mode).