This template follows the documented steps https://cloud.google.com/solutions/sap/docs/certifications-sap-hana and deploys GCP and Pacemaker resources up to the installation of SAP's central services.
Install Terraform on the machine you would like to use to deploy from by following https://learn.hashicorp.com/tutorials/terraform/install-cli?in=terraform/gcp-get-started#install-terraform
-
Download .tf file into an empty directory
curl https://storage.googleapis.com/cloudsapdeploy/terraform/latest/terraform/sap_hana_ha/terraform/sap_hana_ha.tf -o sap_hana_ha.tf
-
Fill in mandatory variables and if the desired optional variable in the .tf file.
-
Deploy
- Run
terraform init
(only needed once) - Run
terraform plan
to see what is going to be deployed. Verify if names, zones, sizes, etc. are as desired. - Run
terrafom apply
to deploy the resources - Run
terrafom destroy
to remove the resources
- Run
-
Continue installation of SAP software and setup of remaining cluster resources as per documentation at https://cloud.google.com/solutions/sap/docs/sap-hana-ha-tf-deployment
For additional information see https://www.terraform.io/docs/index.html and https://cloud.google.com/docs/terraform
Name | Description | Type | Default | Required |
---|---|---|---|---|
backup_disk_iops_override | Warning, do not use unless instructed or aware of the implications of using this setting. Directly sets the number of IOPS that the backup disk(s) will use. Has no effect if not using a disk type that supports it. | number |
null |
no |
backup_disk_throughput_override | Warning, do not use unless instructed or aware of the implications of using this setting. Directly sets the throughput in MB/s that the backup disk(s) will use. Has no effect if not using a disk type that supports it. | number |
null |
no |
backup_disk_type | Optional - The default is pd-ssd, except for machines that do not support PD, in which case the default is hyperdisk-extreme. Only used if a backup disk is needed. | string |
"" |
no |
can_ip_forward | Whether sending and receiving of packets with non-matching source or destination IPs is allowed. | bool |
true |
no |
custom_mm_metadata | Optional - default is empty. Custom metadata to be added to the majority maker VM. | map(string) |
{} |
no |
custom_primary_metadata | Optional - default is empty. Custom metadata to be added to the primary VM. | map(string) |
{} |
no |
custom_secondary_metadata | Optional - default is empty. Custom metadata to be added to the secondary VMs. | map(string) |
{} |
no |
data_disk_iops_override | Warning, do not use unless instructed or aware of the implications of using this setting. Directly sets the number of IOPS that the data disk(s) will use. Has no effect if not using a disk type that supports it. | number |
null |
no |
data_disk_size_override | Warning, do not use unless instructed or aware of the implications of using this setting. Overrides the default size for the data disk(s), that is based off of the machine_type. | number |
null |
no |
data_disk_throughput_override | Warning, do not use unless instructed or aware of the implications of using this setting. Directly sets the throughput in MB/s that the data disk(s) will use. Has no effect if not using a disk type that supports it. | number |
null |
no |
data_disk_type_override | Warning, do not use unless instructed or aware of the implications of using this setting. Override the 'default_disk_type' for the data disk. | string |
"" |
no |
data_stripe_size | Optional - default is 256k. Stripe size for data volume striping (if enable_data_striping = true). | string |
"256k" |
no |
disk_type | Optional - The default disk type to use for disk(s) containing log and data volumes. The default is pd-ssd, except for machines that do not support PD, in which case the default is hyperdisk-extreme. Not all disk are supported on all machine types - see https://cloud.google.com/compute/docs/disks/ for details. | string |
"" |
no |
enable_data_striping | Optional - default is false. Enable LVM striping of data volume across multiple disks. | bool |
false |
no |
enable_fast_restart | Optional - The default is true. If set enables HANA Fast Restart. | bool |
true |
no |
enable_log_striping | Optional - default is false. Enable LVM striping of log volume across multiple disks. | bool |
false |
no |
hyperdisk_balanced_iops_default | Optional - default is 3000. Number of IOPS that is set for each disk of type Hyperdisk-balanced (except for boot/usrsap/shared disks). | number |
3000 |
no |
hyperdisk_balanced_throughput_default | Optional - default is 750. Throughput in MB/s that is set for each disk of type Hyperdisk-balanced (except for boot/usrsap/shared disks). | number |
750 |
no |
include_backup_disk | Optional - The default is true. If set creates a disk for backups. | bool |
true |
no |
is_work_load_management_deployment | If set the necessary tags and labels will be added to resoucres to support WLM. | bool |
false |
no |
linux_image | Linux image name to use. | string |
n/a | yes |
linux_image_project | The project which the Linux image belongs to. | string |
n/a | yes |
loadbalancer_name | OPTIONAL - Name of the load balancer that will be created. If left blank with use_ilb_vip set to true, then will use lb-SID as default | string |
"" |
no |
log_disk_iops_override | Warning, do not use unless instructed or aware of the implications of using this setting. Directly sets the number of IOPS that the log disk(s) will use. Has no effect if not using a disk type that supports it. | number |
null |
no |
log_disk_size_override | Warning, do not use unless instructed or aware of the implications of using this setting. Overrides the default size for the log disk(s), that is based off of the machine_type. | number |
null |
no |
log_disk_throughput_override | Warning, do not use unless instructed or aware of the implications of using this setting. Directly sets the throughput in MB/s that the log disk(s) will use. Has no effect if not using a disk type that supports it. | number |
null |
no |
log_disk_type_override | Warning, do not use unless instructed or aware of the implications of using this setting. Override the 'default_disk_type' for the log disk. | string |
"" |
no |
log_stripe_size | Optional - default is 64k. Stripe size for log volume striping (if enable_log_striping = true). | string |
"64k" |
no |
machine_type | Machine type for the instances. | string |
n/a | yes |
majority_maker_instance_name | Optional - Name to use for the Majority Maker instance. Must be provided if scaleout_nodes > 0. | string |
"" |
no |
majority_maker_machine_type | Optional - The machine type to use for the Majority Maker instance. Must be provided if scaleout_nodes > 0. | string |
"" |
no |
majority_maker_startup_url | DO NOT USE | string |
`"curl -s https://storage.googleapis.com/cloudsapdeploy/terraform/latest/terraform/sap_hana_ha/hana_ha_startup_majority_maker.sh | bash -s https://storage.googleapis.com/cloudsapdeploy/terraform/latest/terraform"` |
majority_maker_zone | Optional - The zone in which the Majority Maker instance will be deployed. Must be provided if scaleout_nodes > 0. It is recommended for this to be different from the zones the primary and secondary instance are deployed in. | string |
"" |
no |
network | Network in which the ILB resides including resources like firewall rules. | string |
n/a | yes |
network_tags | OPTIONAL - Network tags can be associated to your instance on deployment. This can be used for firewalling or routing purposes. | list(string) |
[] |
no |
nic_type | Optional - This value determines the type of NIC to use, valid options are GVNIC and VIRTIO_NET. If choosing GVNIC make sure that it is supported by your OS choice here https://cloud.google.com/compute/docs/images/os-details#networking. | string |
"" |
no |
number_data_disks | Optional - default is 2. Number of disks to use for data volume striping (if enable_data_striping = true). | number |
2 |
no |
number_log_disks | Optional - default is 2. Number of disks to use for log volume striping (if enable_log_striping = true). | number |
2 |
no |
post_deployment_script | OPTIONAL - gs:// or https:// location of a script to execute on the created VM's post deployment. | string |
"" |
no |
primary_instance_group_name | OPTIONAL - Unmanaged instance group to be created for the primary node. If blank, will use ig-VM_NAME | string |
"" |
no |
primary_instance_name | Hostname of the primary GCE instance. | string |
n/a | yes |
primary_reservation_name | Use a reservation specified by RESERVATION_NAME. By default ANY_RESERVATION is used when this variable is empty. In order for a reservation to be used it must be created with the "Select specific reservation" selected (specificReservationRequired set to true) Be sure to create your reservation with the correct Min CPU Platform for the following instance types: n1-highmem-32 : Intel Broadwell n1-highmem-64 : Intel Broadwell n1-highmem-96 : Intel Skylake n1-megamem-96 : Intel Skylake m1-megamem-96 : Intel Skylake All other instance types can have automatic Min CPU Platform" |
string |
"" |
no |
primary_startup_url | Startup script to be executed when the VM boots, should not be overridden. | string |
`"curl -s https://storage.googleapis.com/cloudsapdeploy/terraform/latest/terraform/sap_hana_ha/hana_ha_startup.sh | bash -s https://storage.googleapis.com/cloudsapdeploy/terraform/latest/terraform"` |
primary_static_ip | Optional - Defines an internal static IP for the primary VM. | string |
"" |
no |
primary_worker_static_ips | Optional - Defines internal static IP addresses for the primary worker nodes. | list(string) |
[] |
no |
primary_zone | Zone where the primary instances will be created. | string |
n/a | yes |
project_id | Project id where the instances will be created. | string |
n/a | yes |
public_ip | OPTIONAL - Defines whether a public IP address should be added to your VM. By default this is set to Yes. Note that if you set this to No without appropriate network nat and tags in place, there will be no route to the internet and thus the installation will fail. | bool |
true |
no |
sap_deployment_debug | OPTIONAL - If this value is set to true, the deployment will generates verbose deployment logs. Only turn this setting on if a Google support engineer asks you to enable debugging. | bool |
false |
no |
sap_hana_backup_size | Size in GB of the /hanabackup volume. If this is not set or set to zero, the GCE instance will be provisioned with a hana backup volume of 2 times the total memory. | number |
0 |
no |
sap_hana_deployment_bucket | The Cloud Storage path that contains the SAP HANA media, do not include gs://. If this is not defined, the GCE instance will be provisioned without SAP HANA installed. | string |
"" |
no |
sap_hana_instance_number | The SAP instance number. If this is not defined, the GCE instance will be provisioned without SAP HANA installed. | number |
0 |
no |
sap_hana_sapsys_gid | The Linux GID of the SAPSYS group. By default this is set to 79 | number |
79 |
no |
sap_hana_scaleout_nodes | Optional - Specify to add scaleout nodes to both HA instances. | number |
0 |
no |
sap_hana_sid | The SAP HANA SID. If this is not defined, the GCE instance will be provisioned without SAP HANA installed. SID must adhere to SAP standard (Three letters or numbers and start with a letter) | string |
"" |
no |
sap_hana_sidadm_password | The linux sidadm login password. If this is not defined, the GCE instance will be provisioned without SAP HANA installed. Minimum requirement is 8 characters. | string |
"" |
no |
sap_hana_sidadm_password_secret | The secret key used to retrieve the linux sidadm login from Secret Manager (https://cloud.google.com/secret-manager). The Secret Manager password will overwrite the clear text password from sap_hana_sidadm_password if both are set. | string |
"" |
no |
sap_hana_sidadm_uid | The Linux UID of the adm user. By default this is set to 900 to avoid conflicting with other OS users. | number |
900 |
no |
sap_hana_system_password | The SAP HANA SYSTEM password. If this is not defined, the GCE instance will be provisioned without SAP HANA installed. Minimum requirement is 8 characters with at least 1 number. | string |
"" |
no |
sap_hana_system_password_secret | The secret key used to retrieve the SAP HANA SYSTEM login from Secret Manager (https://cloud.google.com/secret-manager). The Secret Manager password will overwrite the clear text password from sap_hana_system_password if both are set. | string |
"" |
no |
sap_vip | OPTIONAL - The virtual IP address of the alias/route pointing towards the active SAP HANA instance. For a route based solution this IP must sit outside of any defined networks. | string |
"" |
no |
secondary_instance_group_name | OPTIONAL - Unmanaged instance group to be created for the secondary node. If blank, will use ig-VM_NAME | string |
"" |
no |
secondary_instance_name | Hostname of the secondary GCE instance. | string |
n/a | yes |
secondary_reservation_name | Use a reservation specified by RESERVATION_NAME. By default ANY_RESERVATION is used when this variable is empty. In order for a reservation to be used it must be created with the "Select specific reservation" selected (specificReservationRequired set to true) Be sure to create your reservation with the correct Min CPU Platform for the following instance types: n1-highmem-32 : Intel Broadwell n1-highmem-64 : Intel Broadwell n1-highmem-96 : Intel Skylake n1-megamem-96 : Intel Skylake m1-megamem-96 : Intel Skylake All other instance types can have automatic Min CPU Platform" |
string |
"" |
no |
secondary_startup_url | DO NOT USE | string |
`"curl -s https://storage.googleapis.com/cloudsapdeploy/terraform/latest/terraform/sap_hana_ha/hana_ha_startup_secondary.sh | bash -s https://storage.googleapis.com/cloudsapdeploy/terraform/latest/terraform"` |
secondary_static_ip | Optional - Defines an internal static IP for the secondary VM. | string |
"" |
no |
secondary_worker_static_ips | Optional - Defines internal static IP addresses for the secondary worker nodes. | list(string) |
[] |
no |
secondary_zone | Zone where the secondary instances will be created. | string |
n/a | yes |
service_account | OPTIONAL - Ability to define a custom service account instead of using the default project service account. | string |
"" |
no |
shared_disk_iops_override | Warning, do not use unless instructed or aware of the implications of using this setting. Directly sets the number of IOPS that the shared disk will use. Has no effect if not using a disk type that supports it. | number |
null |
no |
shared_disk_size_override | Warning, do not use unless instructed or aware of the implications of using this setting. Overrides the default size for the shared disk, that is based off of the machine_type. | number |
null |
no |
shared_disk_throughput_override | Warning, do not use unless instructed or aware of the implications of using this setting. Directly sets the throughput in MB/s that the shared disk will use. Has no effect if not using a disk type that supports it. | number |
null |
no |
shared_disk_type_override | Warning, do not use unless instructed or aware of the implications of using this setting. Override the 'default_disk_type' for the shared disk. | string |
"" |
no |
sole_tenant_deployment | Optional - default is false. Deploy on Sole Tenant Nodes. | bool |
false |
no |
sole_tenant_name_prefix | Optional - name of the prefix to use for the Sole Tenant objects (Node Templates, Node Groups). If left blank with sole_tenant_deployment=true, st-<sap_hana_sid> will be used. | string |
"" |
no |
sole_tenant_node_type | Optional - default is null. Sole Tenant Node Type to use. See https://cloud.google.com/compute/docs/nodes/sole-tenant-nodes#node_types | string |
null |
no |
subnetwork | The sub network to deploy the instance in. | string |
n/a | yes |
unified_disk_iops_override | Warning, do not use unless instructed or aware of the implications of using this setting. Directly sets the number of IOPS that the primary's unified disk will use. Has no effect if not using a disk type that supports it. | number |
null |
no |
unified_disk_size_override | Warning, do not use unless instructed or aware of the implications of using this setting. Overrides the default size for the primary disk(s), that is based off of the machine_type. | number |
null |
no |
unified_disk_throughput_override | Warning, do not use unless instructed or aware of the implications of using this setting. Directly sets the throughput in MB/s that the primary's unified disk will use. Has no effect if not using a disk type that supports it. | number |
null |
no |
use_single_shared_data_log_disk | Optional - By default three separate disk for data, logs, and shared will be made. If set to true, one disk will be used instead. | bool |
false |
no |
usrsap_disk_iops_override | Warning, do not use unless instructed or aware of the implications of using this setting. Directly sets the number of IOPS that the /usr/sap disk(s) will use. Has no effect if not using a disk type that supports it. | number |
null |
no |
usrsap_disk_size_override | Warning, do not use unless instructed or aware of the implications of using this setting. Overrides the default size for the /usr/sap disk(s), that is based off of the machine_type. | number |
null |
no |
usrsap_disk_throughput_override | Warning, do not use unless instructed or aware of the implications of using this setting. Directly sets the throughput in MB/s that the /usr/sap disk(s) will use. Has no effect if not using a disk type that supports it. | number |
null |
no |
usrsap_disk_type_override | Warning, do not use unless instructed or aware of the implications of using this setting. Override the 'default_disk_type' for the /usr/sap disk. | string |
"" |
no |
wlm_deployment_name | Deployment name to be used for integrating into Work Load Management. | string |
"" |
no |
worker_startup_url | Startup script to be executed when the worker VM boots, should not be overridden. | string |
`"curl -s https://storage.googleapis.com/cloudsapdeploy/terraform/latest/terraform/sap_hana_ha/hana_ha_startup_worker.sh | bash -s https://storage.googleapis.com/cloudsapdeploy/terraform/latest/terraform"` |
Name | Description |
---|---|
sap_hana_ha_firewall_link | Link to the optional fire wall |
sap_hana_ha_loadbalander_link | Link to the optional load balancer |
sap_hana_ha_primary_instance_self_link | Self-link for the primary SAP HANA HA instance created. |
sap_hana_ha_primary_worker_self_links | Self-link for the worker nodes in the primary SAP HANA HA instance. |
sap_hana_ha_secondary_instance_self_link | Self-link for the secondary SAP HANA HA instance created. |
sap_hana_ha_secondary_worker_self_links | Self-link for the worker nodes in the secondary SAP HANA HA instance. |
These sections describe requirements for using this module.
The following dependencies must be available:
- Terraform v0.13
- Terraform Provider for GCP plugin v4.0
Refer to the contribution guidelines for information on contributing to this module.
Please see our security disclosure process.