From 38affaec8d18ddeb87bcca94d3ad1e7f81ffc5a9 Mon Sep 17 00:00:00 2001 From: Amy Brown Date: Wed, 25 Sep 2019 16:42:56 -0500 Subject: [PATCH 1/2] Primaries and IPM When internal production mode is set, the number of primaries needs to be hard set at 3, due to scaling issues with ceph. Otherwise, the value of the count variable will be used. --- modules/primaries/vms.tf | 2 +- variables.tf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/primaries/vms.tf b/modules/primaries/vms.tf index 15f0c39f..ab1ec9fd 100644 --- a/modules/primaries/vms.tf +++ b/modules/primaries/vms.tf @@ -1,5 +1,5 @@ resource "azurerm_virtual_machine" "primary" { - count = "${var.vm["count"]}" + count = "${var.install_type == "ipm" ? 3 : var.vm["count"]}" name = "${local.prefix}-${count.index}" resource_group_name = "${var.rg_name}" location = "${var.location}" diff --git a/variables.tf b/variables.tf index d55f78c1..1e05eb97 100644 --- a/variables.tf +++ b/variables.tf @@ -187,7 +187,7 @@ variable "postgresql_user" { } variable "primary_count" { - description = "The number of primary virtual machines to create." + description = "The number of primary virtual machines to create, should be set to 3 or 5." default = 3 } From 6eb1bf42da910e4ae8626c1593b8e5772b43c63f Mon Sep 17 00:00:00 2001 From: Amy Brown Date: Fri, 27 Sep 2019 10:07:33 -0500 Subject: [PATCH 2/2] Added comment re primary_count Added an explanation around the count of the primary vm resource. --- modules/primaries/vms.tf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/primaries/vms.tf b/modules/primaries/vms.tf index ab1ec9fd..cd850dab 100644 --- a/modules/primaries/vms.tf +++ b/modules/primaries/vms.tf @@ -1,4 +1,7 @@ resource "azurerm_virtual_machine" "primary" { + /* The number of primaries must be hard coded to 3 when Internal Production Mode + is selected. Currently, that mode does not support scaling. In other modes, the + cluster can be scaled according the primary_count variable. */ count = "${var.install_type == "ipm" ? 3 : var.vm["count"]}" name = "${local.prefix}-${count.index}" resource_group_name = "${var.rg_name}"