Practical guide to Oracle Virtual environments

Nelson Calero DOAG – November 2018 Today’s topics • Virtual environments review – – Oracle VirtualBox – Oracle VM – Oracle Cloud • Automation – Motivation – Explore alternatives to create – Terraform database environments • Examples – VirtualBox VMs using Vagrant/Ansible – Docker on Windows Intended audience – RAC using VirtualBox and Docker DBAs and Developers – Terraform for Oracle Cloud instances

2 © 2018 Pythian About me

• Database Consultant at Pythian since 2014 • Working with Oracle tools and environments since 1996 • DBA Oracle (2001) & MySQL (2005) • Co-founder and President of the Oracle user Group of Uruguay (2009) • LAOUC Director of events (2013)

• Computer Engineer (1998) • Oracle ACE (2014), Oracle ACE Director (2017) • Oracle Certified Professional 10g/11g/12c, OCE, Cloud DB & Infra • Amazon Solutions Architect – Associate (2016) • Cloud Architect (2017), Google Cloud Data Engineer (2017) • Oracle University Instructor (2011) • Blogger and speaker: Oracle Open World, Collaborate, OTN Tour, Regional conferences http://www.linkedin.com/in/ncalero @ncalerouy

3 © 2018 Pythian

500+ Technical Experts Helping Peers Globally

3 Membership Tiers Connect: • Oracle ACE Director [email protected] • Oracle ACE bit.ly/OracleACEProgram • Oracle ACE Associate Facebook.com/oracleaces @oracleace

Nominate yourself or someone you know: acenomination.oracle.com Introduction to Virtual environments Sharing server resources isolating processes

KVM, Oracle VM, VirtualBox, … LXC, WPAR, Docker, …

7 https://docs.docker.com/get-started/ Introduction to Virtual environments • (Server ) – Type 1: run directly in host’s hardware • , Oracle VM, Hyper-V, Vmware ESX, KVM, … – Type 2: run on a OS (host) • VMware Workstation, VirtualBox, QEMU, …

• Containers (OS virtualization) – Share OS kernel and libraries – Solaris Zones (2004), LXC (2008), Docker (2013) – MOS 2216342.1 Oracle Support for Database Running on Docker  Supported SI on 7 with UEK4 (and later) or RHEL7

8 © 2018 Pythian Not only server virtualization • Data virtualization – Delphix, … • Storage snapshots (vendor based) – SMO, NetAPP, Oracle ACFS, .. – gDBClone – clone Oracle databases using ACFS snapshots http://www.oracle.com/technetwork/indexes/samplecode/gdbclone-download-2295388.html

• Cloud provisioning – Compute instances – managed – Bare Metal – bring your own hypervisor (only on OCI, not classic) – Containers – as managed services or DIY in BM

9 © 2018 Pythian Today’s focus: VMs and containers

10 © 2018 Pythian Containers with Docker

• Creates process with access to same OS binaries and resources from the host, executing programs in isolation as if they were inside a VM

• Runs on any OS - Download latest binary from https://www.docker.com - On Windows it creates a VirtualBox VM to execute containers inside it  VM needs CPU, disk and RAM adjustments to be useful • Commands: - docker-machine: manage machines running Docker (Windows/Mac before v1.12) - docker o build: Build an image from a Dockerfile o run: Run a command in a new container o exec: Run a command in a running container

11 © 2018 Pythian Docker – command line Windows – control VM status D:\>docker-machine ls NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS default - Running tcp://192.168.99.100:2376 v18.01.0-ce

Commands: D:\>docker attach Attach local standard input, output, and error streams to a running contain build Build an image from a Dockerfile Management Commands: commit Create a new image from a container's changes checkpoint Manage checkpoints cp Copy files/folders between a container and the local filesystem config Manage Docker configs create Create a new container container Manage containers deploy Deploy a new stack or update an existing stack diff Inspect changes to files or directories on a container's filesystem image Manage images events Get real time events from the server network Manage networks exec Run a command in a running container node Manage Swarm nodes export Export a container's filesystem as a tar archive plugin Manage plugins history Show the history of an image images List images secret Manage Docker secrets import Import the contents from a tarball to create a filesystem image service Manage services info Display system-wide information stack Manage Docker stacks inspect Return low-level information on Docker objects swarm Manage Swarm kill Kill one or more running containers load Load an image from a tar archive or STDIN system Manage Docker login Log in to a Docker registry volume Manage volumes logout Log out from a Docker registry logs Fetch the logs of a container pause Pause all processes within one or more containers port List port mappings or a specific mapping for the container 12 ps List containers ... Docker – configuration

Dockerfile – instructions to execute when a container starts FROM oraclelinux:7-Slim # Pull base image … USER Oracle RUN $INSTALL_DIR/$INSTALL_DB_BINARIES_FILE EE … CMD exec $ORACLE_BASE/$RUN_FILE

Base image usually are OS images, not including Oracle binaries (license restriction) Exception: Oracle provided images: - Docker Store: https://store.docker.com/images/oracle-database-enterprise-edition - Oracle Container Registry: https://container-registry.oracle.com

Useful repositories: – https://github.com/oracle/docker-images/OracleDatabase - RAC and Single instance – https://github.com/Seth-Miller/12c-rac-docker - pioneer RAC configuration

13 © 2018 Pythian Docker – creating a container Install github repository D:\GitHub>git clone https://github.com/oracle/docker-images.git Cloning into 'docker-images'... remote: Counting objects: 7740, done. remote: Compressing objects: 100% (36/36), done. rRemote: Total 7740 (delta 18), reused 45 (delta 16), pack-reused 7688 Receiving objects: 100% (7740/7740), 9.70 MiB | 870.00 KiB/s, done. Resolving deltas: 100% (4286/4286), done. Checking connectivity... done. Checking out files: 100% (968/968), done.

Download Oracle installation files from OTN: • http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html • Copy to directory D:\GitHub\docker-images\OracleDatabase\dockerfiles\12.1.0.2 Create the container (11.2.0.2 XE, 12.1.0.2 / 12.2.0.1 / 18.3.0 EE or SE2 as of November 2018):

D:\GitHub\12.1.0.2/…>docker build -t oracle/database:12.1.0.2-ee -f Dockerfile.ee .

14 © 2018 Pythian Docker – creating a container Status D:\>docker image ls REPOSITORY TAG IMAGE ID CREATED SIZE oracle/database 12.1.0.2-ee c175ddb41772 4 minutes ago 10.6GB oraclelinux 7-slim 9870bebfb1d5 2 months ago 118MB

Start the container (Windows example):

D:\>docker run --name ora121 -p 1521:1521 -p 5500:5500 -e ORACLE_SID=orcl -e ORACLE_PDB=pdb1 -e ORACLE_PWD=Oracle_123 -e ORACLE_CHARACTERSET=AL32UTF8 -v ///users/calero/.docker/persistentdisk/ora121://opt/oracle/oradata oracle/database:12.1.0.2-ee

Status of running containers D:\>docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 2c1afcad6a50 oracle/database:12.1.0.2-ee "/bin/sh -c 'exec $O…" 11 hours ago Up 11 hours (healthy) 0.0.0.0:1521->1521/tcp, 0.0.0.0:5500->5500/tcp ora121

15 © 2018 Pythian Docker – connecting to Oracle Connect to database running in container – using host Oracle client D:\>docker-machine ip 192.168.99.100

C:\Users\calero>sqlplus system/Oracle_123@\"192.168.99.100:1521/orcl\"

SQL*Plus: Release 12.1.0.2.0 Production on Sun Feb 4 01:51:50 2018 ... Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

Using sqlplus binary from container D:\>docker exec -ti 2c1afcad6a50 sqlplus pdbadmin/Oracle_123@pdb1

SQL*Plus: Release 12.1.0.2.0 Production on Sun Feb 4 16:23:47 2018 ... Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

16 © 2018 Pythian Docker - images from container-registry

Register in container-registry.oracle.com

Start session D:\>docker login container-registry.oracle.com Username: [email protected] Password: xxx Login Succeeded Download image D:\>docker pull container-registry.oracle.com/database/enterprise:12.2.0.1 12.2.0.1: Pulling from database/enterprise 9bd4d110366e: Downloading [> ] 2.668MB/143MB af8b29651e27: Download complete

Step by step guide: http://databaseindex.blogspot.com/2018/04/oracle-12c-docker-windows-ocr.html

17 © 2018 Pythian Example – Oracle DB using Docker Image Check local images D:\>docker images REPOSITORY TAG IMAGE ID CREATED SIZE container-registry.oracle.com/database/enterprise 12.2.0.1 12a359cd0528 5 months ago 3.44GB Define image settings D:\>echo DB_MEMORY=1Gb >ora.conf Start the container D:\>docker run -d -it --name ora122 -P --env-file ora.conf container-registry.oracle.com/database/enterprise:12.2.0.1 5896d37c1cae083c9ab82ec52cf9900a3b22a012b5257c1cb065a6093d7d55c5 Check running containers D:\>docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 5896d37c1cae container-registry.oracle.com/database/enterprise:12.2.0.1 "/bin/sh -c '/bin/ba…" 24 minutes ago Up 24 minutes (healthy) 0.0.0.0:32769->1521/tcp, 0.0.0.0:32768->5500/tcp ora122 18 Summary – Oracle DB using Docker Using images with preinstalled Oracle binaries - Docker Store - Container registry Step-by-step: http://databaseindex.blogspot.com/2018/04/oracle-12c-docker-windows-ocr.html

Using Oracle github repository, must download binaries from OTN - Step-by-step example on : http://www.oracle.com/technetwork/es/articles/datawarehouse/oracle12c-docker-win10-4485487-esa.html

More examples: - Standby: https://github.com/jamesattard/oracle-xe-docker - RAC: https://github.com/Seth-Miller/12c-rac-docker https://github.com/oracle/docker-images/tree/master/OracleDatabase/RAC

19 © 2018 Pythian Docker - creating a container

Demo

20 © 2018 Pythian Hypervisors – Oracle VM (type 1) • Xen Kernel – UEK R4 as of July 2018 with OVM 3.4.4 • Server needs to boot with it (reinstall needed if other OS was used) • Minimal resources used by OVM server (1 CPU 2GB RAM) • VMs uses free available server’s resources – can be created from OVS using CLI (xm) or using OVM manager web client – RAM/CPUs can be allocated dynamically without restarting VMs (up to max config) – Only supported method to reduce license costs (hard partitioning) – HA configuration allowed with clustered repositories (using SAN, not with local HDs) – Windows, Linux and Solaris guests • OVM Manager – Needs to be installed in a different server – Uses MySQL as metadata repository

21 © 2018 Pythian Oracle VM - examples [root@ovs ~]# xm list Name ID Mem VCPUs State Time(s) 0004fb00000600001000d7829bf5a105 4 30723 4 -b---- 2415636.4 0004fb0000060000cf08a173c50efdc1 2 13063 4 r----- 784876.4 Domain-0 0 1958 20 r----- 1211462.2

[root@ovs /OVS/Repositories]# ls -l */VirtualMachines/*/vm.cfg -rw------1 root root 1950 Apr 19 02:37 0004fb00000300005b800c75ea8932be/VirtualMachines/0004fb00000600001000d7829bf5a105/vm.cfg -rw-r--r-- 1 root root 1946 Apr 19 02:36 0004fb00000300005b800c75ea8932be/VirtualMachines/0004fb0000060000cf08a173c50efdc1/vm.cfg

[root@ovs ~]# cd [root@ovs ~]# lscpu /OVS/Repositories/*/VirtualMachines Architecture: x86_64 [root@ovs VirtualMachines]# grep cpus CPU op-mode(s): 32-bit, 64-bit 0004fb0000060000cf08a173c50efdc1/vm.cfg Order: Little Endian maxvcpus = 4 CPU(s): 20 vcpus = 4 Hypervisor vendor: Xen cpus = '0-3‘ # '2,3' Virtualization type: none

22 © 2018 Pythian Oracle VM Manager console

23 © 2018 Pythian VirtualBox VMs (type 2)

• Run on any OS (Linux, Windows, Mac) • Download binaries for your platform • How to create your Oracle VM? – a) Download OS ISO+ Oracle binaries Create VM, boot from ISO, install OS + DB, create DB – b) Download VM template - all pre(installed/configured) http://www.oracle.com/technetwork/community/developer-vm/index.html – c) use tools to automate a) • Several github repos available (details later) • Allows to customize your VM and create your own template

24 © 2018 Pythian Example – Oracle DB using Vbox

25 © 2015 Pythian Confidential 26 CLI tools

• VBox: VBoxManage C:\Program Files\Oracle\VirtualBox> ./VBoxManage list vms "Oracle DB Developer VM" {6f3d3706-a84d-4163-9bf7-14da26393179} "oracle-OEL69" {2b835d64-f868-44d8-88e9-9f214dd2fb7d} "oel68-asm2" {e4d7eb54-2159-4398-a49a-3c2ccfe3cc86} "oel68-asm1" {bc5e8bc7-3e15-47a1-b81c-2d7bca77b7dd} "ora12c-si-asm-oel682" {a7318e8a-5b6d-496f-992c-46f84108d345} "ora12c-si-asm-oel681" {19e74473-bb07-423d-914c-354dc94d6b61} "default" {fbe05e1e-3c50-4f8f-ba29-6a795a56bdc8} post creation steps?

• Docker: dockerfile – ENTRYPOINT – commands to execute when container is run – CMD – provide default parameters for ENTRYPOINTS or executing an ad-hoc command

27 © 2018 Pythian Automation tools

Vagrant (from HashiCorp) Ansible (from RedHat) - Manage VMs with a standard workflow • Automation tool using a simple configuration - Out of the box with support for VirtualBox, language Hyper-V, and Docker • Agentless, uses OpenSSH and WinRM • Provisioning, configuration management and - Uses CLI (Vbox, Vmware, Docker) to workload orchestration manage lifecycle • Available on Linux and Mac - Handles CLI parameters accordingly with their different versions Terraform (from HashiCorp) - Automatic ssh setup, etc • Build infrastructure, complex sets, local and - Configuration files, providers, plugins remote using simple language - Use case: few local VMs • Runs on any OS - Runs on any OS – Linux, Windows, Mac

28 © 2018 Pythian Vagrant Install latest binaries: https://www.vagrantup.com/downloads.html OS Images - Called box: used to create your VM. - Public catalog: https://app.vagrantup.com/boxes/search - or create your own, or use from any URL Vagrantfile $ vagrant init hashicorp/precise64 - Configuration and provisioning steps $ vagrant up - Ruby syntax Bringing machine 'default' up with 'virtualbox' provider... ==> default: Importing base box 'hashicorp/precise64'... - Created with defaults using init ==> default: Forwarding ports... default: 22 (guest) => 2222 (host) (adapter 1) Simple example: creating a VM based ==> default: Waiting for machine to boot... on precise64 image ( 12.04 64- $ vagrant ssh bit) from their public catalog vagrant@precise64:~$ _

29 © 2018 Pythian Vagrant

Provisioning: execute steps after it is running - part of initial up process, or called manually - Built-in types: Shell, Ansible, Chef, Docker, Puppet, Salt, …

Sample Vagrantfile using a shell provisioner Vagrant.configure("2") do |config| config.vm.provision "shell", inline: "echo Hello, World" end

Providers: to manage - Out of the box for: VirtualBox (default), Docker, Hyper-V - More can be installed as plugins: Vmware, Custom

30 © 2018 Pythian D:\GitHub>vagrant box list bento/oracle-6.9 (virtualbox, 201801.02.0) Vagrant - commands kikitux/oracle6-racattack (virtualbox, 16.01.01) oravirt/ol67 (virtualbox, 20170424) oravirt/ol68 (virtualbox, 20170418) oravirt/ol72 (virtualbox, 20170425)

D:\GitHub>vagrant Usage: vagrant [options] [] box manages boxes: installation, removal, etc. init initializes a new Vagrant environment by creating a Vagrantfile validate validates the Vagrantfile up starts and provisions the vagrant environment provision provisions the vagrant machine push deploys code in this environment to a configured destination port displays information about guest port mappings status outputs status of the vagrant machine connect connect to a remotely shared Vagrant environment suspend suspends the machine resume resume a suspended vagrant machine halt stops the vagrant machine destroy stops and deletes all traces of the vagrant machine reload restarts vagrant machine, loads new Vagrantfile configuration snapshot manages snapshots: saving, restoring, etc. ssh connects to machine via SSH powershell connects to machine via powershell remoting rdp connects to machine via RDP 31 Ansible • Install binaries in a control machine (Windows not supported) • No agent – uses ssh to connect to remote machines • Inventory to define machines to use - /etc/ansible/hosts • Playbook: used for configuration, deployment, and orchestration – YAML format – tags and actions to execute – conditional control: when, loop, until – this is the main code to keep under source control • Modules describing resources and desired state – Created by us or built-in modules: http://docs.ansible.com/modules_by_category.html – Can be executed directly or inside playbooks

32 © 2018 Pythian Ansible playbooks

Sample playbook – playbook.yml

- hosts: webservers remote_user: root

tasks: - name: ensure apache is at the latest version yum: name: httpd state: latest - name: write the apache config file template: src: /srv/httpd.j2 dest: /etc/httpd.conf

To execute it: $ ansible-playbook playbook.yml

33 © 2018 Pythian Oracle VBox VMs using Vagrant/Ansible (1)

Repository with several configurations: https://github.com/oravirt/

Example for single instance: vagrant-vbox-si-asm . Customization explained: ${INST_DIR}/README.md . Code to change: o \vagrant-vbox-si-asm\hosts.yml: basename_vm: ora12c-si-asm-oel68 num_vm: 2 base_priv_ip: 172.16.56.30 # (your chosen IP)

o \vagrant-vbox-si-asm\extra-provision\ansible-oracle\group_vars oracle_install_version_gi: 12.1.0.2 oracle_version_db: 12.1.0.2

. Copy binary files from OTN - ${INST_DIR}\vagrant-vbox-si-asm\swrepo

34 © 2018 Pythian Oracle VBox VMs using Vagrant/Ansible (2)

To create the VM without installing Oracle: $ vagrant up

To install Oracle after the VM is created: D:\GitHub\vboxsi2\vagrant-vbox-si-asm>vagrant provision ==> oel68-asm1: Running provisioner: ansible_local... Vagrant has automatically selected the compatibility mode '2.0' according to the Ansible version installed (2.2.1.0). … PLAY [all] *********************************************************************

TASK [setup] ******************************************************************* ok: [oel68-asm1]

TASK [init : Install packages] ************************************************* ok: [oel68-asm1] => (item=[u'ntp', u'dnsmasq']) …

All together: $ setup=true ; vagrant up

35 © 2018 Pythian Oracle VBox VMs using Vagrant/Ansible

DEMO

More step-by-step examples: - Oracle Standby 12c using vagrant-vbox-si-asm: http://databaseindex.blogspot.com/2018/02/crear-oracle-standby-12c-usando.html - Oracle 12c VM on Windows 10 using ubuntu shell (WLS) and ansible: http://databaseindex.blogspot.com/2018/03/oracle-12c-vagrant-windows-wls-ubuntu.html

Other useful resources: https://fritshoogland.wordpress.com/2017/09/13/how-to-automatically-build-any-recent-version-of-the-oracle-database/

36 © 2018 Pythian Oracle RAC VBox VMs

• Similar approach: https://github.com/racattack/racattack-ansible-oracle • Implements configuration described in RAC Attack handbook: https://en.wikibooks.org/wiki/RAC_Attack_-_Oracle_Cluster_Database_at_Home/RAC_Attack_12c ############################# ##### BEGIN CUSTOMIZATION ##### • Customization explained ############################# in project readme (README.md) #define number of nodes num_APPLICATION = 0 on Vagrantfile: num_LEAF_INSTANCES = 0 num_DB_INSTANCES = 1 #define number of cores for guest num_CORE = 1 #define for each type of node in MBytes memory_APPLICATION = 1500 memory_LEAF_INSTANCES = 2300 step-by-step example on Windows: memory_DB_INSTANCES = 3072 http://databaseindex.blogspot.com/2017/04/automatizar-instalacion-de-oracle-rac.html

37 © 2018 Pythian Oracle RAC with Docker

As pointed earlier: https://github.com/oracle/docker-images/tree/master/OracleDatabase/RAC

Several containers needs to be created: - OracleConnectionManager: bind single port to host and serve containers on different ports - OracleRACStorageServer: Oracle ASM on NFS Server for RAC testing - OracleRealApplicationClusters: RAC instance, minimum two

Several steps for each container.

38 © 2018 Pythian VMs in Oracle Cloud • Infrastructure services – Database Cloud Service (DBCS): all managed, pre-built configurations – Compute (OCI or OCI-C): install DB manually as in VirtualBox – Bare Metal and BYOH (OCI): entire server, can install OVM or use as Compute • Container services • Automation – Terraform for OCI and OCI-C – Orchestration for OCI-C – REST API

Upcoming example – already in my other session about that topic

39 © 2018 Pythian Example: OCI Instance using Terraform

• Download Terraform binary (my example uses v0.11.3) – https://www.terraform.io/downloads.html • Download Terraform OCI-provider (using v2.1.0) – https://github.com/oracle/terraform-provider-oci/releases • Create .tf HCL Project (based on examples): – https://github.com/oracle/terraform-provider-oci/tree/master/docs/examples • Configure your account Access (env-vars.ps1) – Tenancy and user OCIDs, fingerprint, private key, region • Terraform Plan • Terraform Apply • Step by step guide: https://community.oracle.com/docs/DOC-1019936

40 © 2018 Pythian ncalero@H6RMYZ1:/mnt/d/GitHub/terraform-OCI/$ ls block.tf compute.tf env-vars.ps1 outputs.tf userdata datasources.tf network.tf provider.tf remote-exec.tf variables.tf

ncalero@H6RMYZ1:/mnt/d/GitHub/terraform-OCI$ cat /mnt/c/users/calero/AppData/Roaming/terraform.rc providers { oci = "d:\\soft\\terraform-provider-oci_v2.1.0.exe" }

PS D:\GitHub\terraform-OCI> cat ./env-vars.ps1 $env:TF_VAR_tenancy_ocid="ocid1.tenancy.oc1..aaaaaaaaw5hodl4pajmymyo62bwkj4kokziowmjkvj7fvmgt4lqia3yg7km" $env:TF_VAR_user_ocid="ocid1.user.oc1..aaaaaaaaiyhrscq7rhfiyhrscql4tb3ojto2ysw72l656yknkyqau2lxotqf" $env:TF_VAR_compartment_ocid="ocid1.compartment.oc1.. aaaaaaaakdevdha7q7yjdheridcy63sgv2syefv7x46u67jk4hj" $env:TF_VAR_region="us-ashburn-1“

$env:TF_VAR_fingerprint="db:a3:b8:59:ce:05:ff:78:c0:fb:aa:ca:d7:09:77:ad" $env:TF_VAR_private_key_path="C:\Users\calero\.oci\oci_api_key.pem"

### Public/private keys used on the instances $env:TF_VAR_ssh_public_key = Get-Content C:\Users\calero\.ssh\id_rsa.pub -Raw $env:TF_VAR_ssh_private_key = Get-Content C:\Users\calero\.ssh\id_rsa -Raw

PS D:\GitHub\terraform-OCI> ./env-vars.ps1

41 © 2018 Pythian ncalero@H6RMYZ1:/mnt/d/GitHub/terraform-OCI$ cat compute.tf resource "oci_core_instance" "DemoInstance" { availability_domain = "${lookup(data.oci_identity_availability_domains.ADs.availability_domains[0],"name")}" compartment_id = "${var.compartment_ocid}" display_name = "Demo-Instance" image = "${lookup(data.oci_core_images.OLImageOCID.images[0], "id")}" shape = "${var.InstanceShape}" subnet_id = "${oci_core_subnet.SN-DemoSubnetAD1.id}"

metadata { ssh_authorized_keys = "${var.ssh_public_key}" user_data = "${base64encode(file(var.InstanceBootStrap))}" } } ncalero@H6RMYZ1:/mnt/d/GitHub/terraform-OCI/demo$ cat provider.tf provider "oci" { tenancy_ocid = "${var.tenancy_ocid}" user_ocid = "${var.user_ocid}" fingerprint = "${var.fingerprint}" private_key_path = "${var.private_key_path}“ region = "${var.region}" }

42 © 2018 Pythian 43 © 2018 Pythian 44 © 2018 Pythian PS D:\GitHub\terraform-OCI> d:\soft\terraform graph | dot -Tpng -o demo-graph.png

45 © 2015 Pythian Confidential Terraform apply

46 © 2015 Pythian Confidential Summary

Comparing options to create an Oracle instance using dataguard (2 VMs) Solution Host OS Disk CPU License Creation Production space min. effort support OVM OVM 2xVM+ 1 (*) VM CPUs Medium yes

VirtualBox any 2xVM 1 (*) Entire host Easy (***) no

Docker any 1xVM+ 1 (*) Entire host Easy (***) yes (**)

Cloud any 2xVM 1 (*) VM shape Easiest yes Notes: * host CPU can be shared among VMs but performance will be impacted. Use 1 CPU per VM for prod ** only as described in MOS 2216342.1 - SI on OEL7 with UEK4 or RHEL7 as of July 2018 *** once familiar with the tool and concepts

47 © 2018 Pythian References - documentation

• Virtualization concepts: https://en.wikipedia.org/wiki/X86_virtualization

• Docker documentation: https://docs.docker.com/ • Oracle database on Docker – github project: https://github.com/oracle/docker-images

• VirtualBox user guide: https://www.virtualbox.org/manual/ch01.html

• Oracle VM documentation: https://www.oracle.com/technetwork/documentation/vm-096300.html

• Vagrant documentation: https://www.vagrantup.com/intro/index.html

• Ansible user guide: https://docs.ansible.com/ansible/latest/user_guide/index.html

• Terraform documentation: https://www.terraform.io/intro/index.html

48 © 2018 Pythian THANK YOU

Questions?

[email protected] @ncalerouy http://www.linkedin.com/in/ncalero

© 2017 Pythian 49