Lab : 38 create an application instance in public network from custom image - TanveeKhanDB/OCI GitHub Wiki

What is custom img in OCI

In Oracle Cloud Infrastructure (OCI), a Custom Image is a snapshot of a configured virtual machine (Compute Instance) that you save and reuse to create new instances.

Example

Suppose you have a server with:

  • Oracle Linux installed
  • Apache web server configured
  • Application code deployed
  • Security settings and patches applied

Instead of configuring every new server from scratch, you create a Custom Image of that server and launch new instances from it.

Benefits of Custom Images

Faster Deployment New servers are created with all software and settings already installed.

Consistency Every server has the same configuration, reducing setup errors.

Time Savings No need to repeatedly install packages or configure applications.

Disaster Recovery Quickly recreate a server if the original instance fails.

Scalability Easily launch multiple identical servers for load balancing or high availability.

Workflow

What is hardened server in OCI

A hardened server is a server that has been securely configured and optimized to reduce vulnerabilities and protect against unauthorized access or attacks. In OCI, hardening is commonly performed before creating a custom image so that all future instances inherit the same secure configuration.

Step to create custom img for resuce in OCI:

Step:01

Prior to creating a custom image, ensure that all necessary applications, software packages, and system configurations are installed and properly set up on the source instance. This guarantees that any new instance launched from the custom image will have the same pre-configured environment, minimizing manual configuration efforts and ensuring consistency across all deployments.

sudo yum install -y curl zip telnet httpd

It will install the req software in our existing instance (Master_Server)

Verfiy the installed application:

yum list installed httpd curl telnet unzip firewalld

It will show all the insatalled packed in our existing instance.

Step:02

Creating custome img from the existing instance via OCI Console:

Note: While creating img insance will not be available for that moment later on it will back to online

Step:03 Creating a new instance Derived_Server using the custom img:

Step:04 Checing if all the pre install software packeg is availble in new (Derived_Server)

Login into Derived_Server via putty and run below command

yum list installed httpd curl telnet unzip firewalld