Skip to content

LAB 10 ‐ Instance Creation

DevWithNehaCloud edited this page May 9, 2026 · 19 revisions

💻 Instance in OCI

📌 What is an Instance?

An instance in Oracle Cloud Infrastructure is a virtual server (compute resource) that runs applications in the cloud.

It provides the necessary computing power such as CPU, memory, storage, and networking—just like a physical computer.

🧠 Simple Definition

An instance is a virtual machine in OCI used to run applications and workloads in the cloud.

⚙️ Key Components of an Instance

🧠 CPU (Processor) – Executes tasks

💾 Memory (RAM) – Runs applications

💽 Storage – Stores data (boot volume, block storage)

🌐 Network – Connects using public/private IP

🔹 Types of Instances

Virtual Machine (VM)

Runs on shared hardware

Cost-effective and flexible

Bare Metal Instance Dedicated physical server High performance and full control 🧾 Example

You create an instance in Oracle Cloud Infrastructure and:

Install Linux or Windows Deploy a web server (Apache/Nginx) Access it via SSH or RDP

👉 It works like your own server hosted in the cloud.

🧠 Real-Life Analogy

An instance is like renting a computer online instead of buying one physically.

🚀 Why Use Instances? No need for physical hardware Easy to scale (increase CPU/RAM) Pay-as-you-go pricing High availability

✅ Short Definition (Exam Ready)

In OCI, an instance is a virtual server that provides compute resources to run applications in the cloud.

⚙️ Capacity Types in OCI (Expanded)

1️⃣ On-Demand Capacity

  • Standard default option
  • Always available when you launch

👉 Example:
Production web server (must not stop)


2️⃣ Preemptible Capacity

  • Low-cost but can be terminated anytime

👉 Example:
Batch jobs, background processing that can restart if interrupted.


3️⃣ Reserved Capacity (Capacity Reservation)

  • You reserve capacity in advance
  • Ensures resources are available when needed

👉 Example:
Planning a big app launch → reserve instances beforehand


4️⃣ Dedicated Capacity (Dedicated VM Host)

  • Physical server reserved for your use only
  • No sharing with other tenants

👉 Example:
Compliance or security-sensitive applications


⚙️ Capacity Types in OCI

Type Availability Cost Use Case
On-Demand High Medium General workloads
Preemptible Low Low Fault-tolerant jobs
Reserved Capacity Guaranteed Planned Predictable workloads
Dedicated Host Exclusive High Security/compliance

🧠 Simple Understanding

On-Demand → Use anytime

Preemptible → Cheap but risky

Reserved → Pre-book resources

Dedicated → Full hardware control

⚠️ Important Note

In exams or docs:

Sometimes only On-Demand + Preemptible are called “capacity types” Others (Reserved & Dedicated) are considered capacity options/features

✅ Short Definition

In OCI, capacity types define how compute resources are allocated, including On-Demand, Preemptible, Reserved Capacity, and Dedicated Hosts, each offering different levels of availability, cost, and control.

NOTE:-you cannot select multiple Availability Domains (ADs) for a single instance in Oracle Cloud Infrastructure.

🧠 Simple Explanation AD = Data center

Instance = Server

A single server cannot physically exist in multiple data centers at the same time.

🔄 What if you need high availability?

Instead of one instance in multiple ADs, you should:

✅ Recommended Approach Create multiple instances Place them in different ADs Use: Load Balancer Auto Scaling

👉 This ensures:

High availability Fault tolerance 🧾 Example Instance-1 → AD-1 Instance-2 → AD-2 Load Balancer distributes traffic

If AD-1 fails → AD-2 still works ✅

✅ Short Definition

In OCI, a single instance can be deployed in only one Availability Domain. To achieve high availability, multiple instances must be deployed across different ADs.

Vendor Lock-in: Understanding Cloud Dependency

Vendor Lock-in is the risk where a customer becomes dependent on a vendor for products and services, unable to switch to another vendor without substantial switching costs or Vendor Lock-in occurs when an organization’s infrastructure, applications, or data become so tightly integrated with a specific cloud provider's proprietary APIs, services, and architecture that switching to another provider (like AWS or Azure) becomes economically or technically prohibitive.

Why it happens in OCI:

  • Proprietary Services: Using OCI-exclusive tools (like OCI Autonomous Database) that lack direct, compatible equivalents in other clouds.
  • API Coupling: Writing application code that directly calls OCI-specific APIs for identity, storage, or messaging.
  • Data Gravity: When the sheer volume of data stored in OCI makes the cost and time of moving that data to another provider unsustainable.

How to mitigate (The Architect's Approach):

  • Use Open Standards: Use open-source databases (like PostgreSQL) instead of proprietary ones when possible.
  • Containerization: Use Kubernetes (OKE). Since Kubernetes is a standard, a containerized app can be moved from OCI to any other cloud provider with minimal changes.
  • Infrastructure as Code (IaC): Use Terraform. Even if you change clouds, your infrastructure deployment logic stays consistent in the same language.

What is T-Shirt Sizing?

T-shirt sizing is a simple way to classify resources (like compute instances) into sizes such as:

Small (S), Medium (M), Large (L), Extra Large (XL)

Instead of using exact CPU/RAM numbers, it groups configurations into easy-to-understand categories.

T-Shirt Sizing: Capacity Planning Strategy

T-Shirt Sizing simplifies the complex process of selecting OCI VM Shapes by creating standard 'tiers' of performance.

Why we use it:

  • Speed: Faster decision-making for dev teams (e.g., "Just give me a Medium VM").
  • Budgeting: Financial teams can assign standard costs to 'Small', 'Medium', and 'Large' sizes rather than tracking thousands of unique configurations.
  • Standardization: Reduces configuration drift by ensuring all production web servers use the same 'Medium' specification.

Key Architectural Rule:

T-Shirt Sizing is not static. As your application scales, OCI’s Flexible Shapes (Flex Shapes) allow you to adjust the OCPU and RAM within that "T-shirt" category without needing to change the underlying infrastructure instance, making it a perfect match for modern OCI architecture.

OCI T-Shirt Sizing Menu (Standardized Resource Allocation)

Architects use T-Shirt sizing to standardize resource requests, making capacity planning, budgeting, and deployment significantly faster.

Size Use Case OCI VM Shape (Example) Resources
Small (S) Dev/Test, Low-traffic Web App VM.Standard.E5.Micro 1 OCPU, 1GB RAM
Medium (M) Mid-tier App, Production Web VM.Standard.E5.Flex 2 OCPU, 16GB RAM
Large (L) Heavy Database, Analytics VM.Standard.E5.Flex 8 OCPU, 64GB RAM
XL High-performance Clusters BM.Standard.E5.128 Bare Metal (128 OCPU)

Note: In OCI, we prefer using Flexible Shapes (Flex) for Medium and Large sizes, allowing us to 'Right-Size' the exact OCPU and RAM without needing to migrate to a different instance type.

What is an OCI Shape?

A Shape defines the compute capacity of your instance. It is the architectural foundation that dictates the performance ceiling of your workload.

Key Characteristics:

  • OCPU Count: Determines the processing power.
  • Memory (RAM): Determines the instance's ability to handle concurrent data processes.
  • Network Bandwidth: The throughput allocated to the instance.

Pro-Architect Tip: The Power of 'Flex Shapes'

Unlike static cloud environments, OCI Flexible Shapes allow you to dynamically adjust your OCPU and memory allocation even after the instance is running. This enables Right-Sizing, where you pay only for the exact hardware your workload requires, optimizing both performance and cost.

⚙️ OCPU vs vCPU

📌 What is OCPU?

In Oracle Cloud Infrastructure, an OCPU (Oracle CPU) represents:

1 physical CPU core = 2 hardware threads

📌 What is vCPU?

In most cloud providers (like AWS, Azure), a vCPU (virtual CPU) represents:

1 hardware thread of a CPU core

Feature OCPU vCPU
Definition 1 physical core 1 thread
Threads 2 threads 1 thread
Performance Higher Lower (per unit)

🧠 Simple Understanding

1 OCPU = 2 vCPUs

🧾 Example If you choose 2 OCPUs in OCI → 👉 You get performance similar to 4 vCPUs

🎯 Why This Matters?

Helps in comparing pricing across cloud providers Better capacity planning

✅ Short Definition

OCPU in OCI represents a full physical CPU core (2 threads), while vCPU represents a single thread of a CPU core used in other cloud platforms.

🐧 Oracle Linux vs Oracle Autonomous Linux

📌 Overview

Oracle Linux → Traditional operating system managed by users

Oracle Autonomous Linux → Self-managing OS with automation using Oracle services

🆚 Oracle Linux vs Oracle Autonomous Linux

Feature Oracle Linux Oracle Autonomous Linux
Management Manual (user-managed) Automated (self-managing)
Patching Manual updates Automatic patching (no downtime)
Security User responsibility Built-in automated security
Monitoring Manual setup Integrated monitoring & alerts
Downtime Possible during updates Near zero downtime
Automation Limited High (uses OCI automation)
Use Case Full control environments Cloud-native, low-maintenance apps

🧠 Simple Difference

Oracle Linux = You manage everything

Oracle Autonomous Linux = Oracle manages it for you automatically

🧾 Example Oracle Linux: You manually install updates, monitor system, fix issues

Oracle Autonomous Linux: System automatically patches, monitors, and secures itself

🎯 When to Use Use Oracle Linux → when you need full control

Use Autonomous Linux → when you want automation and less maintenance

✅ Short Definition

Oracle Linux is a user-managed operating system, while Oracle Autonomous Linux is a self-managing OS that automates patching, security, and monitoring in OCI.

Steps to Create an Instance

Step 1: Navigate to burger menu, select Compute and click on Instances.

image

Step 2: Click on create instance. Parent compartment should be "Hub_Compute_and_Storage_Compartment"

image image image

Step 3- In the Image section, click Change Image. Select Oracle Linux as the image (it is free in OCI, you can select the image as per your requirement).

image image

Step -4 Click on Change Shape, then select Virtual Machine. Choose the required Shape Series based on your workload. Click on the shape name to customize the configuration by selecting the appropriate number of OCPUs and Memory as per your requirement. Once the desired configuration is selected, click on Select Shape to proceed.

image image

Step -5 Click on Next. Now page moves to Networking. In Primary Network, Select "select existing virtual cloud network". (Always select public subnet in the VCN).

image image image

Step -6 In "Private IPv4 assignments, select automatically assign private IPv4 address. In Public IPv4 address assignments, enable "Automatically assign public IPv4 address"

image

Step -7 Select 'Generate a key pair for me' in the Add SSH Key section, then download and save both the (private and public) keys.

image

Step -8 Enable "Specify a custom boot volume size and performance setting" (In real time, select custom Boot and select 100 GB minimum to upgrades)

image

Step -9 Check the Estimated Cost and review all the details

image image

Step 10- Now the instance is created.

image image image

Step 11-Next, download the software PuTTY key Generator and convert the private key into .ppk format

image image

Step 12- Now we login to the server that we have created just now (Bastion-server) by using putty application and in the Host Name (IP Address) we put our public IP address

image image image image

Clone this wiki locally