Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terraform gcp vm size internal variables #270

Merged
merged 2 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion terraform/gcp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ For detailed information and deployment options have a look at `terraform.tfvars

## High level description

This Terraform configuration files in this directory can be used to create the infrastructure required to install a SAP HanaSR cluster on SUSE Linux Enterprise Server for SAP Applications in the **Google Cloud Platform**.
This Terraform configuration files in this directory can be used to create the infrastructure required to install a SAP HanaSR cluster on Suse Linux Enterprise Server for SAP Applications in the **Google Cloud Platform**.

![Highlevel description](../doc/highlevel_description_gcp.png)

Expand Down
9 changes: 5 additions & 4 deletions terraform/gcp/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ module "drbd_node" {
name = var.drbd_name
network_domain = var.drbd_network_domain == "" ? var.network_domain : var.drbd_network_domain
drbd_count = var.drbd_enabled == true ? 2 : 0
machine_type = var.drbd_machine_type
vm_size = var.drbd_machine_type
compute_zones = local.compute_zones
network_name = local.vpc_name
network_subnet_name = local.subnet_name
Expand All @@ -164,7 +164,7 @@ module "netweaver_node" {
network_domain = var.netweaver_network_domain == "" ? var.network_domain : var.netweaver_network_domain
xscs_server_count = local.netweaver_xscs_server_count
app_server_count = var.netweaver_enabled ? var.netweaver_app_server_count : 0
machine_type = var.netweaver_machine_type
vm_size = var.netweaver_machine_type
compute_zones = local.compute_zones
network_name = local.vpc_name
network_subnet_name = local.subnet_name
Expand All @@ -182,7 +182,7 @@ module "hana_node" {
name = var.hana_name
network_domain = var.hana_network_domain == "" ? var.network_domain : var.hana_network_domain
hana_count = var.hana_count
machine_type = var.machine_type
vm_size = var.machine_type
compute_zones = local.compute_zones
network_name = local.vpc_name
network_subnet_name = local.subnet_name
Expand All @@ -204,6 +204,7 @@ module "monitoring" {
name = var.monitoring_name
network_domain = var.monitoring_network_domain == "" ? var.network_domain : var.monitoring_network_domain
monitoring_enabled = var.monitoring_enabled
vm_size = var.machine_type_monitor_server
compute_zones = local.compute_zones
network_subnet_name = local.subnet_name
os_image = local.monitoring_os_image
Expand All @@ -216,7 +217,7 @@ module "iscsi_server" {
name = var.iscsi_name
network_domain = var.iscsi_network_domain == "" ? var.network_domain : var.iscsi_network_domain
iscsi_count = local.iscsi_enabled == true ? var.iscsi_count : 0
machine_type = var.machine_type_iscsi_server
vm_size = var.machine_type_iscsi_server
compute_zones = local.compute_zones
network_subnet_name = local.subnet_name
os_image = local.iscsi_os_image
Expand Down
2 changes: 1 addition & 1 deletion terraform/gcp/modules/drbd_node/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ module "drbd-load-balancer" {
}

resource "google_compute_instance" "drbd" {
machine_type = var.machine_type
machine_type = var.vm_size
name = "${var.common_variables["deployment_name"]}-${var.name}${format("%02d", count.index + 1)}"
count = var.drbd_count
zone = element(var.compute_zones, count.index)
Expand Down
38 changes: 20 additions & 18 deletions terraform/gcp/modules/drbd_node/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,20 @@ variable "name" {
type = string
}

variable "machine_type" {
type = string
default = "n1-standard-4"
variable "drbd_count" {
description = "Number of DRDB machines to deploy"
type = number
default = 2
}

variable "vm_size" {
description = "The instance type of DRDB node"
type = string
}

variable "os_image" {
description = "sles4sap image used to create this module machines."
type = string
}

variable "compute_zones" {
Expand All @@ -27,16 +38,6 @@ variable "network_subnet_name" {
type = string
}

variable "drbd_count" {
description = "Count of drbd cluster nodes"
type = string
default = "2"
}

variable "os_image" {
description = "Image used to create the machine"
type = string
}

variable "network_domain" {
description = "hostname's network domain"
Expand Down Expand Up @@ -65,11 +66,6 @@ variable "host_ips" {
type = list(string)
}

variable "iscsi_srv_ip" {
description = "IP for iSCSI server"
type = list(string)
}

variable "nfs_mounting_point" {
description = "Mounting point of the NFS share created in to of DRBD (`/mnt` must not be used in Azure)"
type = string
Expand All @@ -79,3 +75,9 @@ variable "nfs_export_name" {
description = "Name of the created export in the NFS service. Usually, the `sid` of the SAP instances is used"
type = string
}

variable "iscsi_srv_ip" {
description = "iscsi server address"
type = list(string)
}

2 changes: 1 addition & 1 deletion terraform/gcp/modules/hana_node/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ module "hana-secondary-load-balancer" {
}

resource "google_compute_instance" "clusternodes" {
machine_type = var.machine_type
machine_type = var.vm_size
name = "${var.common_variables["deployment_name"]}-${var.name}${format("%02d", count.index + 1)}"
count = var.hana_count
zone = element(var.compute_zones, count.index)
Expand Down
21 changes: 11 additions & 10 deletions terraform/gcp/modules/hana_node/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,19 @@ variable "name" {
}

variable "hana_count" {
type = string
default = "2"
description = "Number of HANA machines to deploy"
type = number
default = 2
}

variable "machine_type" {
type = string
default = "n1-highmem-32"
variable "vm_size" {
description = "The instance type of HANA node"
type = string
}

variable "os_image" {
description = "sles4sap image used to create this module machines."
type = string
}

variable "compute_zones" {
Expand All @@ -32,11 +38,6 @@ variable "network_subnet_name" {
type = string
}

variable "os_image" {
description = "Image used to create the machine"
type = string
}

variable "network_domain" {
description = "hostname's network domain"
type = string
Expand Down
2 changes: 1 addition & 1 deletion terraform/gcp/modules/iscsi_server/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ resource "google_compute_instance" "iscsisrv" {
count = var.iscsi_count
name = "${var.common_variables["deployment_name"]}-${var.name}${format("%02d", count.index + 1)}"
description = "iSCSI server"
machine_type = var.machine_type
machine_type = var.vm_size
zone = element(var.compute_zones, 0)

can_ip_forward = true
Expand Down
26 changes: 13 additions & 13 deletions terraform/gcp/modules/iscsi_server/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,19 @@ variable "name" {
type = string
}

variable "machine_type" {
type = string
default = "custom-1-2048"
variable "iscsi_count" {
description = "Number of ISCSI machines to deploy"
type = number
}

variable "vm_size" {
description = "The instance type of ISCSI node"
type = string
}

variable "os_image" {
description = "sles4sap image used to create this module machines."
type = string
}

variable "compute_zones" {
Expand All @@ -22,21 +32,11 @@ variable "network_subnet_name" {
type = string
}

variable "os_image" {
description = "Image used to create the machine"
type = string
}

variable "network_domain" {
description = "hostname's network domain"
type = string
}

variable "iscsi_count" {
type = number
description = "Number of iscsi machines to deploy"
}

variable "host_ips" {
description = "List of ip addresses to set to the machines"
type = list(string)
Expand Down
2 changes: 1 addition & 1 deletion terraform/gcp/modules/monitoring/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ resource "google_compute_instance" "monitoring" {
count = var.monitoring_enabled == true ? 1 : 0
name = "${var.common_variables["deployment_name"]}-${var.name}"
description = "Monitoring server"
machine_type = "custom-1-2048"
machine_type = var.vm_size
zone = element(var.compute_zones, 0)

can_ip_forward = true
Expand Down
17 changes: 11 additions & 6 deletions terraform/gcp/modules/monitoring/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,22 @@ variable "name" {
type = string
}

variable "vm_size" {
description = "The instance type of MONITOR node"
type = string
}

variable "monitoring_enabled" {
description = "enable the host to be monitored by exporters, e.g node_exporter"
type = bool
default = false
}

variable "os_image" {
description = "sles4sap image used to create this module machines."
type = string
}

variable "compute_zones" {
description = "gcp compute zones data"
type = list(string)
Expand All @@ -23,18 +33,13 @@ variable "network_subnet_name" {
type = string
}

variable "os_image" {
description = "Image used to create the machine"
type = string
}

variable "network_domain" {
description = "hostname's network domain"
type = string
}

variable "monitoring_srv_ip" {
description = "Monitoring server address"
description = "monitoring server address"
type = string
default = ""
}
2 changes: 1 addition & 1 deletion terraform/gcp/modules/netweaver_node/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ module "netweaver-load-balancer-ers" {
}

resource "google_compute_instance" "netweaver" {
machine_type = var.machine_type
machine_type = var.vm_size
name = "${var.common_variables["deployment_name"]}-${var.name}${format("%02d", count.index + 1)}"
count = local.vm_count
zone = element(var.compute_zones, count.index)
Expand Down
36 changes: 18 additions & 18 deletions terraform/gcp/modules/netweaver_node/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,24 @@ variable "name" {
type = string
}

variable "machine_type" {
type = string
default = "n1-standard-4"
variable "xscs_server_count" {
description = "Number of xscs nodes"
type = number
default = 2
}

variable "app_server_count" {
type = number
default = 2
}

variable "vm_size" {
type = string
}

variable "os_image" {
description = "sles4sap image used to create this module machines."
type = string
}

variable "compute_zones" {
Expand All @@ -27,21 +42,6 @@ variable "network_subnet_name" {
type = string
}

variable "xscs_server_count" {
type = number
default = 2
}

variable "app_server_count" {
type = number
default = 2
}

variable "os_image" {
description = "Image used to create the machine"
type = string
}

variable "network_domain" {
description = "hostname's network domain"
type = string
Expand Down
Loading
Loading