Git Product home page Git Product logo

oci-ebs's Introduction

Terraform modules for Oracle E-Business Suite on Oracle Cloud Infrastructure

Deploy to Oracle Cloud

The Terraform modules for Oracle E-Business Suite allow you to provision infrastructure for Oracle E-Business Suite on Oracle Cloud Infrastructure using OCI Resource Manager and Terraform. Oracle E-Business suite can be deployed on Oracle Cloud Infrastructure in single availability domain or multi availability domain architecture.The modules can be used to create infrastructure for Oracle E-Business Suite in single Availability Domain as well as multiple Availability Domains.

Architecture for Deploying Oracle E-Business Suite in a Single Availability domain

Architecture for Deploying Oracle E-Business Suite in a Single Availability domain

Architecture for Deploying Oracle E-Business Suite in multiple Availability domains

Architecture for Deploying Oracle E-Business Suite in Multiple Availability domains

For more information on Oracle E-Business Suite deployment architecture on Oracle Cloud Infrastructure, see

How to use this module

Using OCI Resource Manager

  1. Click Deploy to Oracle Cloud

    If you aren't already signed in, when prompted, enter the tenancy and user credentials.

  2. Review and accept the terms and conditions.

  3. Select the region where you want to deploy the stack.

  4. Follow the on-screen prompts and instructions to create the stack.

  5. After creating the stack, click Terraform Actions, and select Plan.

  6. Wait for the job to be completed, and review the plan.

    To make any changes, return to the Stack Details page, click Edit Stack, and make the required changes. Then, run the Plan action again.

  7. If no further changes are necessary, return to the Stack Details page, click Terraform Actions, and select Apply.

Using Terraform CLI

First off you'll need to do some pre deploy setup. That's all detailed here. A terraform version of 0.13.x is required.

1.Clone the repo

$ git clone https://github.com/oracle-quickstart/oci-ebs.git
$ cd oci-ebs

2.Update env-vars with the required information. The file contains definitions of environment variables for your Oracle Cloud Infrastructure tenancy.

3.Rename terraform.tfvars.template to terraform.tfvars.Update terraform.tfvars with the inputs for the architecture that you want to build. A running sample terraform.tfvars file for multiple availability domain architecture is available below. The contents of sample file can be copied to create a running terraform.tfvars input file. Update db_admin_password with actual password in terraform.tfvars file.

4.Initialize Terraform. This will also download the latest terraform oci provider.

$ terraform init

5.Set environment variables by running source env-vars.

$ source env-vars

6.Run terraform plan.

$ terraform plan

7.Run terraform apply to create the infrastructure.

$ terraform apply

When you’re prompted to confirm the action, enter yes.

When all components have been created, Terraform displays a completion message. For example: Apply complete! Resources: 47 added, 0 changed, 0 destroyed.

8.f you want to delete the infrastructure, run:

$ terraform destroy

When you’re prompted to confirm the action, enter yes.

Oracle E-Business Suite Terraform modules structure

Terraform modules for Oracle E-Business Suite has the following structure:

.
├── datasources.tf
├── _docs
│   ├── multiple_availability_domain_ha_topology.png
│   └── single_availability_domain_ha_topology.png
├── env-vars
├── LICENSE.txt
├── main.tf
├── modules
│   ├── bastion
│   │   ├── bastion.outputs.tf
│   │   ├── bastion.tf
│   │   └── bastion.vars.tf
│   ├── compute
│   │   ├── compute.blockvolume.tf
│   │   ├── compute.data.tf
│   │   ├── compute.outputs.tf
│   │   ├── compute.rsync-remote-exec.tf
│   │   ├── compute.tf
│   │   ├── compute.variables.tf
│   │   ├── fss.tf
│   │   └── userdata
│   │       ├── bootstrap.tpl
│   │       └── rsync.sh
│   ├── dbsystem
│   │   ├── db.datasources.tf
│   │   ├── db.dbsystem.tf
│   │   └── db.variables.tf
│   ├── loadbalancer
│   │   ├── lb.tf
│   │   └── lb.variables.tf
│   └── network
│       ├── subnets
│       │   ├── subnets.outputs.tf
│       │   ├── subnets.tf
│       │   └── subnets.variables.tf
│       └── vcn
│           ├── vcn.data.tf
│           ├── vcn.outputs.tf
│           ├── vcn.tf
│           └── vcn.vars.tf
├── outputs.tf
├── pack.sh
├── provider.tf
├── README.md
├── schema.yaml
├── terraform.tfvars.template
└── variables.tf

10 directories, 37 files

  • [root]:

    • [env-vars]: This is an environment file to set terraform environment variables on UNIX systems.
    • [datasources.tf]: This is terraform data source file to fetch data for Oracle Cloud Infrastructure resources.
    • [main.tf]: At root level, main.tf calls different modules to create Oracle Cloud Infrastructure resources.
    • [outputs.tf]: This is the terraform outputs file.
    • [provider.tf]: This is the terraform provider file that defines the provider (Oracle Cloud Infrastructure) and authentication information.
    • [variables.tf]: This is the terraform variables file to declare variables.
    • [terraform.tfvars.template]: This is a sample input file to pass values to declared variables.
  • [modules]: The modules directory contain all the modules required for creating Oracle Cloud Infrastructure resources.

    • [bastion]: This module is used to create bastion hosts.
    • [compute]: This module is used to create unix and windows compute instances.
    • [dbsystem]: This module is used to create Oracle Cloud Infrastructure database system.
    • [loadbalancer]: This module is used to create Oracle Cloud Infrastructure load Balancing service.
    • [network]: This module is used to create network resources like VCN (Virtual Cloud Network),subnets, internet gateway, service gateway, dynamic routing gateway and NAT (network Address Translation) gateway.
      • [vcn]: This sub module creates the VCN, internet gateway, service gateway, dynamic routing gateway and NAT gateway.
      • [subnets]: This sub module creates the subnets within a VCN.
  • [pack.sh]: Create zip package for Resource Manager Stack.

Inputs required in the terraform.tfvars file

The following inputs are required for terraform modules:

Argument Description
AD Availability Domain for Oracle E-Business Suite Deployment. This variable drives the Oracle E-Business Suite architecture to be deployed. Setting AD = ["1"] deploys infrastructure in single availability domain (Availabilty domain 1 of the tenancy) and AD = ["1","2"] deploys infrastructure in multiple ADs (Availability domains 1 and 2 of the tenancy).
vcn_cidr CIDR block of the VCN (Virtual Cloud Network) to be created.
vcn_dns_label DNS Label of the VCN (Virtual Cloud Network) to be created.
linux_os_version Operating system version of Oracle Linux for compute instances. The terraform module for compute instances always pick up the latest image available for the chosen Oracle Linux version in the region.
timezone Timezone of compute instances and database systems.
freeform_tags Freeform tag for resource.
ebs_env_prefix Environment prefix to define names of Oracle Cloud infrastructure resources.
ebs_app_instance_count Number of Oracle E-Business suite application instances to be created. For single availability domain architecture, the application instances will be provisioned in round robin fashion across multiple fault domains. For multiple availability domain architecture, application instances will be provisioned in round robin fashion across fault domains and availability domains
ebs_app_instance_shape Shape of application instance. For more information on available shapes, see VM Shapes
ebs_app_boot_volume_size_in_gb Size of boot volume in gb for application compute instance.
ebs_app_block_volume_size_in_gb Size of block volume in gb for application compute instance.
ebs_app_block_volume_vpus_per_gb Block volume VPUs per GB.
ebs_app_block_volume_mount_path Mount path for Oracle E-Business Suite application non shared filesystem. For example /u02.
ebs_app_instance_listen_port Port on which Oracle E-Business Suite application instance will listen and receive requests from Oracle Cloud Infrastructure Load Balancing Service.
ebs_shared_filesystem_mount_path Mount path for Oracle E-Business Suite application shared filesystem. For example /u01/install/APPS.
ebs_shared_filesystem_size_limit_in_gb Soft upper limit for Oracle E-Business Suite application filesystem. This value is defined just to set an upper soft size limit visible to Oracle E-Business Installation tools. It does not restrict storage size of File Storage Service.
ebs_database_required Whether to create database. The value can be “true” or “false”
db_edition Edition of database.
db_license_model Licensing model for database.
db_version Version of database.
db_node_count Number of database nodes. For single instance database, this parameter should be 1 and for Real Application Cluster Database, this parameter should be set to 2.
db_instance_shape Shape of Database nodes. For RAC, the minimum required shape is VMStandard2.1.
db_name Name of Database Container.
db_size_in_gb Size of database in gb. For more information, see Oracle Cloud Infrastructure Images
db_admin_password Database administration password (sys password).
db_characterset Characterset of database.
db_nls_characterset National Characterset of database.
db_pdb_name Starter Pluggable database name.
load_balancer_private Whether public or private load balancer.
load_balancer_hostname Hostname of the load balancer.
load_balancer_shape Shape of the load balancer.
load_balancer_listen_port Listen port of the load balancer.
Sample terraform.tfvars file to create Oracle E-Business Suite infrastructure in multiple availability domain architecture
# AD (Availability Domain to use for creating EBS infrastructure) 
# For single AD regions (ap-seoul-1, ap-tokyo-1, ca-toronto-1), use AD = ["1"] 
AD = ["1","2"]

# CIDR block of VCN to be created
vcn_cidr = "172.16.0.0/16"

# DNS label of VCN to be created
vcn_dns_label = "ebsvcn"

# Operating system version to be used for application instances. e.g  6.10 or 7.6
linux_os_version = "7.8"

# Timezone of compute instance
timezone = "America/New_York"

# Environment prefix to define name of resources
ebs_env_prefix = "prd"

# Freeform tags
freeform_tags = { environment = "prod", costcenter = "10240" }

# Number of application instances to be created
ebs_app_instance_count = "2"

# Shape of app instance
ebs_app_instance_shape = "VM.Standard2.1"

# Boot volume size 
ebs_app_boot_volume_size_in_gb = "100"

# Block volume size
ebs_app_block_volume_size_in_gb = "100"

# Block volume performance 
ebs_app_block_volume_vpus_per_gb = "0"

# Mount path for local application filesystem
ebs_app_block_volume_mount_path = "/u02"

# Listen port of the application instance
ebs_app_instance_listen_port = "8000"

# Mount path for shared application filesystem
ebs_shared_filesystem_mount_path = "/u01/install/APPS"

# Shared application filesystem size limit
ebs_shared_filesystem_size_limit_in_gb = "500"

# Whether database is required to be created
ebs_database_required = true

# Datbase Edition
db_edition = "ENTERPRISE_EDITION_EXTREME_PERFORMANCE"

# Licensing model for database
db_license_model = "LICENSE_INCLUDED"

# Database version
db_version = "12.1.0.2"

# Number of database nodes
db_node_count = "2"

# Shape of Database nodes
db_instance_shape = "VM.Standard2.2"

# Database name
db_name = "EBSCDB"

# Size of Database
db_size_in_gb = "256"

# Database administration (sys) password
db_admin_password = "<password>"

# Characterset of database
db_characterset = "AL32UTF8"

# National Characterset of database
db_nls_characterset = "AL16UTF16"

# Pluggable database name
db_pdb_name = "DUMMYPDB"

# Whether private Load Balancer
load_balancer_private = true

# Hostname of Load Balancer
load_balancer_hostname = "ebs.example.com"

# Shape of Load Balancer
load_balancer_shape = "100Mbps"

# Listen port of load balancer
load_balancer_listen_port = "80"

If you want to deploy Oracle E-Business Suite on Oracle Cloud Infrastructure in single availability domain architecture, set AD variable to one of the availability domain i.e. 1, 2 or 3.

AD = ["1"]

Information about Oracle Cloud Infrastructure resources built by Terraform modules for Oracle E-Business Suite

  • The terraform modules creates vcn with regional subnets for each tier. The subnet for bastion host is a public subnet, the subnet for database and application tier is a private subnet. The subnet for load balancer tier is either private or public depending on whether "load_balancer_private" input variable is True or False. When set to True, the subnet for Load balancer is private and when set to False, the subnet for Load balancer is public.

  • It is recommended to use shared filesystem for Oracle E-Business Suite multi tier configuration. The Terraform modules create File Storage service filesystem for single as well as multiple availability domain architecture. For a single availability domain architecture, a single filesystem is created. For multiple availability domain architecture, two such file systems are created, one in each availabilty domain. In addition to shared FSS filesystem, the terraform code also creates a block volume on each application compute node for any non shared application files.

  • The shared FSS filesystems can be synchronized by an rsync script in cron. The rsync snchronization script is placed in cron of root user and is commented by default. The script can be enabled to synchornize fileystems after implemenation of Oracle E-Business Suite.

    # Credits to [email protected]
    # crontab -l
    */30 * * * * /usr/bin/flock -n /var/run/fss-sync-up-file-system.lck rsync -aHAXxv --numeric-ids --delete /u01/install/APPS/ /u01/install/APPSDR/
    
    # cat /etc/cron.d/fss-sync-up-file-system
    */30 * * * * /usr/bin/flock -n /var/run/fss-sync-up-file-system.lck rsync -aHAXxv --numeric-ids --delete /u01/install/APPS /u01/install/APPSDR
    
  • The Terraform modules provide option to create private as well as public load balancer using "load_balancer_private" input parameter. When set to True, a private load balancer is created and when set to False, a public load balancer is created.The backend set of each load balancer has application servers added to it.

  • Separate pairs of SSH keys can be used for bastion host and rest of the compute infrastructure resources. It is also possible to use the same key. In that case, same key is required as input to instance and bastion instance variables in env-vars.

    For example,

    ### Public key used on the instance
    export TF_VAR_ssh_public_key=/home/oracle/tf/<mykey.pub>
    
    ### Public key used on the bastion instance
    export TF_VAR_bastion_ssh_public_key=/home/oracle/tf/<mykey.pub>
    

    For terraform installations on Unix systems, the private half of SSH key pairs should be in OpenSSH format. The instances in private subnet can be reached via SSH on port 22 by allowing agent forwarding in Putty and using Putty authentication tool like Pageant. Note that this does not require copying private SSH key for instances to bastion host.

  • The terraform modules ensure that application instances are deployed across different Fault Domains (in round-robin fashion) within an availability domain. Fault Domains protect against unexpected hardware failures and against planned outages due to compute hardware maintenance. For Real application clusters database also, each node of cluster is deployed in a separate Fault domain.

  • The terraform modules expose timezone variable which can be used to set timezone of provisioned compute instances and database systems.

  • The Terraform modules always use latest Oracle Linux image for the chosen operating system for provisioning compute instances. There are chances that minor version of operating system gets upgraded and a new image gets published in Oracle Cloud Infrastructure console. In that case, always check the available version of image from oracle Cloud Infrastructure compute console to input this value. For example, if Oracle Linux version is changed from version 7.5 to 7.6, change the value of input variable "linux_os_version" from 7.5 to 7.6.

  • For multi availability domain architecture, the standby database is built using OCI native dataguard association. The standby database is built in second availability configured in input parameter "AD"

  • The terraform version has been locked to >=0.12 and Oracle Cloud Infrastructure provider version has been locked to 3.93.0 in provider.tf file. To use a version higher than these versions, change the values in the provider.tf file. The terraform modules may require changes for a successful run with a new terraform and Oracle Cloud Infrastructure provider version.

Cloud-init template for application servers

Following is the cloud-init template used to install Oracle E-Business Suite prerequisite RPMs and mount shared file systems on application servers:

#cloud-config
timezone: "${timezone}"

packages:
  - rsync
  - nfs-utils
  - ntp
  - oracle-ebs-server-R12-preinstall
  - fss-parallel-tools.x86_64

runcmd:
  - sudo mkdir -p ${src_mount_path}
  - sudo mount ${src_mount_target_private_ip}:${src_export_path} ${src_mount_path}
  - sudo chown oracle:oinstall ${src_mount_path}
  - echo ${src_mount_target_private_ip}:${src_export_path} ${src_mount_path} nfs tcp,vers=3 >> /etc/fstab
  # Run firewall command to enable to open ports
  - firewall-offline-cmd --port=${app_instance_listen_port}:tcp
  - firewall-offline-cmd --port=7001:tcp
  - firewall-offline-cmd --port=7002:tcp
  - firewall-offline-cmd --port=7201:tcp
  - firewall-offline-cmd --port=7202:tcp
  - firewall-offline-cmd --port=7401:tcp
  - firewall-offline-cmd --port=7402:tcp
  - firewall-offline-cmd --port=7601:tcp
  - firewall-offline-cmd --port=7602:tcp
  - /bin/systemctl restart firewalld

Unix bash commands to configure rsync on application servers

These are the unix commands run to enable rsync across Oracle E-Business Suite application servers.

#Copyright © 2020, Oracle and/or its affiliates.

#The Universal Permissive License (UPL), Version 1.0


#/bin/bash
sudo mkdir -p ${dst_mount_path}
sudo mount ${dst_mount_target_private_ip}:${dst_export_path} ${dst_mount_path}
sudo chown oracle:oinstall ${dst_mount_path}
sudo crontab /etc/cron.d/fss-sync-up-file-system
echo '${dst_mount_target_private_ip}:${dst_export_path} ${dst_mount_path} nfs tcp,vers=3' | sudo tee -a /etc/fstab
echo '#${fss_sync_frequency} /usr/bin/flock -n /var/run/fss-sync-up-file-system.lck rsync -aHAXxv --numeric-ids --delete ${src_mount_path} ${dst_mount_path}' | sudo tee -a /etc/cron.d/fss-sync-up-file-system
touch /tmp/rsync.done

oci-ebs's People

Contributors

benofben avatar rishimahajan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

oci-ebs's Issues

Terriform Configuration does not Deploy

Initializing modules...
- app_subnet in modules/network/subnets
- bastion_subnet in modules/network/subnets
- create_app in modules/compute
- create_bastion in modules/bastion
- create_db in modules/dbsystem
- create_lb in modules/loadbalancer
- create_vcn in modules/network/vcn
- db_subnet in modules/network/subnets
- lb_subnet in modules/network/subnets
Initializing provider plugins...
- Finding latest version of hashicorp/tls...
- Finding latest version of hashicorp/template...
- Finding latest version of hashicorp/null...
- Finding latest version of hashicorp/random...
- Finding hashicorp/oci versions matching "3.93.0"...
- Installing hashicorp/tls v2.0.1...
- Installed hashicorp/tls v2.0.1 (unauthenticated)
- Installing hashicorp/template v2.1.2...
- Installed hashicorp/template v2.1.2 (unauthenticated)
- Installing hashicorp/null v2.1.2...
- Installed hashicorp/null v2.1.2 (unauthenticated)
- Installing hashicorp/random v2.3.0...
- Installed hashicorp/random v2.3.0 (unauthenticated)
- Installing hashicorp/oci v3.93.0...
- Installed hashicorp/oci v3.93.0 (unauthenticated)
The following providers do not have any version constraints in configuration,
so the latest version was installed.
To prevent automatic upgrades to new major versions that may contain breaking
changes, we recommend adding version constraints in a required_providers block
in your configuration, with the constraint strings suggested below.
*hashicorp/null: version = "~> 2.1.2"
*hashicorp/random: version = "~> 2.3.0"
*hashicorp/template: version = "~> 2.1.2"
*hashicorp/tls: version = "~> 2.0.1"
Terraform has been successfully initialized!
You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.
If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
2021/12/31 20:18:02 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
  Use TF_LOG=TRACE to see Terraform's internal logs.
  ----
data.oci_identity_availability_domains.ADs: Refreshing state...
module.create_vcn.data.oci_core_services.svcgtw_services: Refreshing state...
data.oci_core_images.InstanceImageOCID: Refreshing state...
data.oci_core_services.svcgtw_services: Refreshing state...
data.template_file.deployment_ad[0]: Refreshing state...
data.oci_identity_fault_domains.fds[0]: Refreshing state...
data.template_file.deployment_fd[2]: Refreshing state...
data.template_file.deployment_fd[1]: Refreshing state...
data.template_file.deployment_fd[0]: Refreshing state...
Error: Invalid index
  on main.tf line 99, in module "create_bastion" 
  99:   bastion_image           = data.oci_core_images.InstanceImageOCID.images[0].id
    |----------------
    | data.oci_core_images.InstanceImageOCID.images is empty list of object
The given key does not identify an element in this collection value.
Error: Invalid index
  on main.tf line 115, in module "create_app" 
 115:   compute_image                    = data.oci_core_images.InstanceImageOCID.images[0].id
    |----------------
    | data.oci_core_images.InstanceImageOCID.images is empty list of object
The given key does not identify an element in this collection value.
 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.