OCI - Create compute instance

OCI - Create compute instance

Steps to create a compute instance in Oracle Cloud Infrastructure

Introduction

Oracle Cloud Infrastructure Compute lets you provision and manage compute hosts, known as instances. You can create instances as needed to meet your compute and application requirements. After you create an instance, you can access it securely from your computer, restart it, attach and detach volumes, and terminate it when you're done with it. Any changes made to the instance's lcal drives are lost when you terminate it. Any saved changes to volumes attached to the instance are retained.

Log in OCI Console

Access to the Oracle Cloud Infrastructure console, go to the list of services on the top-left menu and select Compute services and then click on Instances.

Create compute instance

Make sure you have selected the appropriate compartment and click on Create instance button.

Name, Compartment and Placement

Complete compute instance details:

  • Name: choose any name for your compute instance.

  • Create in compartment: the selected compartment from previous screen will be pre-selected by default. You can change the target compartment here.

  • Placement: choose the desired Availability Domain (AD) to locate the compute instance. The ADs options displayed will vary based on your OCI Region.

Platform Images and Compute Shape

An image is a template of a virtual hard drive. The image determines the operating system and other software for an instance.

The image selected by default is Oracle Linux 8 (2024.01.26 image build) in this example. Feel free to explore the list of Operating System images and versions by clicking on Change Image button. Check document OCI Compute > Platform Images for further details.

A shape is a template that determines the number of OCPUs , amount of memory, and other resources that are allocated to an instance. Compute shapes are available with AMD processors, Intel processors, and Arm-based processors.

Default shape for this example is VM.Standard.E2.1.Micro, which has an AMD processor with 1 core OCPU and 1 GB memory. This is one of the available shapes for Oracle Cloud Infrastructure's Free Tier. Check document OCI - Always Free Resources for further details.

If this shape doesn't fit your needs, you can select Ampere A1 Compute instances (Arm processor) or any other shape of your choice. The number of OCPUs and memory can be customized as well.

Configure Networking

VNIC - A virtual network interface card (VNIC), which attaches to an instance and resides in a subnet to enable a connection to the subnet's VCN. The VNIC determines how the instance connects with endpoints inside and outside the VCN. Each instance has a primary VNIC that's created during instance launch and cannot be removed.

  • VNIC name: optionally choose any name for the VNIC.

VIRTUAL CLOUD NETWORK (VCN) - A virtual, private network that you set up in Oracle data centers. It closely resembles a traditional network, with firewall rules and specific types of communication gateways that you can choose to use. A VCN resides in a single Oracle Cloud Infrastructure region and covers one or more CIDR blocks (IPv4 and IPv6, if enabled).

  • Primary network: select an existing VCN or create a new one at the moment for a specific compartment.

  • Subnet: in a similar way, select an existing subnet or create a new subnet for the selected compartment.

Finally decide the preferred Private IPv4 address assignment (automatic or manual) and whether you need a Public IPv4 address or not.

Add SSH keys

Generate an SSH key pair to connect to the compute instance using a SSH connection. You can upload a public key if you already have one. Save in a secure place the SSH key pair.

Boot volume

When you launch a virtual machine (VM) or bare metal instance based on a platform image or custom image, a new boot volume for the instance is created in the same compartment. That boot volume is associated with that instance until you terminate the instance. When you terminate the instance, you can preserve the boot volume and its data.

Leave default values, all options unchecked. Check OCI - Boot Volumes for further details.

Provisioning compute instance

After providing all the details for the compute instance, click Create button to start provisioning the instance.

A new page with the Instance details is shown and some minutes later the instance State will change from PROVISIONING (orange) to RUNNING (green).

Congratulations! Your brand new virtual machine running in Oracle Cloud is now available. Use its Public IP and the SSH key pair to connect to the compute instance.

References