ionos-cloud / terraform-provider-ionoscloud

The IonosCloud Terraform provider gives the ability to deploy and configure resources using the IonosCloud APIs.
Mozilla Public License 2.0
35 stars 24 forks source link

boot_cdrom cannot be removed #23

Closed mflorin closed 11 months ago

mflorin commented 3 years ago

Description

When creating a server with the boot_cdrom attribute set, the attribute cannot be removed later on. Even if it is removed from the plan, the state is not updated and the server does not reflect the change. Subsequent runs of terraform plan will continue to report the boot_cdrom attribute as being removed.

Expected behavior

boot_cdrom attribute to be removed

Environment

Terraform version:

0.15.3

Provider version:

v5.1.7

OS:

OSX 11.2.3, Linux, Windows

How to Reproduce

  1. create a server with boot_cdrom set
  2. remove the boot_cdrom from the plan
  3. run the plan again
cristiGuranIonos commented 2 years ago

sdk issue

cristiGuranIonos commented 2 years ago

On hold until VDC makes bootcdrom nullable.

durandom commented 2 years ago

bump. shouldnt the api support it?

ionosctl server cdrom detach --datacenter-id 6f236468-...-e9a21f419543 --server-id 52d68029-...-fe424bb6545e --all

works for me

nightkr commented 2 years ago

This seems to have changed since the bug report, trying to remove boot_cdrom now gives this error:

╷
│ Error: boot_cdrom has to be a valid UUID, got: 
│ 
│   with ionoscloud_server.bootstrap[0],
│   on infra.tf line 89, in resource "ionoscloud_server" "bootstrap":
│   89: resource "ionoscloud_server" "bootstrap" {
│ 
╵

On versions:

Terraform v1.3.1
on linux_amd64
+ provider registry.terraform.io/ionos-cloud/ionoscloud v6.3.1

Deploying a fresh server without boot_cdrom ever set works fine.

cbeti-ionos commented 11 months ago

Hi, direct usage of the boot_cdrom attribute has been deprecated in the latest release. (https://github.com/ionos-cloud/terraform-provider-ionoscloud/pull/507) Managing the boot device of a server can now be achieved through the ionoscloud_server_boot_device_selection resource, so you can also set/unset boot_cdrom here.