OCI Fast Track Tutorial-OCI v26
OCI Fast Track Tutorial-OCI v26
OCI Fast Track Tutorial-OCI v26
Introduction
On this guide, we’re going to work on creating some Oracle Cloud virtual machines, following
different processes and good implementation techniques
We’ll explore each and every one of the available resources on Infrastructure as Code (IaaS),
going from network, storage, virtual machines, and Load Balancer. To begin, it’s important to
check if the user has a clear understanding of OCI’s basic components like: Regions,
Compartments, and Availability Domains
Our goal is that, in the end of this workshop, attendees will be able to deploy their own
infrastructure segments following OCI’s best practices
PuTTY
PuTTY is a telnet and SSH client developed to grant Windows users, access
to Linux/Unix Servers. Putty is a Open Source Software.
Used Images
This LAB will basically use 2 different images:
• Oracle Linux 7
• Microsoft Windows 2016 Standard
Lab 1.
Accessing Oracle Cloud
Lab 1. Accessing Oracle Cloud
Objectives
• Access Oracle Cloud Console
• Known IaaS and PaaS Services
• Become acquainted with OCI Interface
In this Section, you will learn more about the initial steps on Oracle Cloud Portal
Hit the “Sign in to Cloud” link, and you will be redirected to the Cloud Connection screen, as
follows:
To more recent deployed environments, login must be made through “Identity Cloud Service
Account”. Where will be necessary to input “Account Name” (which is the defined name for
the Tenant).
After Tenant identification, you’ll be able to insert username and password for environment
access
Once identified, you’ll reach Oracle’s Cloud main screen, from where you can access all the
available services. Your default main screen will look like this.
From the “Action Menu” (Top left corner), you can reach the available services on our
console
Objectives
• Understand Availability Domain (AD) concept
• Understand Compartments
• Understand Fault Domains
Regions
Oracle Cloud Infrastructure is hosted in regions and availability domains. A region is a
localized geographic area. A region is composed of one or more availability domains. Most
Oracle Cloud Infrastructure resources are either region-specific, such as a virtual cloud
network, or availability domain-specific, such as a compute instance.
Regions are completely independent of other regions and can be separated by vast distances—
across countries or even continents. Generally, you would deploy an application in the region
where it is most heavily used, since using nearby resources is faster than using distant
resources. However, you can also deploy applications in different regions to:
• mitigate the risk of region-wide events, such as large weather systems or earthquakes
• meet varying requirements for legal jurisdictions, tax domains, and other business or
social criteria
After accessing the environment, is possible to change your region with just one click:
Availability Domains
In a Region, you may have up to three Availability Domains.
The availability domains within the same region are connected to each other by a low latency,
high bandwidth network, which makes it possible for you to provide high-availability
connectivity to the Internet and customer premises, and to build replicated systems in multiple
availability domains for both high-availability and disaster recovery.
Availability domains are isolated from each other, fault tolerant, and very unlikely to fail
simultaneously. Because availability domains do not share infrastructure such as power or
cooling, or the internal availability domain network, a failure at one availability domain within
a region is unlikely to impact the availability of the others within the same region
When creating a new compartment, you must provide a name for it (maximum 100 characters,
including letters, numbers, periods, hyphens, and underscores) that is unique within its parent
compartment. You must also provide a description, which is a non-unique, changeable
description for the compartment, between 1 and 400 characters. Oracle will also assign the
compartment a unique ID called an Oracle Cloud ID
The Console is designed to display your resources by compartment within the current region.
When you work with your resources in the Console, you must choose which compartment to
work in from a list on the page.
That list is filtered to show only the compartments in the tenancy that you have permission to
access. If you're an administrator, you'll have permission to view all compartments and work
with any compartment's resources, but if you're a user with limited access, you probably won't
Compartments are global, across regions, when you create a compartment, it is available in
every region that your tenancy is subscribed to.
Creating Compartments
On the main menu, Hit “Identity”, then choose “Compartments”
Name: Compartimento-Trial
Description: Compartimento para recursos de testes
Parent Compartment: root
Lab 2. Networking
Virtual Cloud Network and
It’s Resources
1 2 3 4 5 6 7 8
Lab 2. Networking
Virtual Cloud Network and It’s Resources
Objectives
• Create Oracle Cloud Network (VCN)
• Configure Regional Public and Private Subnets
• Provision an Internet Gateway, which will allow your VCN access to public internet
• Configure Route Table
Entering the Virtual Network Module, you’ll be presented to 2 options for creating an OCI
Network:
• You can individually create the network components
• You can run through a wizard-based creation process, that will assist you on setting
up network components, and basic connectivity setup.
On this example, we will use the wizard-based process, started by choosing the option
“Networking Quickstart” button below
Starting the process, you’ll be guided by OCI interface through the process.
1 – Choose the type of connectivity you want, you can choose a VPN model, or standard
internet access through internet gateway
Please note, the provided blueprint on the right side of the screen, it works as an illustration
of how your connectivity will be set. On our tests, we’ll use a simple internet connectivity
model, which will create the following components:
• VCN
• Regional Public and Private Subnets
• Internet Gateway
• Route Table
• NAT Gateway (Not covered on this Workshop)
• Service Gateway (Not covered on this Workshop)
Name: VCN-TRIAL
Compartment: Choose your own compartment
Your compartment
compartment name
goes here
Then, input CIDR Block information for VCN and it’s subnets
• CIDR Block info provided here are for sample setup only.
Check the provided information and hit the “Create” blue button at the end of the screen.
Finishing the process, you can follow the all the creation steps executed by the interface:
The networking creation process is very quick, when finished, will be shown as below:
We can take a look at the “reference blueprint” showed at the start of the VCN creation
process, and review the elements that were automatically created by OCI wizard:
We got : 1 VCN, 2 Regional Subnets (public and private), 1 Internet Gateway, 1 NAT
Gateway, and 1 Service Gateway, all already setup and ready for use.
Note that using this option, you get the entire Network stack ready in less than 5 minutes.
Lab 3.
Compute Instances
Open the application, choose a RSA type key, and a 2048 bits key. Then hit “Generate”
For VM creation, we’ll use public key. Private key will only be used for connection.
After expanding Shape’s and networking options, input the necessary data to finish the
creation process:
You will probably have the new instance properly created in a few minutes. After finishing
the creation process, the main screen will look like this:
Open PuTTY. Fill “Host Name (or IP Address)” with the public IP address
After saving the configuration, Hit Open, and you’ll establish connection to the VM
Objectives
• Quickly create a Virtual Machine
• Identify main information needed for a OCI Compute Instance Creation
Windows Instance creation usually takes 5 minutes. After instance creation, you’ll see:
Before stepping forward, find the VM’ public IP, and copy it :
Don’t worry, that’s the expected behavior. In order to access a compute instance on Oracle
Public Cloud, you need to configure firewall “Access Rules” first. On the next session, we’ll
configure other resources, that can be created before the VM, and provide access permissions
as well.
Security Rules
You probably noticed that Linux VM could be accessed by SSH key right after it’s creation,
but Windows instance could not be accessed through RDP.
Firewall rules are set inside in an object called “Security List”, that can be accessed within a
subnet.
Security Rules are inside the Security List, from there, we can setup which ports and
protocols are allowed traffic inside a subnet.
Click on: Security List -> Default Security List for VCN-Trial
To access the VCN’s firewall rules, choose the Security List you want to configure. In our
example, you’ll find the “Default Security List” already created on our VCN. Click on the
“Default Security List” security list and then the access rules console will come up.
IF everything was properly configured, you’ll be transported to Windows login page, where
you will need to change OPC password on first access.
Lab 4.
Storage Cloud Services
Block Volume creation process is a very straight forward process, you just need to hit
“Create Block Volume”, and fill the requested information:
Name: block_vol50GB
Create in Compartment: <Your Compartment>
Virtual Cloud Network: <Your VCN>
Availability Domain: AD2
Size: 50GB
Backup Policy: Bronze
Volume Performance: Balanced
After setup, OCI Will begin provisioning. Provision time depends on the volume size, on our
example (50 GB), it will take no more than 30 seconds:
Name: block_vol500GB
Create in Compartment: Compartimento-Trial
Availability Domain: AD2
Size: 500GB
Backup Policy: Bronze
Volume Performance: Balanced
To ease disk attachment process, Oracle Cloud Infrastructure provides the necessary
commands to detect the new disk from the VM. On the right side of the disk information,
you’ll find a three dot’s menu.
All you need to do, is copy the commands, and execute it on the Linux server.
After disk detection, you need to format and mount the new disk:
3rd – Execute the “ATTACH commands” copied from the screen above:
4th - Detect the new device with command: “$ fdisk -l” command, where you’ll will see the
following output :
6th – Create a directory do be used as a mount point for the filesystem with command:
“mkdir /vol50g”
7th – Mount the Filesystem with command: “mount /dev/sdb /vol50g”, and check the disk
availability with command: “df -h”
Repeat the previous steps (from 1 to 7) to configure the 500GB volume. Just remind, that for
the second disk, the volume will have a different name. 50GB volume got identified by
“/dev/sdb”, the 500GB Volume will probably be identified by “/dev/sdc” name. Remember to
check disk ID before move ahead.
Step 1 Test the true performance of the already provisioned Block Volume (/dev/sdb):
1 – Install FIO utility on the recently created Linux Compute instance: (as ROOT user, issue
the command : “yum install fio”
We can see the IOPS throughput for 50GB disk and IOPS for 500GB disk ( both balanced)
Objectives
On Oracle Cloud Infrastructure, Block Volume (including boot volumes), and compute nodes
backups are independent. Backup policies can be set on the Block Storage home page (Main
Menu > Block Storage > Block Volumes):
Backup options can be easily accessed from the “fast menu” (Three dots on the right), option
“Assign Backup Policy”
Where you can choose the most appropriate backup policy for your data.
Lab 5.
File Storage Service
Using the File Storage service requires an understanding of the following concepts, including
some that pertain to Oracle Cloud Infrastructure Networking:
• Mount Target
An NFS endpoint that lives in a subnet of your choice and is highly available. The
mount target provides the IP address or DNS name that is used in the mount
command when connecting NFS clients to a file system. A single mount target can
export many file systems
• Export
Exports control how NFS clients access file systems when they connect to a mount
target. File systems are exported (made available) through mount targets. Each mount
target maintains an export set which contains one or many exports.
Objective
• Create a FileStorage Service filesystem, and access it through a Linux Compute
Instance
1 – Access FileStorage Service main screen through OCI Main page on Action Menu
You’ll see a pop-up screen requesting the main information to identify FileStorage Service.
You will note, that the main fields are already filled with default information. Use the “Edit”
button on the right, to customize the filesystem info with your data.
Select the created Mount Target, on the “Export’s” action menu, on the right, select “Mount
Commands”, and you’ll get a screen with connectivity information regarding the Mount
Target.
Here Oracle Cloud follows the same behavior as in the other wizards. All you need to do, is
“copy” and “Paste” the Linux commands on SSH prompt.
Connectivity Issues
Please note, FileStorage is a network service, and as such, it’s usage, is subordinated to
firewall rules. In order to mount the created mount target, we’re going to create an Ingress
Security Rule, to allow FileStorage Service IP traffic.
SOURCE CIDR is the IP address attached to the Mount Target. In our case, it`s the IP from
the Instance network 10.0.1.0/24.
DESTINATION PORT, File Storage requires some ports do be opened (2048 – 2050 and
111, for protocol TCP, and 2048,111 for protocol UDP).
Lab 6.
Load Balancer
The Load Balancing service enables you to create a public or private load balancer within your
VCN. A public load balancer has a public IP address that is accessible from the internet. A
private load balancer has an IP address from the hosting subnet, which is visible only within
your VCN. You can configure multiple for an IP address to load balance transport Layer 4 and
Layer 7 (TCP and HTTP) traffic. Both public and private load balancers can route data traffic
to any backend server that is reachable from the VCN.
Your load balancer has a backend set to route incoming traffic to your Compute instances.
The backend set is a logical entity that includes:
backend set
A logical entity defined by a list of backend servers, a load balancing policy, and a
health check policy. SSL configuration is optional. The backend set determines how
the load balancer directs traffic to the collection of backend servers.
certificates
If you use HTTPS or SSL for your listener, you must associate an SSL server certificate
(X.509) with your load balancer. A certificate enables the load balancer to terminate
the connection and decrypt incoming requests before passing them to the backend
servers.
health check
LAD Knowledge Team
Objective
Create a Public Load Balancer Service, with 2 backend servers running Apache Application
server.
Before we start creating out LB service, please note that there are some important tasks to
complete. In order to have some “service” to be tested by the Load Balancer, we need to
install an application server on the Linux servers.
Follow the steps below to install Apache Application server on Linux servers:
On the second instance you will repeat the steps above, from 1 to 5 and the command 6
will be:
“echo 'This is Oracle webserver 2 running on OCI Workshop' >
/var/www/html/index.html”
3 - Test Apache’s behavior, all you need to do, is use the Compute Instance’s public IP on the
browser to check if Apache’s main page will come up.
REMINDER: Before test Apache on your browser, be sure that you have already created an
Ingress Rule on the VCN’s Security List, so Port 80 is cleared for traffic.
If everything if OK, you may test the apache installation. All you have to do, is to use the
public instance’s IP address on your preferred browser, and you’ll probably get this output:
IMPORTANT: Be sure to start Load Balancer creation only after both calls on apache are
working. This is important, because if you create the load balancer without an available
service, load balancer will be created in “Error” state. Load Balancer usually takes 5 minutes
to “calibrate” it’s status.
Our Goal, is to create Load Balancer service only after both Apache servers are running, so
LB service will have “ready” state, and will be ready to be tested.
To access Load Balancer interface, again, we’re going to start from the “Action Menu”
Name: lb-apache
Set the Load Balancer Policy and add the Backend Servers. To add Backend Servers, hit the
blue button “Add Backends”
Once the creation process is finished, you’ll have the following information:
Lab 7.
Autonomous Database
Objectives
• Provisioning and usage of Autonomous database
Overview
Oracle Cloud Infrastructure's Autonomous Database is a fully managed, preconfigured
database environment with two workload types available, Autonomous Transaction
Processing and Autonomous Data Warehouse. You do not need to configure or manage any
hardware, or install any software. After provisioning, you can scale the number of CPU cores
or the storage capacity of the database at any time without impacting availability or
performance. Autonomous Database handles creating the database, as well as the following
maintenance tasks:
• The Autonomous Transaction Processing workload type configures the database for a
transactional workload, with a bias towards high volumes of random data access.
• For a complete product overview of Autonomous Transaction Processing,
see Autonomous Transaction Processing
The Autonomous Data Warehouse workload type configures the database for a decision
support or data warehouse workload, with a bias towards large data scanning operations.
For a complete product overview of Autonomous Data Warehouse, see Autonomous Data
Warehouse.
To start Autonomous Database creation process, you can choose between two different
starting points:
1. Hit Action menu on the left side of the main screen, then choose “Autonomous
Database”
2. Hit the desktop shortcut on the main screen (blue rectangle), and you’ll be redirected
to Autonomous database creation.
Then input:
1. Administrator password
2. Choose your license type model
After providing all this data, just hit “Create Autonomous Database” in the bottom of the
screen, and provisioning process will start
Autonomous provisioning takes no more than 5 min. You’ll then get the screen :
This new version of Autonomous, brings an already loaded version of SQL Developer,
which can be reached from :
In the Worksheet tab, use the worksheet screen to right some SQL statements to query
ADW database content:
The following commands can be used on the SQL Worksheet to test Autonomous database:
While executing commands, you can change to Activity view on the Autonomous Database
page, and follow-up the database activity.