IBM-Cloud / terraform-provider-ibm

https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs
Mozilla Public License 2.0
341 stars 670 forks source link

Hourly baremetal server cannot be provisoned with 10Gbit/s port speed #4848

Open tlnd opened 1 year ago

tlnd commented 1 year ago

Community Note

Terraform CLI and Terraform IBM Provider Version

Terraform v1.6.0 on linux_amd64

Affected Resource(s)

Terraform Configuration Files

resource "ibm_compute_bare_metal" "dp-1000" {
  hostname            = "dp-1000"
  domain              = "example.net"
  #fixed_config_preset = "1U_8260_384GB_4X960GB_SSD_RAID10_RAID_10"
  fixed_config_preset = "1U_4210S_384GB_2X4TB_RAID_1"
  os_reference_code   = "UBUNTU_22_64"
  datacenter          = "fra04"
  network_speed       = 10000
  hourly_billing      = true
  ipv6_enabled        = false
  redundant_network   = true
}

Both listed fixed_config_preset options were tested, both fail for network_speed = 10000.

Debug Output

https://gist.github.com/tlnd/4ccd8d2a5c1578db2a283423bf98b73a

Panic Output

Expected Behavior

A baremetal server with 10 Gbit/s port speed should be provisioned.

Actual Behavior

The provisioning fails with HTTP 500 due to missing price in order template:

Error: Encountered problem trying to get the bare metal order template: SoftLayer_Exception_NotFound: Unable to find price for uplink port speeds with max speed of 10000. (HTTP 500)

Provisioning by using the web UI works for port speed 10 Gbit/s - so in general, the 10 Gbit/s port speed option is available for hourly-billed bare metal servers with preset configuration.

Steps to Reproduce

  1. terraform apply

Important Factoids

n/a

References

n/a

tlnd commented 1 year ago

As cross-check, I tried to provision the server using the IBM Cloud CLI - that works using

ibmcloud sl hardware create -d fra04 -D example.net -H dp-node -o UBUNTU_22_64 -p 10000 -s 1U_8260_384GB_4X960GB_SSD_RAID10_RAID_10

Hence, it seems that the TF provider is using different API calls/parameters than the IBM Cloud CLI or web UI.

A trace of ibmcloud shows that https://api.softlayer.com/rest/v3.1/SoftLayer_Product_Package/getAllObjects.json? is used before placing the order, while the TF provider calls https://api.softlayer.com/rest/v3/SoftLayer_Hardware/generateOrderTemplate.json - which fails with 500.