Skip to content

Commit f9dbeb2

Browse files
authored
allow setting volume type for extra_volumes (#755)
1 parent 66ca7fe commit f9dbeb2

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

environments/site/tofu/node_group/nodes.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ resource "openstack_blockstorage_volume_v3" "compute" {
3636
name = "${var.cluster_name}-${each.key}"
3737
description = "Compute node ${each.value.node} volume ${each.value.volume}"
3838
size = var.extra_volumes[each.value.volume].size
39+
volume_type = var.extra_volumes[each.value.volume].volume_type
3940
}
4041

4142
resource "openstack_compute_volume_attach_v2" "compute" {

environments/site/tofu/node_group/variables.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,13 @@ variable "extra_volumes" {
6060
Keys are unique volume name.
6161
Values are a mapping with:
6262
size: Size of volume in GB
63+
volume_type: Optional. Type of volume, or cloud default
6364
**NB**: The order in /dev is not guaranteed to match the mapping
6465
EOF
6566
type = map(
6667
object({
6768
size = number
69+
volume_type = optional(string)
6870
})
6971
)
7072
default = {}

environments/site/tofu/variables.tf

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,11 @@ variable "login" {
6565
volume_backed_instances: Overrides variable volume_backed_instances
6666
root_volume_size: Overrides variable root_volume_size
6767
extra_volumes: Mapping defining additional volumes to create and attach
68-
Keys are unique volume name.
69-
Values are a mapping with:
68+
Keys are unique volume name.
69+
Values are a mapping with:
7070
size: Size of volume in GB
71-
**NB**: The order in /dev is not guaranteed to match the mapping
71+
volume_type: Optional. Type of volume, or cloud default
72+
**NB**: The order in /dev is not guaranteed to match the mapping
7273
fip_addresses: List of addresses of floating IPs to associate with
7374
nodes, in the same order as nodes parameter. The
7475
floating IPs must already be allocated to the project.
@@ -117,6 +118,7 @@ variable "compute" {
117118
Keys are unique volume name.
118119
Values are a mapping with:
119120
size: Size of volume in GB
121+
volume_type: Optional. Type of volume, or cloud default
120122
**NB**: The order in /dev is not guaranteed to match the mapping
121123
ip_addresses: Mapping of list of fixed IP addresses for nodes, keyed
122124
by network name, in same order as nodes parameter.

0 commit comments

Comments
 (0)