From f3013f00a07b85e2644b148faa48c0bfa4da6eac Mon Sep 17 00:00:00 2001 From: Steve Brasier Date: Thu, 7 Aug 2025 12:12:26 +0000 Subject: [PATCH] allow setting volume type for extra_volumes --- environments/site/tofu/node_group/nodes.tf | 1 + environments/site/tofu/node_group/variables.tf | 2 ++ environments/site/tofu/variables.tf | 8 +++++--- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/environments/site/tofu/node_group/nodes.tf b/environments/site/tofu/node_group/nodes.tf index f3f9ab91f..340a6c952 100644 --- a/environments/site/tofu/node_group/nodes.tf +++ b/environments/site/tofu/node_group/nodes.tf @@ -36,6 +36,7 @@ resource "openstack_blockstorage_volume_v3" "compute" { name = "${var.cluster_name}-${each.key}" description = "Compute node ${each.value.node} volume ${each.value.volume}" size = var.extra_volumes[each.value.volume].size + volume_type = var.extra_volumes[each.value.volume].volume_type } resource "openstack_compute_volume_attach_v2" "compute" { diff --git a/environments/site/tofu/node_group/variables.tf b/environments/site/tofu/node_group/variables.tf index deb174b91..110ba8115 100644 --- a/environments/site/tofu/node_group/variables.tf +++ b/environments/site/tofu/node_group/variables.tf @@ -60,11 +60,13 @@ variable "extra_volumes" { Keys are unique volume name. Values are a mapping with: size: Size of volume in GB + volume_type: Optional. Type of volume, or cloud default **NB**: The order in /dev is not guaranteed to match the mapping EOF type = map( object({ size = number + volume_type = optional(string) }) ) default = {} diff --git a/environments/site/tofu/variables.tf b/environments/site/tofu/variables.tf index a6626ab6e..a6a78bcb1 100644 --- a/environments/site/tofu/variables.tf +++ b/environments/site/tofu/variables.tf @@ -65,10 +65,11 @@ variable "login" { volume_backed_instances: Overrides variable volume_backed_instances root_volume_size: Overrides variable root_volume_size extra_volumes: Mapping defining additional volumes to create and attach - Keys are unique volume name. - Values are a mapping with: + Keys are unique volume name. + Values are a mapping with: size: Size of volume in GB - **NB**: The order in /dev is not guaranteed to match the mapping + volume_type: Optional. Type of volume, or cloud default + **NB**: The order in /dev is not guaranteed to match the mapping fip_addresses: List of addresses of floating IPs to associate with nodes, in the same order as nodes parameter. The floating IPs must already be allocated to the project. @@ -117,6 +118,7 @@ variable "compute" { Keys are unique volume name. Values are a mapping with: size: Size of volume in GB + volume_type: Optional. Type of volume, or cloud default **NB**: The order in /dev is not guaranteed to match the mapping ip_addresses: Mapping of list of fixed IP addresses for nodes, keyed by network name, in same order as nodes parameter.