-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Labels
Description
Description
Availability Zone is marked as optional in server resource.
Not filling it will lead to calculated zone of eu01-m and result in server creation waiting: found non-GenericOpenApiError: create failed for server with id xxx: No valid host was found. There are not enough hosts available.
Steps to reproduce
terraform {
required_providers {
stackit = {
source = "stackitcloud/stackit"
}
}
}
provider "stackit" {
default_region = "eu01"
}
resource "stackit_server" "myhost" {
project_id = var.project_id
machine_type = var.arm_1c_4gb
name = "myhost"
boot_volume = {
size = 20
source_type = "image"
source_id = var.debian_12_arm64
}
}
tofu plan -out plan.outtofu apply plan.out
Actual behavior
$ tofu plan -out plan.out
...
OpenTofu used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
+ create
OpenTofu will perform the following actions:
# stackit_server.myhost will be created
+ resource "stackit_server" "myhost" {
+ availability_zone = (known after apply)
+ boot_volume = {
+ delete_on_termination = (known after apply)
+ id = (known after apply)
+ size = 20
+ source_id = "61443b25-97fc-4f5a-acd5-0645c3b1ed5d"
+ source_type = "image"
}
+ created_at = (known after apply)
+ id = (known after apply)
+ launched_at = (known after apply)
+ machine_type = "g1r.1d"
+ name = "myhost"
+ project_id = "xxx"
+ server_id = (known after apply)
+ updated_at = (known after apply)
}
Plan: 1 to add, 0 to change, 0 to destroy.
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Saved the plan to: plan.out
To perform exactly these actions, run the following command to apply:
tofu apply "plan.out"
$ tofu apply plan.out
stackit_server.myhost: Creating...
╷
│ Error: Error creating server
│
│ with stackit_server.myhost,
│ on main.tf line 14, in resource "stackit_server" "myhost":
│ 14: resource "stackit_server" "myhost" {
│
│ server creation waiting: found non-GenericOpenApiError: create failed for server with id 6d947931-xxx No valid
│ host was found. There are not enough hosts available.
╵Expected behavior
- Require availability zone or
- Calculate single AZ available to server deployments
Environment
- OS: Debian GNU/Linux 13.2
- Terraform version (see
terraform --version):OpenTofu v1.10.7 - Version of the STACKIT Terraform provider:
v0.71.0