Introduction to OCI Compute Management
- Ashish Tiwari
- Jul 24, 2024
- 4 min read
Updated: 2 days ago
Oracle Cloud Infrastructure (OCI) is a set of complementary cloud services that enables you to build and run a wide range of applications and services in a highly available hosted environment. At the core of OCI is Compute, a service that provides scalable, flexible, and powerful virtual machines (VMs) and bare metal instances for various workloads. This blog will guide you through managing OCI Compute services step-by-step, including creating, configuring, and maintaining instances.
Step 1: Understanding the OCI Compute Architecture
Before diving into the management of OCI Compute, it’s essential to understand its architecture. OCI Compute provides both bare metal and virtual machine instances, offering flexibility and control.

Key Components:
Regions and Availability Domains: OCI is globally distributed across regions, each containing multiple Availability Domains (ADs). These are isolated data centers within a region ensuring high availability and fault tolerance.
Instances: These are the compute resources that you run. Instances can be virtual machines or bare metal servers.
Shapes: Defines the number of OCPUs, amount of memory, and other resources allocated to an instance.
Images: A template of a virtual hard drive that determines the operating system and initial state of the instance.
Boot Volumes: A detachable block volume device containing the image used to boot an instance.
Virtual Cloud Network (VCN): A customizable, private network in OCI where you can place your instances.
Subnets: Segments of a VCN that contain cloud resources.
Security Lists and Network Security Groups (NSGs): Provide ingress and egress rules for instances.
Step 2: Creating an OCI Compute Instance
Step-by-Step Guide:
Log in to the OCI Console: Navigate to the OCI console and log in with your credentials.
Navigate to the Compute Service: From the dashboard, select "Compute" under the "Core Infrastructure" section.
Create an Instance:
Click on "Create Instance."
Enter a name for your instance.
Select a compartment.
Choose an Availability Domain.
Select an Image:
Choose an operating system from the provided list (e.g., Oracle Linux, Ubuntu, Windows).
Choose a Shape:
Select a shape based on the required OCPUs, memory, and other resources.
Configure Networking:
Select a Virtual Cloud Network (VCN) and subnet.
Optionally, configure the public IP address.
Add SSH Keys:
Paste your SSH public key for access.
Boot Volume:
Use the default boot volume or customize the size.
Advanced Options:
Configure tags, metadata, and other advanced options if needed.
Review and Create:
Review your configuration and click "Create."
Once created, your instance will be provisioned and available for use.
Step 3: Configuring OCI Compute Instances
Accessing Your Instance:
Using SSH:
Open your terminal.
Use the SSH command to connect: ‘ssh -i <path_to_private_key> opc@<public_ip>.’
Windows Instances:
Use RDP for Windows instances by entering the public IP in the Remote Desktop Connection application.
Configuring Instance Settings:
Scaling Resources:
You can change the shape of your instance to scale resources up or down as needed.
Navigate to the instance details page and click "Actions" > "Change Shape."
Managing Boot Volumes:
Resize boot volumes through the instance details page under "Attached Resources" > "Boot Volumes."
Network Configuration:
Modify VCN and subnet settings through the networking section.
Update security rules in Security Lists or NSGs.
Step 4: Monitoring and Maintaining OCI Compute Instances
Monitoring Tools:
OCI Monitoring Service:
Use built-in metrics to monitor instance performance.
Access metrics from the instance details page under "Monitoring" > "Metrics."
Logging:
Enable and configure logging to track instance activities.
Access logs from the "Logging" service in the console.
Instance Maintenance:
Backup and Recovery:
Create snapshots of boot volumes for backup.
Use the "Backups" section to schedule and manage backups.
Software Updates:
Regularly update the operating system and installed software.
Use package managers like yum, apt, or Windows Update.
Instance Lifecycle Management:
Start, stop, reboot, or terminate instances as needed from the instance details page.
Use instance pools for managing multiple instances simultaneously.
Step 5: Automating OCI Compute Management
OCI CLI:
Install and configure the OCI Command Line Interface (CLI) for automating tasks.
Example command to create an instance:
oci compute instance launch --compartment-id <compartment_ocid> --availability-domain <ad_name> --shape <shape> --display-name <instance_name> --image-id <image_ocid>
Terraform:
Use Terraform scripts to define and provision OCI resources.
Example Terraform configuration for an instance:
provider "oci" {
tenancy_ocid = "<tenancy_ocid>"
user_ocid = "<user_ocid>"
fingerprint = "<fingerprint>"
private_key_path = "<private_key_path>"
region = "<region>"
}
resource "oci_core_instance" "example_instance" {
availability_domain = "<ad_name>"
compartment_id = "<compartment_ocid>"
shape = "<shape>"
create_vnic_details {
subnet_id = "<subnet_ocid>"
}
source_details {
source_type = "image"
source_id = "<image_ocid>"
}
}
Managing OCI Compute resources effectively requires a good understanding of its architecture and services. By following the steps outlined in this guide, you can create, configure, monitor, and maintain your OCI Compute instances with ease. Automation tools like OCI CLI and Terraform further simplify the management process, making it easier to scale and adapt to changing requirements.
References
Terraform OCI Provider Documentation
Disclaimer
The information provided in this blog is for educational purposes only. Oracle Cloud Infrastructure (OCI) services are subject to change, and it is recommended to refer to the official Oracle documentation for the most up-to-date information.
By following this guide, you should be well on your way to efficiently managing your OCI Compute resources. Happy computing!
Commentaires