diff --git a/compute.tf b/compute.tf index 2d03eae2d001bfaddf153f5625095d9b8d3dc8b3..51b4d4f354df104081c50ed1a73ad0275a4d3b82 100644 --- a/compute.tf +++ b/compute.tf @@ -45,15 +45,6 @@ resource "openstack_compute_instance_v2" "mgr" { delete_on_termination = true } - block_device { - # and the volume to copy to - source_type = "blank" - destination_type = "volume" - volume_size = 10 - boot_index = 1 - delete_on_termination = true - } - network { uuid = openstack_networking_network_v2.public_network.id } @@ -88,13 +79,16 @@ resource "openstack_compute_instance_v2" "osd" { delete_on_termination = true } - block_device { - # and the volume to copy to - source_type = "blank" - destination_type = "volume" - volume_size = 10 - boot_index = 1 - delete_on_termination = true + dynamic "block_device" { # JBOD disks + for_each = var.osd_disk_sizes + + content { + source_type = "blank" + destination_type = "volume" + volume_size = block_device.value + boot_index = -1 + delete_on_termination = true + } } network { @@ -130,15 +124,6 @@ resource "openstack_compute_instance_v2" "mds" { delete_on_termination = true } - block_device { - # and the volume to copy to - source_type = "blank" - destination_type = "volume" - volume_size = 10 - boot_index = 1 - delete_on_termination = true - } - network { uuid = openstack_networking_network_v2.public_network.id } diff --git a/variables.tf b/variables.tf index 9cb38e900d09af947e81d0b6b9055a1954895a84..c245cccd76e0719e6ea5d829968adcebd3134ee4 100644 --- a/variables.tf +++ b/variables.tf @@ -61,3 +61,9 @@ variable "sles_ses_reg" { type = string description = "code to register for the storage package in SUSE" } + +variable "osd_disk_sizes" { + type = list(number) + default = [8, 8] + description = "Amount and size of disks (in GB) to add to each OSD node. By default, add two 8GB nodes" +}