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
33 stars 21 forks source link

not able to create vcpu servers #532

Closed mitnicki closed 4 months ago

mitnicki commented 4 months ago

Getting error when creating vcpu instances. Error is because ionos vdc doesnt have enough resources for cpu type ICELAKE when creating vcpu instnace. there would be enough resources at that moment for type SKYLAKE but the tf provider seems to only create vcpu instances of type ICELAKE against the terraform API. The VCPU Resource should use all resources that are possible. if ICELAKE is not available it should just take the ICELAKE Type.

ERROR IN TERRAFORM: Error: error waiting for state change for server creation Request failed with following error: [VDC-5-601] We are sorry there has been an error. Please contact our support team and state the error code in this message

adeatcu-ionos commented 4 months ago

Hello! For ionoscloud_vcpu_server, the cpu_family is a Computed attribute, the user has no control over it in Terraform, this behavior is decided by the API, I will leave the description for cpuFamily property from the API swagger:

cpuFamily:
          type: string
          description: >-
            CPU architecture on which server gets provisioned; not all CPU
            architectures are available in all datacenter regions; available CPU
            architectures can be retrieved from the datacenter resource; must
            not be provided for CUBE and VCPU servers.

From this description, we are interested in this: must not be provided for CUBE and VCPU servers.

This is the intended behavior, the user should not be able to set cpu_family in the Terraform configuration for a VCPU instance, so this is not a Terraform bug.

I will talk with the colleagues from the API to check whether or not you can create VCPU servers with other values for cpu_family.

mitnicki commented 4 months ago

hello, thank you for the answer. there is no bug. we had a code issue and created ionoscloud_server resource instead of ionoscloud_vcpu_server. sorry for confusion...