Skip to content

Commit 83a0360

Browse files
Merge pull request #270 from mpagot/terraform_gcp_vm_size
Terraform gcp vm size internal variables
2 parents 1fa092a + 8a53c31 commit 83a0360

File tree

13 files changed

+120
-104
lines changed

13 files changed

+120
-104
lines changed

terraform/gcp/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ For detailed information and deployment options have a look at `terraform.tfvars
7979
8080
## High level description
8181
82-
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**.
82+
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**.
8383
8484
![Highlevel description](../doc/highlevel_description_gcp.png)
8585

terraform/gcp/main.tf

+5-4
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ module "drbd_node" {
143143
name = var.drbd_name
144144
network_domain = var.drbd_network_domain == "" ? var.network_domain : var.drbd_network_domain
145145
drbd_count = var.drbd_enabled == true ? 2 : 0
146-
machine_type = var.drbd_machine_type
146+
vm_size = var.drbd_machine_type
147147
compute_zones = local.compute_zones
148148
network_name = local.vpc_name
149149
network_subnet_name = local.subnet_name
@@ -164,7 +164,7 @@ module "netweaver_node" {
164164
network_domain = var.netweaver_network_domain == "" ? var.network_domain : var.netweaver_network_domain
165165
xscs_server_count = local.netweaver_xscs_server_count
166166
app_server_count = var.netweaver_enabled ? var.netweaver_app_server_count : 0
167-
machine_type = var.netweaver_machine_type
167+
vm_size = var.netweaver_machine_type
168168
compute_zones = local.compute_zones
169169
network_name = local.vpc_name
170170
network_subnet_name = local.subnet_name
@@ -182,7 +182,7 @@ module "hana_node" {
182182
name = var.hana_name
183183
network_domain = var.hana_network_domain == "" ? var.network_domain : var.hana_network_domain
184184
hana_count = var.hana_count
185-
machine_type = var.machine_type
185+
vm_size = var.machine_type
186186
compute_zones = local.compute_zones
187187
network_name = local.vpc_name
188188
network_subnet_name = local.subnet_name
@@ -204,6 +204,7 @@ module "monitoring" {
204204
name = var.monitoring_name
205205
network_domain = var.monitoring_network_domain == "" ? var.network_domain : var.monitoring_network_domain
206206
monitoring_enabled = var.monitoring_enabled
207+
vm_size = var.machine_type_monitor_server
207208
compute_zones = local.compute_zones
208209
network_subnet_name = local.subnet_name
209210
os_image = local.monitoring_os_image
@@ -216,7 +217,7 @@ module "iscsi_server" {
216217
name = var.iscsi_name
217218
network_domain = var.iscsi_network_domain == "" ? var.network_domain : var.iscsi_network_domain
218219
iscsi_count = local.iscsi_enabled == true ? var.iscsi_count : 0
219-
machine_type = var.machine_type_iscsi_server
220+
vm_size = var.machine_type_iscsi_server
220221
compute_zones = local.compute_zones
221222
network_subnet_name = local.subnet_name
222223
os_image = local.iscsi_os_image

terraform/gcp/modules/drbd_node/main.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ module "drbd-load-balancer" {
5656
}
5757

5858
resource "google_compute_instance" "drbd" {
59-
machine_type = var.machine_type
59+
machine_type = var.vm_size
6060
name = "${var.common_variables["deployment_name"]}-${var.name}${format("%02d", count.index + 1)}"
6161
count = var.drbd_count
6262
zone = element(var.compute_zones, count.index)

terraform/gcp/modules/drbd_node/variables.tf

+20-18
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,20 @@ variable "name" {
77
type = string
88
}
99

10-
variable "machine_type" {
11-
type = string
12-
default = "n1-standard-4"
10+
variable "drbd_count" {
11+
description = "Number of DRDB machines to deploy"
12+
type = number
13+
default = 2
14+
}
15+
16+
variable "vm_size" {
17+
description = "The instance type of DRDB node"
18+
type = string
19+
}
20+
21+
variable "os_image" {
22+
description = "sles4sap image used to create this module machines."
23+
type = string
1324
}
1425

1526
variable "compute_zones" {
@@ -27,16 +38,6 @@ variable "network_subnet_name" {
2738
type = string
2839
}
2940

30-
variable "drbd_count" {
31-
description = "Count of drbd cluster nodes"
32-
type = string
33-
default = "2"
34-
}
35-
36-
variable "os_image" {
37-
description = "Image used to create the machine"
38-
type = string
39-
}
4041

4142
variable "network_domain" {
4243
description = "hostname's network domain"
@@ -65,11 +66,6 @@ variable "host_ips" {
6566
type = list(string)
6667
}
6768

68-
variable "iscsi_srv_ip" {
69-
description = "IP for iSCSI server"
70-
type = list(string)
71-
}
72-
7369
variable "nfs_mounting_point" {
7470
description = "Mounting point of the NFS share created in to of DRBD (`/mnt` must not be used in Azure)"
7571
type = string
@@ -79,3 +75,9 @@ variable "nfs_export_name" {
7975
description = "Name of the created export in the NFS service. Usually, the `sid` of the SAP instances is used"
8076
type = string
8177
}
78+
79+
variable "iscsi_srv_ip" {
80+
description = "iscsi server address"
81+
type = list(string)
82+
}
83+

terraform/gcp/modules/hana_node/main.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ module "hana-secondary-load-balancer" {
117117
}
118118

119119
resource "google_compute_instance" "clusternodes" {
120-
machine_type = var.machine_type
120+
machine_type = var.vm_size
121121
name = "${var.common_variables["deployment_name"]}-${var.name}${format("%02d", count.index + 1)}"
122122
count = var.hana_count
123123
zone = element(var.compute_zones, count.index)

terraform/gcp/modules/hana_node/variables.tf

+11-10
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,19 @@ variable "name" {
88
}
99

1010
variable "hana_count" {
11-
type = string
12-
default = "2"
11+
description = "Number of HANA machines to deploy"
12+
type = number
13+
default = 2
1314
}
1415

15-
variable "machine_type" {
16-
type = string
17-
default = "n1-highmem-32"
16+
variable "vm_size" {
17+
description = "The instance type of HANA node"
18+
type = string
19+
}
20+
21+
variable "os_image" {
22+
description = "sles4sap image used to create this module machines."
23+
type = string
1824
}
1925

2026
variable "compute_zones" {
@@ -32,11 +38,6 @@ variable "network_subnet_name" {
3238
type = string
3339
}
3440

35-
variable "os_image" {
36-
description = "Image used to create the machine"
37-
type = string
38-
}
39-
4041
variable "network_domain" {
4142
description = "hostname's network domain"
4243
type = string

terraform/gcp/modules/iscsi_server/main.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ resource "google_compute_instance" "iscsisrv" {
1515
count = var.iscsi_count
1616
name = "${var.common_variables["deployment_name"]}-${var.name}${format("%02d", count.index + 1)}"
1717
description = "iSCSI server"
18-
machine_type = var.machine_type
18+
machine_type = var.vm_size
1919
zone = element(var.compute_zones, 0)
2020

2121
can_ip_forward = true

terraform/gcp/modules/iscsi_server/variables.tf

+13-13
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,19 @@ variable "name" {
77
type = string
88
}
99

10-
variable "machine_type" {
11-
type = string
12-
default = "custom-1-2048"
10+
variable "iscsi_count" {
11+
description = "Number of ISCSI machines to deploy"
12+
type = number
13+
}
14+
15+
variable "vm_size" {
16+
description = "The instance type of ISCSI node"
17+
type = string
18+
}
19+
20+
variable "os_image" {
21+
description = "sles4sap image used to create this module machines."
22+
type = string
1323
}
1424

1525
variable "compute_zones" {
@@ -22,21 +32,11 @@ variable "network_subnet_name" {
2232
type = string
2333
}
2434

25-
variable "os_image" {
26-
description = "Image used to create the machine"
27-
type = string
28-
}
29-
3035
variable "network_domain" {
3136
description = "hostname's network domain"
3237
type = string
3338
}
3439

35-
variable "iscsi_count" {
36-
type = number
37-
description = "Number of iscsi machines to deploy"
38-
}
39-
4040
variable "host_ips" {
4141
description = "List of ip addresses to set to the machines"
4242
type = list(string)

terraform/gcp/modules/monitoring/main.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ resource "google_compute_instance" "monitoring" {
1818
count = var.monitoring_enabled == true ? 1 : 0
1919
name = "${var.common_variables["deployment_name"]}-${var.name}"
2020
description = "Monitoring server"
21-
machine_type = "custom-1-2048"
21+
machine_type = var.vm_size
2222
zone = element(var.compute_zones, 0)
2323

2424
can_ip_forward = true

terraform/gcp/modules/monitoring/variables.tf

+11-6
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,22 @@ variable "name" {
77
type = string
88
}
99

10+
variable "vm_size" {
11+
description = "The instance type of MONITOR node"
12+
type = string
13+
}
14+
1015
variable "monitoring_enabled" {
1116
description = "enable the host to be monitored by exporters, e.g node_exporter"
1217
type = bool
1318
default = false
1419
}
1520

21+
variable "os_image" {
22+
description = "sles4sap image used to create this module machines."
23+
type = string
24+
}
25+
1626
variable "compute_zones" {
1727
description = "gcp compute zones data"
1828
type = list(string)
@@ -23,18 +33,13 @@ variable "network_subnet_name" {
2333
type = string
2434
}
2535

26-
variable "os_image" {
27-
description = "Image used to create the machine"
28-
type = string
29-
}
30-
3136
variable "network_domain" {
3237
description = "hostname's network domain"
3338
type = string
3439
}
3540

3641
variable "monitoring_srv_ip" {
37-
description = "Monitoring server address"
42+
description = "monitoring server address"
3843
type = string
3944
default = ""
4045
}

terraform/gcp/modules/netweaver_node/main.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ module "netweaver-load-balancer-ers" {
105105
}
106106

107107
resource "google_compute_instance" "netweaver" {
108-
machine_type = var.machine_type
108+
machine_type = var.vm_size
109109
name = "${var.common_variables["deployment_name"]}-${var.name}${format("%02d", count.index + 1)}"
110110
count = local.vm_count
111111
zone = element(var.compute_zones, count.index)

terraform/gcp/modules/netweaver_node/variables.tf

+18-18
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,24 @@ variable "name" {
77
type = string
88
}
99

10-
variable "machine_type" {
11-
type = string
12-
default = "n1-standard-4"
10+
variable "xscs_server_count" {
11+
description = "Number of xscs nodes"
12+
type = number
13+
default = 2
14+
}
15+
16+
variable "app_server_count" {
17+
type = number
18+
default = 2
19+
}
20+
21+
variable "vm_size" {
22+
type = string
23+
}
24+
25+
variable "os_image" {
26+
description = "sles4sap image used to create this module machines."
27+
type = string
1328
}
1429

1530
variable "compute_zones" {
@@ -27,21 +42,6 @@ variable "network_subnet_name" {
2742
type = string
2843
}
2944

30-
variable "xscs_server_count" {
31-
type = number
32-
default = 2
33-
}
34-
35-
variable "app_server_count" {
36-
type = number
37-
default = 2
38-
}
39-
40-
variable "os_image" {
41-
description = "Image used to create the machine"
42-
type = string
43-
}
44-
4545
variable "network_domain" {
4646
description = "hostname's network domain"
4747
type = string

0 commit comments

Comments
 (0)