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.
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(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.
No comments:
Post a Comment