Added (optional) parameter to set the volume size of the VM. Default value is 10 (GB)

This commit is contained in:
Francesco Mangiacrapa 2024-01-17 12:15:48 +01:00
parent 1f0274453f
commit 21a81ad956
5 changed files with 47 additions and 44 deletions

View File

@ -63,6 +63,7 @@ module "instance_with_data_volume" {
security_groups = [data.terraform_remote_state.privnet_dns_router.outputs.default_security_group_name, data.terraform_remote_state.privnet_dns_router.outputs.security_group_list.http_and_https_from_the_load_balancers],
server_groups_ids = [],
image_ref = module.common_variables.ubuntu_1804
image_volume_size = 80
volume = {
name = "dataminer_1_proto_1804_data_volume",
size = "80",

View File

@ -27,7 +27,7 @@ resource "openstack_compute_instance_v2" "instance_with_data_volume" {
block_device {
uuid = each.value.image_ref.uuid
source_type = "image"
volume_size = 10
volume_size = each.value.image_volume_size
boot_index = 0
destination_type = "volume"
delete_on_termination = false

View File

@ -9,6 +9,7 @@ variable "instances_with_data_volume_map" {
security_groups = list(string)
server_groups_ids = list(string)
image_ref = map(string)
image_volume_size = optional(number, 10)
volume = map(string)
}))
default = {

View File

@ -20,7 +20,7 @@ resource "openstack_compute_instance_v2" "smartgears_service" {
block_device {
uuid = each.value.image_ref.uuid
source_type = "image"
volume_size = 10
volume_size = each.value.image_volume_size
boot_index = 0
destination_type = "volume"
delete_on_termination = false

View File

@ -9,6 +9,7 @@ variable "instances_without_data_volume_map" {
security_groups = list(string)
server_groups_ids = list(string)
image_ref = map(string)
image_volume_size = optional(number, 10)
}))
default = {
smartgears_service = {