Saturday, 3 December 2022

Oracle Cloud Infrastructure Foundations-Labs


 

Oracle Cloud Infrastructure Foundations-Labs

 

 

Presentation by:

www.EasyReliable.COM

Phone:  +080-41156843/+91 9606734482

Email:  easyreliable@gmail.com/support@easyreliable.com

Website: http://www.easyreliable.com

 

Table of Contents

 



Practice: Create Compartment, Group, User, and Policies      ----------.................,,,,..........5 Practice: 

Create Virtual Cloud Network ................................................................................9 Practices:

Create a Compute Instance.........................................................................................11 Practice:

Launching the Cloud Shell............................................................................................12 Practice:

Generating SSH Keys...................................................................................................14 Practice: 

Creating a Compute Instance.......................................................................................16 Practice:

Create an EASY Object Storage Bucket.......................................................................19 Practice: 

Create a Block Volume..................................................................................................21 Practice:

Attaching Block Volume to a Compute Instance ...........................................................23 Practice: 

Create an Autonomous Data Warehouse.......................................................................25 Practice: 

Connect to access ADW using SQL...............................................................................27 Practice: 

Create an Autonomous JSON Database........................................................................31 Practice: 

Create a Resource Manager Stack .................................................................................

 

Practice: Create Compartment, Group, User, and Policies

 

Overview

 

In this practice session, we will create a compartment called "easylabs" and grant a user access to it.

To grant users access to the compartment and all the resources in it, you will create a group “easylabs-group” and then create a policy “easylabs-policy” to define the access rule. Finally, add the “easylabs-user” to this group to grant them access to the easylabs compartment.

Note: The instructions in these practices will work on the Oracle Cloud Free Tier account, but may not work on the OU Cloud account.

 

Creating Compartment

 

Tasks

 

1.     Log into your Oracle Cloud account.

 

2.     Click Menu         on the top-left corner and navigate to Menu > Identity & Security > Compartments.

3.     Once inside the Compartments menu, click Create Compartment.

4.     Fill in the compartment details we had collected before and click Create Compartment at the bottom-left corner of the screen.

5.     You should be able to see the newly created compartment in the list of compartments.

 

Creating Group

 

Tasks

 

1.     Click Menu         on the top-left corner and navigate to Identity & Security > Groups and click Create Group.

2.     Provide the required details and click Create.


3.     The group has been created and listed along with other groups in the page.


 

 

Creating Policy

 

Prerequisites

 


·     Policy name and description ·     Policy statement

Allow group easylabs-group to manage all-resources in compartment easylabs

 

Tasks

 

1.    Click Menu          on the top-left corner and navigate to Menu > Identity & Security > Policies.

2.    Once inside the policy menu, select the compartment easylabs or the name which you have given. Click Create Policy.

3.    In Policy Builder section, click Show manual editor and enter the policy statement.

4.    Enter the policy details we had collected before and click Create at the bottom-left corner of the screen.

 

Creating User

 

Prerequisites

 

·      The first name and last name of the user

·      Their email address, alternate email address, and mobile phone number

 

Tasks

 

1.     Click Menu         on the top-left corner and navigate to Identity & Security and click Users.

2.     The user management page appears. Click Create User.

DO NOT create an IDCS user (which is the default). Instead, you must click the IAM User box to create a local IAM user instead.

3.     Provide the required information (username: easylabs-user) and click Create. The user is created.

4.     Click Create/Reset Password to generate a one-time password for the users. 5.     Copy the password to the text editor.

 


Adding a User to Group

 

Prerequisites

 

·      Group Name ·            User Name

 

Tasks

 

1.     Navigate to Groups page and click the group name and click Add User to Group. 2.          Select the user from the drop-down list.

3.     Click Add and the user will be added to the group.

 

Now Sign in as the New User, easylabs-user

 

1.     Enter the username easylabs-user with the password generated in the previous step and click Direct Sign In.

2.     Change the temporary password and click Save New Password.

3.     You will get the web cloud console page and you will be able to access the Always Free resource from the                                      menu.

4.     The username can be verified under profile icon              .

This completes our practice session about creating compartment, group, user, and poli

 

                                                                                                                                                                                                 

Practice: Create Virtual Cloud Network

 

Overview

 

In this practice, we are going to create a VCN and the required network resources.

 

Tasks

 

1.    Log into your Oracle Cloud account

2.    In the Oracle Cloud Infrastructure section, enter the cloud account User Name and Password assigned to you and click “Direct Sign-In.”

3.    At this point, you should be logged in to Oracle Cloud Infrastructure (EASY) Dashboard, also called as the EASY console.

 

4.    Click Menu         on the top-left corner and explore the options available services. You will use this navigation path through the practice.

5.    In the console, click Menu > Networking > Virtual Cloud Networks.

 

6.    In the networking page, select the compartment name from the drop-down list. To locate the drop-down list for compartments, look in the List Scope section on the left side of the page.

7.    On the Virtual Cloud Networks page, click Start VCN Wizard.


 

 

8.    In the dialog box, choose VCN with Internet Connectivity, and click Start VCN Wizard 

 

9.    Provide the basic information:

·      VCN Name – EASY_VCN

·      Compartment –easylabs

·      VCN CIDR Block – Enter 10.0.0.0/16

·      Public Subnet CIDR Block – Enter 10.0.1.0/24 ·       Private Subnet CIDR Block – Enter 10.0.2.0/24

·      Select the check box for - Use DNS Hostnames in this VCN

10. Click Next.

11. Review and click Create.


Lot of useful information is available on this page, do review them. 12. The VCN is created along with Private and Public Subnets.

 

 

Note: This option is the quickest way to get a working cloud network in the fewest steps.

Please note that the public and private subnet CIDR blocks suggested for use are not the initial default values in the wizard.

This completes the task of creating a VCN along with two subnets and you will use this in the upcoming practices.

 

 

Practices: Create a Compute Instance

 

Overview

 

You will perform the following tasks in this practice: ·     Launch Cloud Shell

·      Generate SSH Keys

·      Create Compute Instance


Practice: Launching the Cloud Shell

 

Overview

 

In this practice you will launch the Cloud Shell session for the EASY user account assigned to you in preparation for the upcoming practices.

 

Cloud Shell

 

Oracle Cloud Infrastructure (EASY) Cloud Shell is a web browser-based terminal accessible from the Oracle Cloud Console. Cloud Shell is free to use (within monthly tenancy limits), and provides access to a Linux shell, with a pre-authenticated EASY CLI and other useful tools.

It provides:

·      An ephemeral machine to use as a host for a Linux shell, preconfigured with the latest version of the EASY CLI and several useful tools

·      5GB of storage for your home directory

·      A persistent frame of the Console which stays active as you navigate to different pages of the console

 

Note:

 

·      The EASY CLI will execute commands against the region selected in the Console's Region selection menu when the Cloud Shell was started. Changing the region selection in the console will not change the region for existing Cloud Shell instances; you will need to open a new Cloud Shell instance to change regions.

·      Cloud Shell sessions have a maximum length of 24 hours, and time out after 20 minutes of inactivity. However, this should not impact this practice.

 

Tasks

 

1.    Log into your Oracle Cloud account

2.    Click the Cloud Shell icon in the EASY Console header, highlighted in the below screenshot.


3.    This will launch the Cloud Shell in a “drawer” at the bottom of the console. Once it is ready you will see the terminal as show below: 

4.    You can use the icons in the upper-right corner of the Cloud Shell window to minimize, maximize, and close your Cloud Shell session.

You can also use the menu icon in the upper-left corner of the cloud-shell window to upload or download files, restart console and different setting options.

5.    For clipboard operations:

·      Windows users can use Ctrl-Cor Ctrl-Insertto copy, and Ctrl-Vor Shift-Insertto paste.

·      For Mac OS users, use Cmd-Cto copy and Cmd-Vto paste.

To get started with Cloud Shell, you can run the below EASY CLI command. Your Cloud Shell comes with the EASY CLI pre-authenticated, so there is no setup to do before you can start using it.

6.    This command will display the name space of your EASY Tenant.

 


easylabs_us@cloudshell:~ (ap-mumbai-1)$ EASY os ns get {

"data": "bm6rwnfgnfbj" }

This completes the task of launching Cloud Shell. Keep this session active for the next practice.

                                                                                                                                                                                                            13


Practice: Generating SSH Keys

 

Overview

 

Instances use an SSH key pair instead of a password to authenticate a remote user. A key pair file contains a private key and public key. You keep the private key on your computer and provide the public key every time you launch an instance. In this practice, you will generate SSH keys to be used later while launching an instance.

 

Tasks

 



Continue working this practice while logged in as the easylabs-user (from the previous practice).


1.    Launch the Cloud Shell session as described in the previous practice.

Execute the below commands to generate ssh-keys, which will be used to create Compute instance. As long as an id_rsaand id_rsa.pubkeypair is present, they can be reused. By default these are stored in ~/.ssh/directly.


easylabs_us@cloudshell:~ (ap-mumbai-1)$ ssh-keygen Generating public/private rsa key pair.

Enter file in which to save the key (/home/easylabs_us/.ssh/id_rsa):

Created directory '/home/easylabs_us/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again:

Your identification has been saved in /home/easylabs_us/.ssh/id_rsa.

Your public key has been saved in /home/easylabs_us/.ssh/id_rsa.pub.

The key fingerprint is:

SHA256:zxQogNbEvQJIAbJb+3x1r8QEJN8ZWlUYHHyZge5lZ10 easylabs_us@804708cc8ef6

The key's randomart image is: +---[RSA 2048]----+

|=+.=o.. . o++*o+ | |o.+ o..+ = o= + E| |.... ..= +. . o| | o .. .. . .. o +| |. . . S +. o o | | o . B .. | | o . = . | |     . . .     | |          .     | +----[SHA256]-----+


 

 

 

2.    Make sure permissions are restricted, as sometimes ssh fails if private keys have permissive file permissions.


easylabs_us@cloudshell:~ (ap-mumbai-1)$ chmod 0700 ~/.ssh easylabs_us@cloudshell:~ (ap-mumbai-1)$ chmod 0600 ~/.ssh/id_rsa

easylabs_us@cloudshell:~ (ap-mumbai-1)$ chmod 0644 ~/.ssh/id_rsa.pub

easylabs_us@cloudshell:~ (ap-mumbai-1)$ ls -l ~/.ssh total 8

-rw-------. 1 easylabs_us EASY 1675 Jun 29 17:10 id_rsa

-rw-r--r--. 1 easylabs_us EASY 405 Jun 29 17:10 id_rsa.pub

 

 

3.    Copy the contents of ~/.ssh/id_rsa.pubon a Notepad. This is your ssh key to connect to the instances.

 

 


easylabs_us@cloudshell:~ (ap-mumbai-1)$ cat ~/.ssh/id_rsa.pub

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDEUsgq5R/5PcdS1+Mws2Y6vli0HcCw9g3l uI0x/yFDwE+stlnfyzv4c73+uS35VD6kgFMo5izZKx3fV0JpqhUPjwtwuyigP9jc 6cgJmWjYhkbCHD8r8bFvrdVv0KuUPi+oKQUI4Zr4EtuTao3kkLywWz6aEJgS6GY2 19JSXqBH27QjgGk4l4sdeb9VuTuQ07Z7VyzyAUfKK5oqlJfLC6a/JhdfTLYnv++W y3lnVZUojEQK57bOD7jVDTTErs0PSWXzMedretrEXtsBU+Tm1DZBe7QWoqghMTkI a3hegu1qIwVxujfy7xDNPE1FHR/LG0978CyJwAfRShjXAYQtSwMF easylabs_us@804708cc8ef6

 

 

This completes the task of creating the ssh key 

                                                                                                                                                                                                            15


Practice: Creating a Compute Instance

 

Overview

 

In this practice, you create Compute VM instances in each of the two subnets in your VCN.

An Oracle Cloud Infrastructure VM Compute instance runs on the same hardware as a Bare Metal instance, leveraging the same cloud-optimized hardware, firmware, software stack, and networking infrastructure.

 

Tasks

 

1.    In the EASY Console, navigate to Menu > Compute > click Instances. 2. Click Create Instance.

Note: You should select your compartment before creating an instance. 3.  Fill in the following details for your Compute instance:

·      Name: EASY_Compute ·       Compartment: easylabs

·      Placement: Select default

·      Image or Operating System: Select the default Oracle Linux image ·       Availability Domain: Select any Availability Domain


·      Shape: VM.Standard.E2.1.Micro

 

 

·      Networking: EASY_VCN

·      Add SSH Keys: Select the Paste SSH keys option and paste the content of your Public SSH key copied in the previous practice. (Also available in ~/.ssh/id_rsa.pub)

·      Boot Volume: Select default

4.    Finally, click Create to create the Compute instance.

5.    Once the instance state changes to Running, you can SSH to the Public IP address of the instance. To do this, make a note of the Public IP address that gets assigned to the EASY_Compute.

 

6.    You will use Cloud Shell to connect to the Compute instance.Bring up the minimized Cloud Shell terminal, or launch it again and enter the following command, and enter Yes when prompted to continue connecting.

                                                                       


 


$ ssh opc@<Public_IP_of_Compute>

 

 

Note: In general, for EASY Linux-based compute instances, the default username is opc.

Once successfully connected, you can see the change in the command prompt to ensure you are now logged in to your ‘EASY_Compute’ Compute instance.

This completes the task of creating a Compute instance.

                                                                                                                                                                                                         


Practice: Create an OCI Object Storage Bucket

 

Overview


In this practice, you will create a storage bucket using Oracle Cloud Infrastructure (EASY) Object Storage.

 

Tasks

 

1.    Log into your Oracle Cloud account

 

2.    Click the        icon to see the available options. 

3.    Click Storage and then Click Buckets. 4.  Select the compartment.

5.    Click Create Bucket

 

 

6.    Fill in the details as follows:

·     Bucket Name: EASY_bucket

 ·    Storage Tier: Standard

·     Ignore Tags and click Create Bucket 

 

 

You can see the bucket you just created.

7.    Click the Bucket you just created to check the details.

8.    Click Upload and browse any object from your local machine and click upload.

 


 

Practice: Create a Block Volume

 

Overview

 

A common usage of Block Volume is adding storage capacity to an Oracle Cloud Infrastructure Compute instance.

·      Once you have created a Compute instance and set up your VCN, you can create a block storage volume through the Console or API.

·      Once created, you attach the volume to an instance using a volume attachment.

·      Once attached, you connect to the volume from your instance’s guest OS using iSCSI or paravirtualized mode. The volume can then be mounted and used by your instance.

 

Tasks

 

1.    Log into your Oracle Cloud account

2.    Navigate to Menu and click Storage and then click Block Volume. 3.       Click Create Block Volume and enter the following details:

·      Name: EASY_BV

·      Compartment: Ensure your Compartment has been selected

·      Availability Domain: It mustbe the same as the AD you chose for your instance

You must place your new block volume in the same AD (availability domain) as was used for your compute instance created earlier. If you’re not sure, navigate to Compute to look at your instance to verify it’s AD placement.

·      Size: Set size to 50 GB.

·      Compartment for Backup Policies: Ensure your Compartment has been selected ·            Backup Policy: Bronze

·      Cross Region Replication: Off

·      Encryption: Go with the default option of Encryption using Oracle-Managed Keys.

Note: The size must be between 50 GB and 32 TB. You can choose in 1 GB increments within this range. The default is 1024 GB.

Review the screenshots in the next page and then go to the next step, when you will create the block volume.

4.    Leave the tags options as it is and click Create Block Volume.

Quick recap on the block volume backup policies: There are three predefined backup policies, Bronze, Silver, and Gold. Each backup policy has a set backup frequency and retention period.


 

 

·      Bronze Policy: The bronze policy includes monthly incremental backups, run on the first day of the month. These backups are retained for twelve months. This policy also includes a full backup, run yearly on January 1st. Full backups are retained for five years.

·      Silver Policy: The silver policy includes weekly incremental backups that run on Sunday. These backups are retained for four weeks. This policy also includes monthly incremental backups, run on the first day of the month and are retained for 12 months. Also includes a full backup, run yearly on January 1st. Full backups are retained for five years.

·      Gold Policy: The gold policy includes daily incremental backups. These backups are retained for seven days. This policy also includes weekly incremental backups that run on Sunday and are retained for four weeks. Also includes monthly incremental backups, run on the first day of the month, retained for 12 months, and a full backup, run yearly on January 1st. Full backups are retained for five years.

5.    The volume will be ready to attach once the status change from PROVISIONING to AVAILABLE.

  

This completes the task of creating a Block Volume, which you will be attaching to your Compute instance in the next practice.

 

 

Practice: Attaching Block Volume to a Compute Instance

 

Overview

 

In this practice, you will attach a newly created Block Volume to a Compute instance.

 

Tasks

 

1.    Once the Block Volume is created, you can attach it to your Compute instance.

When you attach a Block volume to a Compute instance, you have two options for attachment type, iSCSI or paravirtualized.

·      iSCSI: iSCSI attachments are the only option when connecting Block volumes to bare metal instances. Once the volume is attached, you need to log in to the instance and use the iscsiadmcommand-line tool to configure the iSCSI connection.

·      Paravirtualized: Paravirtualized attachments are now an option when attaching volumes to Virtual Machine (VM) instances. For VM instances launched from Oracle-Provided Images, you can select this option for Linux-based images published. Once you attach a volume using the paravirtualized attachment type, it is ready to use. You do not need to run any additional commands. However, due to the overhead of virtualization, this reduces the maximum IOPS performance for larger Block volumes.

2.    Go to Menu > Compute > click Instances. Ensure you Compartment is selected. 3.           From the list of Compute instance, click your EASY_compute instance.

4.    On your compute instance details page, scroll down and navigate to the Resources section on the left side.

5.    Click the Attached Block Volumes link. Currently, you do not have any volumes attached to your Compute instance.

6.    Click Attach Block Volume, to add the newly created volume.

 

 

 

7.    Select the volume created from the drop-down menu and choose the following options: ·      Attachment mode: Let Oracle Cloud Infrastructure choose the best attachment type ·   Volume: Select Volume

·      Block Volume Compartment: Ensure your Compartment has been selected ·        Block Volume: Select the volume you created

·      Device Path: Select /dev/oracleEASY/oraclevdb ·  Click Attach

·      Access: Read / Write

Note the message upon clicking Attach.


 

 

 

Click Close.

8.    Once the volume is attached, it will be displayed like this:


This completes the task of attaching Block Volume to a Compute instance.

 

Practice: Create an Autonomous Data Warehouse

 

Overview

 

In this practice we are going to create an Autonomous Database.

 

Tasks

 

1.    Log into your Oracle Cloud account

2.    At this point, you should be logged in to Oracle Cloud Infrastructure (EASY) Dashboard, also called as the EASY web console.

 

3.    Click Menu         on the top left corner and explore the options available services. You will use this navigation path through the practice.

 

 

4.    Click “Create Autonomous Database” and provide the below information. ·  Compartment: easylabs

·     Display name: EASY_ADB · Database name: EASYADB

·     Choose a workload type – Data Warehouse

·     Choose a deployment type – Shared Infrastructure

5.    In the configure database section by default Always Free option is selected 6.           Select the latest version.


 

7.    Provide administrator credentials and confirm, “Admin” is the default administrator user ·     User Name –ADMIN

·     Password – Enter password

8.    Choose network access type as Allow secure access from everywhere.

 9.    Choose a license type as Bring Your Own License (BYOL)


 

10. Provide email id for Maintenance contact (optional) 11. Click on Create Autonomous Database

Your Autonomous Database will be provisioned in few minutes.


This completes the task of creating an Autonomous Data Warehouse.

 

Practice: Connect to access ADW using SQL

 

Overview

 

In this practice, you will access and query the Autonomous Database using Database actions.

 

Tasks

 

1.    Log into your Oracle Cloud Free Tier Account

 

2.    Expand the Menu            located at the top-left corner. Under Oracle Database, click Autonomous Data Warehouse.

3.    In the side menu’s Compartment list, select the Compartment, then select the Autonomous Database created in previous practice.

 

4.    Click Tools tab.





 

5.    In the Database Actions area, click Open Database Actions.

 

 

6.    You will be prompted to enter your username and password. Enter the ADMINcredentials and click Sign In.

Username: ADMIN

Password: Entered for Admin user while creating ADW.

 

7.    Click SQL. It will open a worksheet, in which you can enter the queries and fetch data from ADW.

  

8.    Create a database user and provide database actions access to the user.

 


Create user test identified by Wwelcome_123 quota unlimited on data;

GRANT DWROLE TO test;

9.    Click Hamburger icon on left hand side and click Database Users under Administration.

 

Search for TESTuser and click three dots           on right and Click Enable REST, a dialog box will open and enable Authorization required and then click REST Enable User to enable login using TESTuser. After enabling REST, a link will appear in the TESTuser area, copy the link and paste in new browser tab to login using TESTuser.


10. Enter username and password for TESTuser and login.


11. Click SQL to open worksheet to execute SQL statements. Create a table and insert few rows.


Create table EMP(emp_id number(10) primary key, First_name Varchar2(20), last_name Varchar2(20), salary number(8,2), dept_id Number(5));

 

 

Insert into emp values(100,'John','Smith', 10000, 5000);

Insert into emp values(101,'David','Smith', 12000, 5010);

     Insert into emp values(102,'Robin','Warner', 9000, 5000);

Insert into emp values(103,'Dave','Johnson', 9500, 5000);

 

Insert into emp values(104,'John','Cook', 10000, 5000);

commit;

 

Select * from emp;

 



12. This complete the practice to connect and access ADW using SQL. 13. Delete the Autonomous Database EASY_ADW.

 

Practice: Create an Autonomous JSON Database

 

Overview

 

In this practice, we are going to create an Autonomous JSON Database.

 

Tasks

 

1.    Log into your Oracle Cloud account

2.    At this point, you should be logged in to Oracle Cloud Infrastructure (EASY) Dashboard, also called as the EASY web console.

 

3.    Click Menu         on the top-left corner and explore the options available. You will use this navigation path through the practice.

4.    Click Create Autonomous Database and provide the following information: ·        Compartment: easylabs

·     Display name: EASY_ADB · Database name: EASYADB

·     Choose a workload type – JSON

·     Choose a deployment type – Shared Infrastructure

5.    In the configure database section, by default the Always Free option is selected. 6.    Select the latest version.


 

7.    Provide administrator credentials and confirm “Admin” is the default administrator user. User Name – ADMIN

Password – Enter password 8.       Choose network access.


9.    Choose a license type as Bring Your Own License.



10. Provide email ID for Maintenance contact (optional). 11. Click Create Autonomous Database.

Your Autonomous Database will be provisioned in few minutes.


This completes the task of creating an Autonomous JSON Database.

 


Practice: Create a Resource Manager Stack

 

Overview

 

In this practice, you create resource manager stack.


A Stack represents definitions for a collection of EASY resources within a specific compartment. With this in mind, we're going to configure a new stack in the compartment of your choice and name it "HA Load Balanced Simple Web App". As the stack's name suggests, its configuration files define the load balancing, networking, and compute resources to deploy the target architecture plus an HTTP server.

 

Tasks

 

1.    Log into your Oracle Cloud account

2.    Terminate any existing compute instances and then continue with this practice. 3.      In the EASY Console, navigate to Menu > Developer Services > click Stacks.

4.    Click Create Stack.

5.    Select My Configuration, choose the .ZIP FILE button, click Browse link and select the terraform configuration zip file orm-lbass-demo.zip. Click Select.

·      Name: HA Load Balanced Simple Web App

·      Description: Provisions a primary load balancer and a failover load balancer into public subnets distributing load across two compute instances hosting a simple web app application

·      Create in Compartment: Select an existing compartment. ·   Terraform Version: Select 0.14.x

6.    Click Next.

 

7.    Configure Variables: Configure the variables for the infrastructure resources that this stack will create when you run the apply job for this execution plan.


·      Select a Flex Load Balancer with Minimum and Maximum Bandwidth: 10Mbps for both minimum and maximum bandwidth

·      Select Compute Shape: VM.Standard.E2.1.Micro

 

·      Select Availability Domain: Pick one Availability Domain

 

·      SSH Key Configuration: Upload the SSH key created earlier

 


8.    Virtual Cloud Network Configuration: · Enter your VCN Name: vcn01

·      Enter your CIDR Block: 10.0.0.0/16

 

·      Enter your Subnet Name: subnet 9.  Click Next.

Verify your configuration variables. 10. Click Create.

11. Now, execute Jobs: Plan & Apply.

12. Click Plan on the Stack Details Page. 13. Enter name for the plan and click Plan.

You will get a Succeeded message on the Plan Job details page. 14. Now go back to the Stacks Details page and click Apply.

15. Provide the name and select the plan created in previous steps and click Apply. 16. Once the Apply action is complete and succeeded, check the resources created.

17. Check the compute instances Web-Server-01 and Web-Server-02 should have been created and VCN vcn01.

If you want to delete the resources, go to the Stacks Details page and click Destroy to destroy the created resources.

This completes the practice for Resource Manager.

 

 

Oracle Cloud Infrastructure (OCI) Tutorial for Beginners

 Oracle Cloud Infrastructure (OCI) Tutorial for Beginners


Presentation by:

www.EasyReliable.COM

Phone:  +080-41156843/+91 9606734482

Email:  easyreliable@gmail.com/support@easyreliable.com

Website: http://www.easyreliable.com

 

l  Cloud Over Overview

l  Oracle Cloud Over Overview

l  OCI Key Concepts and Terminology

l  Identify and Access Management

l  Networking - VCN, FastConnect, Load Balancer

l  Storage Services(Local NVMe,Block,Object Storage etc)

l  Oracle Database on OCI

l  Autonomous Database



Cloud Overview

Three primary models of cloud computing typically implemented as services are Infrastructure, Platform, and Software as a Service—or IaaS, PaaS and SaaS.

•   IaaS   A collection of servers, storage, and network infrastructure onto which you deploy your platform and software. This is most akin to provisioning your own hardware in an on-premises data center. Teams of hardware engineers, storage specialists, network specialists, system administrators, and database administrators are usually involved in installing and configuring on-premises infrastructure. With IaaS, no hardware engineers or storage specialists are required. A good cloud architect (like you) is all that is required to design and provision this infrastructure. The cloud vendor provides the hardware engineers and storage specialists.

•   PaaS   A collection of one or more preconfigured infrastructure instances usually provided with an operating system, database, or development platform onto which you can deploy your software. The primary benefit of PaaS is convenience as the cloud vendor provides and supports the underlying infrastructure and platform. A subset of PaaS is Database as a Service (DBaaS).

 SaaS   Applications are deployed on a cloud and all you do is access them through your browser. These could range from webmail to complex ERP and BI Analytic systems.

Oracle Cloud encompasses the Oracle Public Cloud, which represents a collection of infrastructure, platforms, and applications exposed as services on cloud.oracle.com. 

 

Oracle Cloud is a cloud computing service offered by Oracle Corporation providing servers, storage, network, applications and services through a global network of Oracle Corporation managed data centers. The company allows these services to be provisioned on demand over the Internet.

Oracle Cloud provides Infrastructure as a Service (IaaS), Platform as a Service (PaaS), Software as a Service (SaaS), and Data as a Service (DaaS). These services are used to build, deploy, integrate, and extend applications in the cloud. This platform supports numerous open standards (SQL, HTML5, REST, etc.), open-source applications (Kubernetes, Hadoop, Kafka, etc.), and a variety of programming languages, databases, tools, and frameworks including Oracle-specific, Open Source, and third-party software and systems

 

 Regions and Availability Domains

Oracle Cloud Infrastructure is physically hosted in regions and availability domains. A region is a localized geographic area, and an availability domain is one or more data centers located within a region . A region is composed of one or more availability domains.

Oracle Cloud Infrastructure resources are either region-specific, such as a virtual cloud network, or availability domain-specific, such as a compute instance.

 Availability domains are isolated from each other, fault tolerant, and very unlikely to fail simultaneously or be impacted by the failure of another availability domain.

 When you configure your cloud services, use multiple availability domains to ensure high availability and to protect against resource failure.

Be aware that some resources must be created within the same availability domain, such as an instance and the storage volume attached to it

  

Currently Oracle operate in 16 region .This include 11 commercial region and 5 government region. These region is inter connected with azure as well

OCI Key Concepts and Terminology

 

• A tenancy is synonymous with your cloud account and comprises a hierarchy of compartments with the root compartment at the top. There can be many compartments, and as of this writing, compartments may have child compartments nested six levels deep. The below Figure lists the root compartment (RC) along with three nested or child compartments (subcompartments) named Lab, Managed Services, and Managed Compartment ForPaaS

•       Compartments :Compartments allow you to organize and control access to your cloud resources. A compartment is a collection of related resources (such as instances, virtual cloud networks, block volumes) that can be accessed only by certain groups that have been given permission by an administrator. A compartment should be thought of as a logical group and not a physical container. When you begin working with resources in the Console, the compartment acts as a filter for what you are viewing. When you sign up for Oracle Cloud Infrastructure, Oracle creates your tenancy, which is the root compartment that holds all your cloud resources. You then create additional compartments within the tenancy (root compartment) and corresponding policies to control access to the resources in each compartment. When you create a cloud resource such as an instance, block volume, or cloud network, you must specify to which compartment you want the resource to belong. Ultimately, the goal is to ensure that each person has access to only the resources they need.

•       Users :An OCI user is an individual or system that requires access to OCI resources. There are three types of users:

1.        Local users

2.        Federated users

3.       Provisioned (or synchronized) users

 

•       Local users are created and managed in OCI’s IAM service. Local users can only access OCI services. For example, user Jason is created using OCI’s IAM service by navigating to Identity | Users and selecting Create User. After providing a name and description and choosing Create, a new local user is created. This user has a local password and, by default, is capable of logging in to the OCI console. When the tenancy is provisioned, the administrator receives a customized URL for your cloud account and a base URL, as in these examples:When you connect to the console using either of these URLs (explicitly specifying the tenancy when using the latter URL), you will be challenged for an OCI username and password. Once these credentials are provided, you sign in to the console with your local user.

•       Federated users are created and managed in an identity provider outside of OCI’s IAM service such as Microsoft Active Directory or Oracle Identity Cloud Service (IDCS). The identity provider discussed from here on will be IDCS, but the principles discussed next apply to other identity providers as well.

 

 

 •       Provisioned users are automatically created in OCI’s IAM service based on federated users in an identity provider. A provisioned user does not exist without a corresponding federated user. If your tenancy has been federated to another identity provider and you attempt to access the OCI console using the preceding URLs, you will be prompted to either use a single sign-on (SSO) credential or to specify your local username and password. Provisioned users allow federated users to sign in to the OCI console using a password managed by their identity provider

•       Groups :OCI users are organized into groups. A user may belong to many groups. When your OCI account is created, a default Administrators group is created. The Administrators group initially has a single member—the user that was created when the tenancy was provisioned. As an administrator, you may create additional administrator users and add them to this group or create other groups for duty separation. The administrator users have complete control over all resources in the tenancy so access to this group should be tightly regulated. It is good practice to set up groups for teams of users who perform similar work.

•       Policies :Policies that determines how groups of users interact with OCI resources that are grouped into compartments. You may want the HR application administrators to manage all resources in a compartment dedicated to the HR department: Allow group HR Admins to manage all-resources in compartment HR.This policy statement expressed in simple language is all that is required to authorize the users that belong to the HR Admins group to manage all resources in the HR compartment. The manage verb is the most powerful and includes all permissions for the resource. The policy statements are submitted as free-form text. As of this writing, there is no tool provided to assist with constructing these policy statements.

•       Virtual Cloud Network (VCN) :A virtual cloud network is a virtual version of a traditional network—including subnets, route tables, and gateways—on which your instances run. A cloud network resides within a single region but includes all the region's availability domains. Each subnet you define in the cloud network can either be in a single availability domain or span all the availability domains in the region (recommended). You need to set up at least one cloud network before you can launch instances. You can configure the cloud network with an optional internet gateway to handle public traffic, and an optional IPSec VPN connection or FastConnect to securely extend your on-premises network.

•       A Load Balancer (LB) is a network device you may provision that receives incoming traffic on an IP address and routes the traffic to one or more underlying instances. The OCI LB service is a regional service that distributes traffic to instances either within the same availability domain or across multiple availability domains.

•       The protocol and ports being serviced by an LB are specified in an entity called the Listener. When creating an LB, you specify the VCN in which incoming traffic is accepted as well as whether it will be a private or public LB. You also choose the shape of the LB, which limits the speed at which network traffic is routed. LBs are commonly used to support high availability and scaling out of web servers.

•        LBs distribute traffic to backend servers based on a set of policies known as    a backend set. Routing algorithms, including Weighted Round-Robin, IP Hash, and Least Connections, are specified when creating the backend set.

 

•       FastConnect : which provides a dedicated, high-speed, private connection between OCI and your existing on-premises infrastructure. FastConnect requires that you must be either collocated with Oracle in a FastConnect location or that you connect through a third-party FastConnect provider that is already connected to Oracle

•       Compute :When you provision a compute instance, you can choose a virtual machine (VM) or a bare-metal (BM) server. Bare-metal servers provide your instance with exclusive use of the hardware. Not sharing hardware with other instances comes at a cost and bare-metal instances are more expensive that similarly sized virtual machines. BM servers are only available with a much higher CPU and memory footprint than entry-level VMs.

•       Instance :An instance is a compute host running in the cloud. An Oracle Cloud Infrastructure compute instance allows you to utilize hosted physical hardware, as opposed to the traditional software-based virtual machines, ensuring a high level of security and performance.

 

•       Path Route Sets specify a set of rules to route requests to different backend sets but this is optional and is only used if this level of sophistication is necessary. Finally, backend sets reference one or more hostnames, which are the target compute instances, which may be running a web server.

•       Domain Name Service :OCI also provides a Domain Name Service (DNS) that lets you create and manage DNS zones, add records to zones, and allow the VCN to resolve DNS queries from your on-premises domain and vice versa. One of the primary services DNS provides is hostname resolution. For example, it is DNS that allows you to connect to http://cloud.oracle.com instead of http://23.9.97.203. This abstraction provides network resiliency to underlying network changes.

•       Dynamic Routing Gateway and FastConnect :Connecting your existing on-premises infrastructure with your OCI VCN is a common step in the journey to OCI. This connectivity is enabled from OCI using a Dynamic Routing Gateway (DRG) that connects to an on-premises router created in OCI as Customer Premises Equipment (CPE). Your on-premises network is then bridged to your VCN using an encrypted IPSec VPN tunnel.

•       Resources :Typical on-premises IT infrastructure resources include servers, SANs, and network infrastructure. OCI infrastructure resources have a parallel definition and refer to artifacts, including compute instances, block storage volumes, object storage buckets, file system storage, virtual cloud networks (VCNs), load balancers, and Dynamic Routing Gateways.

•       OCI resources are categorized by resource-types. An individual resource-type is the most granular and includes vcn, subnet, instance, and volume resources. Individual resource-types are grouped into family resource-types such as virtual-network-family, instance-family, and volume-family. Resource-types may also be referenced as an aggregation of all resources at both compartment and tenancy levels as all-resources. These resource-types are important for defining resource management policies.

•       Bare Metal Host : Oracle Cloud Infrastructure provides you control of the physical host (“bare metal”) machine. Bare metal compute instances run directly on bare metal servers without a hypervisor. When you provision a bare metal compute instance, you maintain sole control of the physical CPU, memory, and network interface card (NIC).You can configure and utilize the full capabilities of each physical machine  as if it were hardware running in your own data center. You do not share the physical machine with any other tenants.

 

•        Shape: In Compute, the shape specifies the number of CPUs and amount of memory allocated to the instance. Oracle Cloud Infrastructure offers shapes to fit various computing requirements.. In Load Balancing, the shape determines the load balancer's total pre-provisioned maximum capacity (bandwidth) for ingress plus egress traffic. Available shapes include 100 Mbps, 400 Mbps, and 8000 Mbps

.

•       Key Pair :A key pair is an authentication mechanism used by Oracle Cloud Infrastructure. A key pair consists of a private key file and a public key file. You upload your public key to Oracle Cloud Infrastructure. You keep the private key securely on your computer. The private key is private to you, like a password. Key pairs can be generated according to different specifications. Oracle Cloud Infrastructure uses two types of key pairs for specific purposes:

•       Instance SSH Key pair: This key pair is used to establish secure shell (SSH) connection to an instance. When you provision an instance, you provide the public key, which is saved to the instance's authorized key file. To log on to the instance, you provide your private key, which is verified with the public key.

•       API signing key pair: This key pair is in PEM format and is used to authenticate you when submitting API requests. Only users who will be accessing Oracle Cloud Infrastructure via the API need this key pair.

•       Image :The image is a template of a virtual hard drive that defines the operating system and other software for an instance, for example, Oracle Linux. When you launch an instance, you can define its characteristics by choosing its image. Oracle provides a set of images you can use. You can also save an image from an instance that you have already configured to use as a template to launch more instances with the same software and customizations.

•       Storage :Once your compute instance is provisioned, it will have a boot volume and usually no other storage. Four storage types are available on OCI:

•        Block volumes

•       Object storage

•       Archive storage

•        File storage

.

Managing Tags and Tag Namespaces :Tagging is a service available to all OCI tenants by default. Tagging in not an IAM concept but is being discussed here to encourage the best practice of tagging your resources in a planful manner. As your OCI estate expands, resource sprawl is inevitable and tagging from the beginning is a great way to remain organized and in control of your OCI resources.

A tag is simply a key-value pair that you associate with a resource. There are two types of tagging: free-form and defined tags.

1) Free-Form Tags

Free-form tags are limited and offer a pretty basic form of tagging. You can apply as many tags as you want to a resource, but there is a 5-kilobyte JSON limitation on all applied tags and their values per resource.

2) Defined Tags

Defined or schema tagging is the recommended enterprise-grade mechanism for organizing, reporting, filtering, managing, and performing bulk actions on your OCI resources.

Defined tags rely on a tenant-wide unique namespace that consists of tag keys and tag values. The tag namespace serves as a container for use with IAM policies.

Networking - VCN, FastConnect, Load Balancer

 

CIDR : The dominant version of network addressing is Internet Protocol version 4 (IPv4). There is a growing prevalence of IPv6 addressing, but the de facto standard remains IPv4 addressing. In the early days of the Internet (1981–93), the 32-bit IPv4 address space was divided into address classes based on the leading four address bits and became known as classful addressing.

The class A address space accommodated 128 networks with over 16 million addresses per network while the class B address space accommodated 16,384 networks with 65,536 addresses per network;

finally, the class C address space accommodated over 2 million networks with 256 addresses per network.

 Class A network blocks are too large and class C network blocks are too small for most organizations so many class B network blocks were allocated although they were still too large in most cases. Classful addressing was wasteful and accelerated the consumption of available IP addresses. To buy time before the IP exhaustion problem manifests, a new scheme known as Classless Inter-Domain Routing (CIDR) was introduced in 1993.

 

CIDR notation is based on an IPv4 or IPv6 network or routing prefix separated by a slash from a number indicating the prefix length. OCI networking uses IPv4 addressing so the address length is 32 bits.

Consider the block of IPv4 addresses specified with the following CIDR notation: 192.168.0.1/30.

CIDR notation may be divided into two components, a network identifier and a host address space. The network identifier is represented by the number of bits specified by the network prefix. The second part is the remaining bits that represent the available IP address space. The routing or network prefix is 30, which means that 30 of the 32 bits in this address space are used to uniquely identify the network while 2 bits are available for host addresses.

In binary, 2 bits let you represent 00, 01, 10 and 11. Therefore, four addresses are available in the host address space.

CIDR notation allows you to calculate the IP address range, the netmask, and the total number of addresses available for host addresses. The netmask, also known as a subnet mask, may be derived from the CIDR notation as follows:

1.   Convert the IP address part to binary notation, with 8-bit parts (octets).

2.   Take the leading bits from 1 to the network prefix and convert these bits to ones.

3.   Convert the remaining bits to zeroes.

4.   Convert the resultant binary string to decimal format.