Deploy virtual machines of SAP Application Server on VMware on OVHcloud solution with Terraform
Objective
This guide provides instructions for using the SAP Application Servers Terraform module developed by OVHcloud to deploy a set of virtual machines of SAP Application Servers (as Central Services, Application Servers, SAProuters and others) on VMware on OVHcloud solution.
Requirements
- Access to the OVHcloud Control Panel.
- VMware on OVHcloud solution deployed.
- Terraform binary (version >= 1.4).
Instructions
Terraform user creation
To be able to manage resources (create, modify, destroy) on your VMware on OVHcloud solution, we advise you to create a dedicated user with limited rights. The following rights are mandatory to use this Terraform module:
| Right | Role |
|---|---|
| vSphere access | Read/Write |
| Access to the VM Network | Operator |
| Access to the V(X)LANs | Operator |
Terraform binary
This module has been written to be compatible with Terraform v1.4 or higher. To discover how to install Terraform, please refer to the official documentation available on Hashicorp.
Usage of the Terraform module
Several examples are available in the GitHub repository to deploy a set of virtual machines of SAP Application Servers.
Three main files are required to use as expected this Terraform module:
- main.tf
- outputs.tf
- versions.tf
main.tf
This file contains the code to call the SAP Application Servers Terraform module developed by OVHcloud.
- The block "provider" is needed to be able to interact with your VMware on OVHcloud solution.
- The block "module" regroups all variables that you want to pass to the SAP Application Servers Terraform module developed by OVHcloud.
To know all inputs that you can pass to this module, please refer to the README on GitHub.
You have also the possibility to create variables to avoid hard-coding it in your main.tf file. To do this, you must replace each value by a value with the syntax var.<name_of_the_variable> and create a file named variables.tf which contains the definition of each variable. Caution, the variable type must be the same as that of the variables in the SAP Application Servers Terraform module developed by OVHcloud.
For example, you cannot set the type "string" for the variable sap_application_servers, because in the SAP Application Servers Terraform module developed by OVHcloud this variable is a "list".
In this case, the main.tf file could be like:
The variables.tf file should be similar to this:
Last, in order to avoid having to provide each value through your console, you have the possibility to create a file named terraform.tfvars in which you put all values needed by each variable.
outputs.tf
This file display information after running terraform apply, as your virtual machine IDs, anti-affinity rule(s) information or affinity group(s) information.
To discover all outputs available in this module, please refer to the outputs.tf file on GitHub.
versions.tf
This file allows fixing the version of binaries used during the execution of the code. This file must match the versions.tf file presents in the GitHub repository of this module for the release wanted.
Execution
Once your repository with these three files (minimum) is ready, you can run these following commands:
The output of the execution should be similar to this:
If the execution ran without issue, you have created your first virtual machine of SAP Application Server on your VMware on OVHcloud solution with Terraform.
We suggest that you look the examples folder and README to discover all possibilities.
At any moment, you have the possibility to change the configuration of the virtual machine (more vCPU, more memory or add a new disk, for example) and relaunch the Terraform execution.
Deletion
If you want to destroy this virtual machine, run the following command:
The output of the execution should be similar to this:
Go further
If you need training or technical assistance to implement our solutions, contact your sales representative or click on this link to get a quote and ask our Professional Services experts for assisting you on your specific use case of your project.
Join our community of users on https://community.ovh.com/en/.