SlideShare a Scribd company logo
1 of 41
Download to read offline
Copyright © 2019, eProseed and/or its affiliates. All rights reserved.
BEST PRACTICES WHEN USING
TERRAFORM TO MANAGE ORACLE
CLOUD INFRASTRUCTURE
Simon Haslam
eProseed
Copyright © 2019, eProseed and/or its affiliates. All rights reserved.
ABOUT ME
2
Simon Haslam
• Platform / Infrastructure
Architect
• Focus includes HA, DR,
security, automation
Relevant to this session
• WebLogic / FMW installations
since 2000s
• First research/webcast on JCS
in 2016
• Designed & built SOA CS
integration platform for global
use since Oct 2017
• On team migrating eProseed
Lux data centres to OCI@simon_haslam
since
2009
Copyright © 2019, eProseed and/or its affiliates. All rights reserved.
ABOUT EPROSEED?
3
Oracle ACE
Directors
Copyright © 2019, eProseed and/or its affiliates. All rights reserved.
DISCLAIMER
What is are “best practices” anyway…? ☺
4
Copyright © 2019, eProseed and/or its affiliates. All rights reserved.5
➢ Why automate OCI provisioning?
➢ Real-world Terraform OCI examples
➢ Terraform ‘better practices’
➢ A few more tips ☺
AGENDA
Copyright © 2019, eProseed and/or its affiliates. All rights reserved.6
➢ Why automate OCI provisioning?
➢ Real-world Terraform OCI examples
➢ Terraform ‘better practices’
➢ A few more tips ☺
AGENDA
Copyright © 2019, eProseed and/or its affiliates. All rights reserved.
WHY AUTOMATE OCI PROVISIONING?
7
Copyright © 2019, eProseed and/or its affiliates. All rights reserved.
PAAS PROVISIONING
8
Copyright © 2019, eProseed and/or its affiliates. All rights reserved.
PAAS PROVISIONING
9
Terraform provides an abstraction layer above OCI’s REST APIs
Copyright © 2019, eProseed and/or its affiliates. All rights reserved.
TERRAFORM’S PURPOSE
“Terraform is a tool for building, changing and versioning
infrastructure safely and efficiently”
10
Cloud-agnostic
but not generic
(each cloud has own
providers)
Copyright © 2019, eProseed and/or its affiliates. All rights reserved.
BOUNDARIES
12
resourcesPROVISIONING
This provisions resources
& optionally calls
“provisioner”
e.g.
network
VM instance
PaaS instance
VM images might be
Oracle supplied plain
ones, Oracle-supplied
PaaS ones, or your own
(e.g. from Packer),
Maintains state of infra
Optional
Provisioner
CONFIGURATION
MANAGEMENT
This configures
resources
e.g.
TLS certificates & identity
CM self-registration
Maintains internal state of
resources (instances)
Copyright © 2019, eProseed and/or its affiliates. All rights reserved.
TERRAFORM PROVIDERS
• A provider tells Terraform how to build and manage one or many resource types
• Providers are supplied by Hashicorp, a resource provider (like Oracle), or 3rd
party/community
13
Copyright © 2019, eProseed and/or its affiliates. All rights reserved.
MORE ABOUT TERRAFORM PROVIDERS
• Providers are either:
– Integrated: downloaded by Terraform when needed
– Non-integrated: install from 3rd party or write your own
• 3 Oracle-developed providers available:
14
oci oracle
paas
opc
More about these in a minute..These 3 Oracle providers are all
now integrated into TF
X X
Copyright © 2019, eProseed and/or its affiliates. All rights reserved.15
oci
oracle
paas
opc
almost
legacy
legacy
Copyright © 2019, eProseed and/or its affiliates. All rights reserved.
OCI PROVIDER
Infrastructure & OCI-native PaaS
https://www.terraform.io/docs/providers/oci/index.html
16
Lots of resources
- examples:
Copyright © 2019, eProseed and/or its affiliates. All rights reserved.17
➢ Why automate OCI provisioning?
➢ Real-world Terraform OCI examples
➢ Terraform ‘better practices’
➢ A few more tips ☺
AGENDA
Copyright © 2019, eProseed and/or its affiliates. All rights reserved.
GETTING STARTED
• You need a host to run Terraform from
– could be your PC, a cloud instance, or build server
• Oracle Linux 7 example:
sudo yum install -y terraform
• Create/reuse .tf config files & set up .tfvars for your account/env
• The .tf files need to have one or more providers specified
18
terraform init
terraform plan
terraform apply
…terraform destroy
Copyright © 2019, eProseed and/or its affiliates. All rights reserved.19
DEMO
Copyright © 2019, eProseed and/or its affiliates. All rights reserved.
BIG PICTURE EXAMPLE
20
DRG
Dynamic
Routing
Gateway
On-prem
Another
VCN
Another
cloud
admin
Copyright © 2019, eProseed and/or its affiliates. All rights reserved.21
➢ Why automate OCI provisioning?
➢ Real-world Terraform OCI examples
➢ Terraform ‘better practices’
➢ A few more tips ☺
AGENDA
Copyright © 2019, eProseed and/or its affiliates. All rights reserved.
1. IT’S NEVER TOO EARLY TO START TERRAFORM
• Using the OCI consoles can be time consuming
• Cumulative effect
• You want to experiment as much as possible
• Exception:
Compartment creation: slow, leaves trail don’t
(re)create compartments often
22
Copyright © 2019, eProseed and/or its affiliates. All rights reserved.
2. USE SOURCE CODE CONTROL
• Infrastructure as Code… naturally you want to version it
– You probably can’t go back far but you can see who changed what & when
• Use git
– De-facto SCM these days
• Don’t use branches
– Or if you do, have branches for different environments (e.g. Puppet model)
23
Copyright © 2019, eProseed and/or its affiliates. All rights reserved.
3. STORE YOUR .TFSTATE CENTRALLY
• OCI Object storage (simple), or,
• terraform.io service (more advanced)
24
Copyright © 2019, eProseed and/or its affiliates. All rights reserved.
4. USE TERRAFORM 0.12
• Language updates from 0.11 to 0.12
• There’s an auto upgrade from 0.11 to 0.12 but I found a
couple of things broke
https://www.terraform.io/upgrade-guides/0-12.html
25
Copyright © 2019, eProseed and/or its affiliates. All rights reserved.
5. STRUCTURE MULTIPLE TF CONFIGURATIONS
• You only want one person at a time making changes in same area
• Probably best to have TF by top-level compartment plus one
global
• Depends on organisation structure
26
Copyright © 2019, eProseed and/or its affiliates. All rights reserved.
6. DON’T USE -AUTO-APPROVE
• This is my opinion of a best practice ☺
• -auto-approve means an apply makes changes without prompting
• You get into habit of up-up-return… errors can easily happen
(once, twice,…)
• Exception: use -auto-approve on CI server ☺
27
Copyright © 2019, eProseed and/or its affiliates. All rights reserved.
7. DECIDE WHEN TO USE TF & WHEN NOT
• Terraform:
– Its strength is converged state – use it often but for few changes
– State convergence sophistication is up to the provider developer
• Update OCI Instance hostname - good
• Update OCI Database Service PDB name – not so good
– Use for static deployments – compartments, networks, load balancers etc
• Ansible
– Can manage state but often run in fire & forget mode
– Fire & forget is more aligned to traditional change processes
– You need a tool to customise most PaaS instances anyway
– Use for most types of instances
28
Copyright © 2019, eProseed and/or its affiliates. All rights reserved.
8. UPDATE YOUR OCI PROVIDER REGULARLY
• Terraform Provider for OCI changes in 2 ways:
– New features & bug fixes
– Changes to OCI REST APIs
• You may be forced to update it in a hurry otherwise
29
Copyright © 2019, eProseed and/or its affiliates. All rights reserved.
9. USE A MODERN EDITOR + TF PLUG-IN
Extension available for
Microsoft VS Code editor
30
Copyright © 2019, eProseed and/or its affiliates. All rights reserved.
10. SUBSCRIBE TO TERRAFORM-PROVIDER-OCI ISSUES
31
Copyright © 2019, eProseed and/or its affiliates. All rights reserved.32
Copyright © 2019, eProseed and/or its affiliates. All rights reserved.
TERRAFORM FOR OCI – BETTER PRACTICES
1. Start with Terraform early, really early, on your OCI journey
2. Use Git, but one branch (or one per env for separate TF state)
3. Store your .tfstate centrally (e.g. in OCI object storage bucket)
4. Use Terraform 0.12, especially if starting from scratch
5. Structure multiple TF configurations, probably by compartment
6. Don’t use -auto-approve (except from CI server)
7. Decide when to use TF & when not
8. Update your OCI provider regularly (you may be forced to in a hurry otherwise)
9. Use a modern editor (like VS Code) + TF plug-in
10. Subscribe to terraform-provider-oci issues33
Copyright © 2019, eProseed and/or its affiliates. All rights reserved.34
➢ Why automate OCI provisioning?
➢ Real-world Terraform OCI examples
➢ Terraform ‘better practices’
➢ A few more tips ☺
AGENDA
Copyright © 2019, eProseed and/or its affiliates. All rights reserved.
A FEW MORE TIPS
• Watch your costs! This is cloud after all…
• Environment variables
• TF modules are very handy for scaling number of instances
35
Copyright © 2019, eProseed and/or its affiliates. All rights reserved.
ENVIRONMENT VARIABLES FOR DIFFERENT TENANCIES
36
From OCI provider doc:
https://www.terraform.io/docs/providers/oci/index.html
Copyright © 2019, eProseed and/or its affiliates. All rights reserved.
TERRAFORM MODULES
Our example use case
• Lots of identical compute instances needed for on-prem
provisioning automation
• 3 different types of modules:
– Fusion Middleware
– Database
– Provisioning Server
• All VMs identical for module type – pick how many you
want
• But YMMV - there may be a better way than this for you ☺
37
Copyright © 2019, eProseed and/or its affiliates. All rights reserved.
TERRAFORM FOR OCI – BETTER PRACTICES
1. Start with Terraform early, really early, on your OCI journey
2. Use Git, but one branch (or one per env for separate TF state)
3. Store your .tfstate centrally (e.g. in OCI object storage bucket)
4. Use Terraform 0.12, especially if starting from scratch
5. Structure multiple TF configurations, probably by compartment
6. Don’t use -auto-approve (except from CI server)
7. Decide when to use TF & when not
8. Update your OCI provider regularly (you may be forced to in a hurry otherwise)
9. Use a modern editor (like VS Code) + TF plug-in
10. Subscribe to terraform-provider-oci issues38
Copyright © 2019, eProseed and/or its affiliates. All rights reserved.
ORACLE EXAMPLES
• https://github.com/oracle/terraform-examples
Starting point for some cases – reasonable activity (91 commits)
• https://oracle.rainfocus.com/widget/oracle/oow18/catalogoow18?search=HOL6376
39
Start here!
Probably takes
1-3h
Copyright © 2019, eProseed and/or its affiliates. All rights reserved.
HANDS-ON-LAB TIP
Trial account does not have sufficient compute resources to run the HOL:
=> Raise an SR to get this increased, e.g. to 10 for 2.1 shape (change shape in .tf config):
40Paid for accounts have default limit of 40 per AD for small VMs
https://docs.cloud.oracle.com/iaas/Content/General/Concepts/servicelimits.htm
Copyright © 2019, eProseed and/or its affiliates. All rights reserved.41
@simon_haslam
Q
&
A
Mobile Process /
Integration
Analytics /
Big Data
Database /
Data
Management
Identity &
Access
Management
Oracle Cloud
eProseed Confidential42

More Related Content

What's hot

Deploying Baremetal Instances with OpenStack
Deploying Baremetal Instances with OpenStackDeploying Baremetal Instances with OpenStack
Deploying Baremetal Instances with OpenStack
Etsuji Nakai
 
LinuxCon Japan 13 : 10 years of Xen and Beyond
LinuxCon Japan 13 : 10 years of Xen and BeyondLinuxCon Japan 13 : 10 years of Xen and Beyond
LinuxCon Japan 13 : 10 years of Xen and Beyond
The Linux Foundation
 

What's hot (20)

Oracle ASM 11g - The Evolution
Oracle ASM 11g - The EvolutionOracle ASM 11g - The Evolution
Oracle ASM 11g - The Evolution
 
Accelerate with ibm storage ibm spectrum virtualize hyper swap deep dive dee...
Accelerate with ibm storage  ibm spectrum virtualize hyper swap deep dive dee...Accelerate with ibm storage  ibm spectrum virtualize hyper swap deep dive dee...
Accelerate with ibm storage ibm spectrum virtualize hyper swap deep dive dee...
 
Se training storage grid webscale technical overview
Se training   storage grid webscale technical overviewSe training   storage grid webscale technical overview
Se training storage grid webscale technical overview
 
High Availability Options for IBM i
High Availability Options for IBM iHigh Availability Options for IBM i
High Availability Options for IBM i
 
Emc vipr srm workshop
Emc vipr srm workshopEmc vipr srm workshop
Emc vipr srm workshop
 
Highly Available And Distributed Containers - ContainerCon NA 2016
Highly Available And Distributed Containers - ContainerCon NA 2016Highly Available And Distributed Containers - ContainerCon NA 2016
Highly Available And Distributed Containers - ContainerCon NA 2016
 
Time finder
Time finderTime finder
Time finder
 
AAI-1304 Technical Deep-Dive into IBM WebSphere Liberty
AAI-1304 Technical Deep-Dive into IBM WebSphere LibertyAAI-1304 Technical Deep-Dive into IBM WebSphere Liberty
AAI-1304 Technical Deep-Dive into IBM WebSphere Liberty
 
AAI-3218 Production Deployment Best Practices for WebSphere Liberty Profile
AAI-3218 Production Deployment Best Practices for WebSphere Liberty ProfileAAI-3218 Production Deployment Best Practices for WebSphere Liberty Profile
AAI-3218 Production Deployment Best Practices for WebSphere Liberty Profile
 
Deploying Baremetal Instances with OpenStack
Deploying Baremetal Instances with OpenStackDeploying Baremetal Instances with OpenStack
Deploying Baremetal Instances with OpenStack
 
Emc data domain technical deep dive workshop
Emc data domain  technical deep dive workshopEmc data domain  technical deep dive workshop
Emc data domain technical deep dive workshop
 
Scaling Xen within Rackspace Cloud Servers
Scaling Xen within Rackspace Cloud ServersScaling Xen within Rackspace Cloud Servers
Scaling Xen within Rackspace Cloud Servers
 
Liberty management
Liberty managementLiberty management
Liberty management
 
LinuxCon Japan 13 : 10 years of Xen and Beyond
LinuxCon Japan 13 : 10 years of Xen and BeyondLinuxCon Japan 13 : 10 years of Xen and Beyond
LinuxCon Japan 13 : 10 years of Xen and Beyond
 
Cisco cloud computing deploying openstack
Cisco cloud computing deploying openstackCisco cloud computing deploying openstack
Cisco cloud computing deploying openstack
 
WebSphere Application Server Liberty Profile and Docker
WebSphere Application Server Liberty Profile and DockerWebSphere Application Server Liberty Profile and Docker
WebSphere Application Server Liberty Profile and Docker
 
EMC VNX
EMC VNXEMC VNX
EMC VNX
 
Linux container & docker
Linux container & dockerLinux container & docker
Linux container & docker
 
Emc vplex deep dive
Emc vplex deep diveEmc vplex deep dive
Emc vplex deep dive
 
EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications
EMC World 2016 - Deep Dive with Mesos and Persistent Storage for ApplicationsEMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications
EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications
 

Similar to Better Practices when Using Terraform to Manage Oracle Cloud Infrastructure

OpenStack + Cloud Foundry for the OpenStack Boston Meetup
OpenStack + Cloud Foundry for the OpenStack Boston MeetupOpenStack + Cloud Foundry for the OpenStack Boston Meetup
OpenStack + Cloud Foundry for the OpenStack Boston Meetup
ragss
 

Similar to Better Practices when Using Terraform to Manage Oracle Cloud Infrastructure (20)

Provisioning with Oracle Cloud Stack Manager
Provisioning with Oracle Cloud Stack ManagerProvisioning with Oracle Cloud Stack Manager
Provisioning with Oracle Cloud Stack Manager
 
Platform Provisioning Automation for Oracle Cloud
Platform Provisioning Automation for Oracle CloudPlatform Provisioning Automation for Oracle Cloud
Platform Provisioning Automation for Oracle Cloud
 
Platform Engineering for the Modern Oracle World
Platform Engineering for the Modern Oracle WorldPlatform Engineering for the Modern Oracle World
Platform Engineering for the Modern Oracle World
 
EMC World 2016 - code.14 Deep Dive with Mesos and Persistent Storage for Appl...
EMC World 2016 - code.14 Deep Dive with Mesos and Persistent Storage for Appl...EMC World 2016 - code.14 Deep Dive with Mesos and Persistent Storage for Appl...
EMC World 2016 - code.14 Deep Dive with Mesos and Persistent Storage for Appl...
 
EMC World 2016 - cnaITL.05 Unstructured and Structured PaaS Demystified
EMC World 2016 - cnaITL.05 Unstructured and Structured PaaS DemystifiedEMC World 2016 - cnaITL.05 Unstructured and Structured PaaS Demystified
EMC World 2016 - cnaITL.05 Unstructured and Structured PaaS Demystified
 
Tips & Tricks for Oracle PaaS Admins
Tips & Tricks for Oracle PaaS AdminsTips & Tricks for Oracle PaaS Admins
Tips & Tricks for Oracle PaaS Admins
 
OpenStack + Cloud Foundry for the OpenStack Boston Meetup
OpenStack + Cloud Foundry for the OpenStack Boston MeetupOpenStack + Cloud Foundry for the OpenStack Boston Meetup
OpenStack + Cloud Foundry for the OpenStack Boston Meetup
 
3 Ways to Connect to the Oracle Cloud
3 Ways to Connect to the Oracle Cloud3 Ways to Connect to the Oracle Cloud
3 Ways to Connect to the Oracle Cloud
 
Microservices with Terraform, Docker and the Cloud. DevOps Wet 2018
Microservices with Terraform, Docker and the Cloud. DevOps Wet 2018Microservices with Terraform, Docker and the Cloud. DevOps Wet 2018
Microservices with Terraform, Docker and the Cloud. DevOps Wet 2018
 
Everything You Wanted to Know About JIT Compilation but Were Afraid to Ask [J...
Everything You Wanted to Know About JIT Compilation but Were Afraid to Ask [J...Everything You Wanted to Know About JIT Compilation but Were Afraid to Ask [J...
Everything You Wanted to Know About JIT Compilation but Were Afraid to Ask [J...
 
Tips & Tricks for Oracle PaaS Admins
Tips & Tricks for Oracle PaaS AdminsTips & Tricks for Oracle PaaS Admins
Tips & Tricks for Oracle PaaS Admins
 
EMC Atmos for service providers
EMC Atmos for service providersEMC Atmos for service providers
EMC Atmos for service providers
 
Randstad Docker meetup - Serverless
Randstad Docker meetup - ServerlessRandstad Docker meetup - Serverless
Randstad Docker meetup - Serverless
 
Migrate Oracle WebLogic Applications onto a Containerized Cloud Data Center
Migrate Oracle WebLogic Applications onto a Containerized Cloud Data CenterMigrate Oracle WebLogic Applications onto a Containerized Cloud Data Center
Migrate Oracle WebLogic Applications onto a Containerized Cloud Data Center
 
Cloud Native Applications - DevOps, EMC and Cloud Foundry
Cloud Native Applications - DevOps, EMC and Cloud FoundryCloud Native Applications - DevOps, EMC and Cloud Foundry
Cloud Native Applications - DevOps, EMC and Cloud Foundry
 
Considerations for Operating an OpenStack Cloud
Considerations for Operating an OpenStack CloudConsiderations for Operating an OpenStack Cloud
Considerations for Operating an OpenStack Cloud
 
Gartner pace and bi-modal models
Gartner pace and bi-modal modelsGartner pace and bi-modal models
Gartner pace and bi-modal models
 
Java and Serverless - A Match Made In Heaven, Part 1
Java and Serverless - A Match Made In Heaven, Part 1Java and Serverless - A Match Made In Heaven, Part 1
Java and Serverless - A Match Made In Heaven, Part 1
 
Em13c features- HotSos 2016
Em13c features- HotSos 2016Em13c features- HotSos 2016
Em13c features- HotSos 2016
 
EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms ...
EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms ...EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms ...
EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms ...
 

More from Simon Haslam

Java & SOA Cloud Service for Fusion Middleware Administrators
Java & SOA Cloud Service for Fusion Middleware AdministratorsJava & SOA Cloud Service for Fusion Middleware Administrators
Java & SOA Cloud Service for Fusion Middleware Administrators
Simon Haslam
 

More from Simon Haslam (20)

What You Need to Know about Oracle Cloud Connectivity
What You Need to Know about Oracle Cloud ConnectivityWhat You Need to Know about Oracle Cloud Connectivity
What You Need to Know about Oracle Cloud Connectivity
 
Delivering Mobile Apps to the Field with Oracle
Delivering Mobile Apps to the Field with OracleDelivering Mobile Apps to the Field with Oracle
Delivering Mobile Apps to the Field with Oracle
 
Provisioning with Oracle Cloud Stack Manager
Provisioning with Oracle Cloud Stack ManagerProvisioning with Oracle Cloud Stack Manager
Provisioning with Oracle Cloud Stack Manager
 
Oracle SOA Cloud - Skanska Customer Journey
Oracle SOA Cloud - Skanska Customer JourneyOracle SOA Cloud - Skanska Customer Journey
Oracle SOA Cloud - Skanska Customer Journey
 
Delivering Mobile Apps to the Field with Oracle JET
Delivering Mobile Apps to the Field with Oracle JETDelivering Mobile Apps to the Field with Oracle JET
Delivering Mobile Apps to the Field with Oracle JET
 
JET Hybrid Mobile Apps - taster for Oracle CodeOne
JET Hybrid Mobile Apps - taster for Oracle CodeOneJET Hybrid Mobile Apps - taster for Oracle CodeOne
JET Hybrid Mobile Apps - taster for Oracle CodeOne
 
Delivering Mobile Apps to the field using Oracle
Delivering Mobile Apps to the field using OracleDelivering Mobile Apps to the field using Oracle
Delivering Mobile Apps to the field using Oracle
 
Connecting Oracle Cloud to your Data Centre (Part A)
Connecting Oracle Cloud to your Data Centre (Part A)Connecting Oracle Cloud to your Data Centre (Part A)
Connecting Oracle Cloud to your Data Centre (Part A)
 
Running SOA in the Cloud: SOA CS for SOA Suite Customers
Running SOA in the Cloud: SOA CS for SOA Suite CustomersRunning SOA in the Cloud: SOA CS for SOA Suite Customers
Running SOA in the Cloud: SOA CS for SOA Suite Customers
 
Tips & Tricks for Java & SOA Cloud Service
Tips & Tricks for Java & SOA Cloud ServiceTips & Tricks for Java & SOA Cloud Service
Tips & Tricks for Java & SOA Cloud Service
 
SOA & WebLogic - Lift & Shift to the Cloud
SOA & WebLogic - Lift & Shift to the CloudSOA & WebLogic - Lift & Shift to the Cloud
SOA & WebLogic - Lift & Shift to the Cloud
 
Driving DevOps for Oracle with the orawls Puppet Modules
Driving DevOps for Oracle with the orawls Puppet ModulesDriving DevOps for Oracle with the orawls Puppet Modules
Driving DevOps for Oracle with the orawls Puppet Modules
 
Experiences of SOACS
Experiences of SOACSExperiences of SOACS
Experiences of SOACS
 
SSL Everywhere!
SSL Everywhere!SSL Everywhere!
SSL Everywhere!
 
Oracle Traffic Director - a vital part of your Oracle infrastructure
Oracle Traffic Director - a vital part of your Oracle infrastructureOracle Traffic Director - a vital part of your Oracle infrastructure
Oracle Traffic Director - a vital part of your Oracle infrastructure
 
Java & SOA Cloud Service for Fusion Middleware Administrators
Java & SOA Cloud Service for Fusion Middleware AdministratorsJava & SOA Cloud Service for Fusion Middleware Administrators
Java & SOA Cloud Service for Fusion Middleware Administrators
 
Ten Real-World Customer Configurations on Oracle Database Appliance
Ten Real-World Customer Configurations on Oracle Database Appliance Ten Real-World Customer Configurations on Oracle Database Appliance
Ten Real-World Customer Configurations on Oracle Database Appliance
 
What should I do now?! JCS for WebLogic Admins
What should I do now?! JCS for WebLogic AdminsWhat should I do now?! JCS for WebLogic Admins
What should I do now?! JCS for WebLogic Admins
 
Living with the Oracle Database Appliance
Living with the Oracle Database ApplianceLiving with the Oracle Database Appliance
Living with the Oracle Database Appliance
 
Enterprise Deployments: The Real World of Best Practices
Enterprise Deployments: The Real World of Best PracticesEnterprise Deployments: The Real World of Best Practices
Enterprise Deployments: The Real World of Best Practices
 

Recently uploaded

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Recently uploaded (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 

Better Practices when Using Terraform to Manage Oracle Cloud Infrastructure

  • 1. Copyright © 2019, eProseed and/or its affiliates. All rights reserved. BEST PRACTICES WHEN USING TERRAFORM TO MANAGE ORACLE CLOUD INFRASTRUCTURE Simon Haslam eProseed
  • 2. Copyright © 2019, eProseed and/or its affiliates. All rights reserved. ABOUT ME 2 Simon Haslam • Platform / Infrastructure Architect • Focus includes HA, DR, security, automation Relevant to this session • WebLogic / FMW installations since 2000s • First research/webcast on JCS in 2016 • Designed & built SOA CS integration platform for global use since Oct 2017 • On team migrating eProseed Lux data centres to OCI@simon_haslam since 2009
  • 3. Copyright © 2019, eProseed and/or its affiliates. All rights reserved. ABOUT EPROSEED? 3 Oracle ACE Directors
  • 4. Copyright © 2019, eProseed and/or its affiliates. All rights reserved. DISCLAIMER What is are “best practices” anyway…? ☺ 4
  • 5. Copyright © 2019, eProseed and/or its affiliates. All rights reserved.5 ➢ Why automate OCI provisioning? ➢ Real-world Terraform OCI examples ➢ Terraform ‘better practices’ ➢ A few more tips ☺ AGENDA
  • 6. Copyright © 2019, eProseed and/or its affiliates. All rights reserved.6 ➢ Why automate OCI provisioning? ➢ Real-world Terraform OCI examples ➢ Terraform ‘better practices’ ➢ A few more tips ☺ AGENDA
  • 7. Copyright © 2019, eProseed and/or its affiliates. All rights reserved. WHY AUTOMATE OCI PROVISIONING? 7
  • 8. Copyright © 2019, eProseed and/or its affiliates. All rights reserved. PAAS PROVISIONING 8
  • 9. Copyright © 2019, eProseed and/or its affiliates. All rights reserved. PAAS PROVISIONING 9 Terraform provides an abstraction layer above OCI’s REST APIs
  • 10. Copyright © 2019, eProseed and/or its affiliates. All rights reserved. TERRAFORM’S PURPOSE “Terraform is a tool for building, changing and versioning infrastructure safely and efficiently” 10 Cloud-agnostic but not generic (each cloud has own providers)
  • 11. Copyright © 2019, eProseed and/or its affiliates. All rights reserved. BOUNDARIES 12 resourcesPROVISIONING This provisions resources & optionally calls “provisioner” e.g. network VM instance PaaS instance VM images might be Oracle supplied plain ones, Oracle-supplied PaaS ones, or your own (e.g. from Packer), Maintains state of infra Optional Provisioner CONFIGURATION MANAGEMENT This configures resources e.g. TLS certificates & identity CM self-registration Maintains internal state of resources (instances)
  • 12. Copyright © 2019, eProseed and/or its affiliates. All rights reserved. TERRAFORM PROVIDERS • A provider tells Terraform how to build and manage one or many resource types • Providers are supplied by Hashicorp, a resource provider (like Oracle), or 3rd party/community 13
  • 13. Copyright © 2019, eProseed and/or its affiliates. All rights reserved. MORE ABOUT TERRAFORM PROVIDERS • Providers are either: – Integrated: downloaded by Terraform when needed – Non-integrated: install from 3rd party or write your own • 3 Oracle-developed providers available: 14 oci oracle paas opc More about these in a minute..These 3 Oracle providers are all now integrated into TF X X
  • 14. Copyright © 2019, eProseed and/or its affiliates. All rights reserved.15 oci oracle paas opc almost legacy legacy
  • 15. Copyright © 2019, eProseed and/or its affiliates. All rights reserved. OCI PROVIDER Infrastructure & OCI-native PaaS https://www.terraform.io/docs/providers/oci/index.html 16 Lots of resources - examples:
  • 16. Copyright © 2019, eProseed and/or its affiliates. All rights reserved.17 ➢ Why automate OCI provisioning? ➢ Real-world Terraform OCI examples ➢ Terraform ‘better practices’ ➢ A few more tips ☺ AGENDA
  • 17. Copyright © 2019, eProseed and/or its affiliates. All rights reserved. GETTING STARTED • You need a host to run Terraform from – could be your PC, a cloud instance, or build server • Oracle Linux 7 example: sudo yum install -y terraform • Create/reuse .tf config files & set up .tfvars for your account/env • The .tf files need to have one or more providers specified 18 terraform init terraform plan terraform apply …terraform destroy
  • 18. Copyright © 2019, eProseed and/or its affiliates. All rights reserved.19 DEMO
  • 19. Copyright © 2019, eProseed and/or its affiliates. All rights reserved. BIG PICTURE EXAMPLE 20 DRG Dynamic Routing Gateway On-prem Another VCN Another cloud admin
  • 20. Copyright © 2019, eProseed and/or its affiliates. All rights reserved.21 ➢ Why automate OCI provisioning? ➢ Real-world Terraform OCI examples ➢ Terraform ‘better practices’ ➢ A few more tips ☺ AGENDA
  • 21. Copyright © 2019, eProseed and/or its affiliates. All rights reserved. 1. IT’S NEVER TOO EARLY TO START TERRAFORM • Using the OCI consoles can be time consuming • Cumulative effect • You want to experiment as much as possible • Exception: Compartment creation: slow, leaves trail don’t (re)create compartments often 22
  • 22. Copyright © 2019, eProseed and/or its affiliates. All rights reserved. 2. USE SOURCE CODE CONTROL • Infrastructure as Code… naturally you want to version it – You probably can’t go back far but you can see who changed what & when • Use git – De-facto SCM these days • Don’t use branches – Or if you do, have branches for different environments (e.g. Puppet model) 23
  • 23. Copyright © 2019, eProseed and/or its affiliates. All rights reserved. 3. STORE YOUR .TFSTATE CENTRALLY • OCI Object storage (simple), or, • terraform.io service (more advanced) 24
  • 24. Copyright © 2019, eProseed and/or its affiliates. All rights reserved. 4. USE TERRAFORM 0.12 • Language updates from 0.11 to 0.12 • There’s an auto upgrade from 0.11 to 0.12 but I found a couple of things broke https://www.terraform.io/upgrade-guides/0-12.html 25
  • 25. Copyright © 2019, eProseed and/or its affiliates. All rights reserved. 5. STRUCTURE MULTIPLE TF CONFIGURATIONS • You only want one person at a time making changes in same area • Probably best to have TF by top-level compartment plus one global • Depends on organisation structure 26
  • 26. Copyright © 2019, eProseed and/or its affiliates. All rights reserved. 6. DON’T USE -AUTO-APPROVE • This is my opinion of a best practice ☺ • -auto-approve means an apply makes changes without prompting • You get into habit of up-up-return… errors can easily happen (once, twice,…) • Exception: use -auto-approve on CI server ☺ 27
  • 27. Copyright © 2019, eProseed and/or its affiliates. All rights reserved. 7. DECIDE WHEN TO USE TF & WHEN NOT • Terraform: – Its strength is converged state – use it often but for few changes – State convergence sophistication is up to the provider developer • Update OCI Instance hostname - good • Update OCI Database Service PDB name – not so good – Use for static deployments – compartments, networks, load balancers etc • Ansible – Can manage state but often run in fire & forget mode – Fire & forget is more aligned to traditional change processes – You need a tool to customise most PaaS instances anyway – Use for most types of instances 28
  • 28. Copyright © 2019, eProseed and/or its affiliates. All rights reserved. 8. UPDATE YOUR OCI PROVIDER REGULARLY • Terraform Provider for OCI changes in 2 ways: – New features & bug fixes – Changes to OCI REST APIs • You may be forced to update it in a hurry otherwise 29
  • 29. Copyright © 2019, eProseed and/or its affiliates. All rights reserved. 9. USE A MODERN EDITOR + TF PLUG-IN Extension available for Microsoft VS Code editor 30
  • 30. Copyright © 2019, eProseed and/or its affiliates. All rights reserved. 10. SUBSCRIBE TO TERRAFORM-PROVIDER-OCI ISSUES 31
  • 31. Copyright © 2019, eProseed and/or its affiliates. All rights reserved.32
  • 32. Copyright © 2019, eProseed and/or its affiliates. All rights reserved. TERRAFORM FOR OCI – BETTER PRACTICES 1. Start with Terraform early, really early, on your OCI journey 2. Use Git, but one branch (or one per env for separate TF state) 3. Store your .tfstate centrally (e.g. in OCI object storage bucket) 4. Use Terraform 0.12, especially if starting from scratch 5. Structure multiple TF configurations, probably by compartment 6. Don’t use -auto-approve (except from CI server) 7. Decide when to use TF & when not 8. Update your OCI provider regularly (you may be forced to in a hurry otherwise) 9. Use a modern editor (like VS Code) + TF plug-in 10. Subscribe to terraform-provider-oci issues33
  • 33. Copyright © 2019, eProseed and/or its affiliates. All rights reserved.34 ➢ Why automate OCI provisioning? ➢ Real-world Terraform OCI examples ➢ Terraform ‘better practices’ ➢ A few more tips ☺ AGENDA
  • 34. Copyright © 2019, eProseed and/or its affiliates. All rights reserved. A FEW MORE TIPS • Watch your costs! This is cloud after all… • Environment variables • TF modules are very handy for scaling number of instances 35
  • 35. Copyright © 2019, eProseed and/or its affiliates. All rights reserved. ENVIRONMENT VARIABLES FOR DIFFERENT TENANCIES 36 From OCI provider doc: https://www.terraform.io/docs/providers/oci/index.html
  • 36. Copyright © 2019, eProseed and/or its affiliates. All rights reserved. TERRAFORM MODULES Our example use case • Lots of identical compute instances needed for on-prem provisioning automation • 3 different types of modules: – Fusion Middleware – Database – Provisioning Server • All VMs identical for module type – pick how many you want • But YMMV - there may be a better way than this for you ☺ 37
  • 37. Copyright © 2019, eProseed and/or its affiliates. All rights reserved. TERRAFORM FOR OCI – BETTER PRACTICES 1. Start with Terraform early, really early, on your OCI journey 2. Use Git, but one branch (or one per env for separate TF state) 3. Store your .tfstate centrally (e.g. in OCI object storage bucket) 4. Use Terraform 0.12, especially if starting from scratch 5. Structure multiple TF configurations, probably by compartment 6. Don’t use -auto-approve (except from CI server) 7. Decide when to use TF & when not 8. Update your OCI provider regularly (you may be forced to in a hurry otherwise) 9. Use a modern editor (like VS Code) + TF plug-in 10. Subscribe to terraform-provider-oci issues38
  • 38. Copyright © 2019, eProseed and/or its affiliates. All rights reserved. ORACLE EXAMPLES • https://github.com/oracle/terraform-examples Starting point for some cases – reasonable activity (91 commits) • https://oracle.rainfocus.com/widget/oracle/oow18/catalogoow18?search=HOL6376 39 Start here! Probably takes 1-3h
  • 39. Copyright © 2019, eProseed and/or its affiliates. All rights reserved. HANDS-ON-LAB TIP Trial account does not have sufficient compute resources to run the HOL: => Raise an SR to get this increased, e.g. to 10 for 2.1 shape (change shape in .tf config): 40Paid for accounts have default limit of 40 per AD for small VMs https://docs.cloud.oracle.com/iaas/Content/General/Concepts/servicelimits.htm
  • 40. Copyright © 2019, eProseed and/or its affiliates. All rights reserved.41 @simon_haslam Q & A
  • 41. Mobile Process / Integration Analytics / Big Data Database / Data Management Identity & Access Management Oracle Cloud eProseed Confidential42