Creating an Oracle Cloud Infrastructure Compute Classic Instance Using a Debian Image


Options



Before You Begin

Purpose

This tutorial shows how to create an Oracle Cloud Infrastructure Compute Classic instance using a Debian machine image provided by Debian.

Time to Complete

20 minutes

Background

Compute Classic is a secure, reliable, low cost, standards-based infrastructure service that you can use to rapidly provision virtual machines on Oracle Cloud, with all the necessary storage and networking resources. You can manage and scale your virtual machine topology in the cloud easily, and migrate your Oracle and third-party applications to Oracle Cloud.

Here's an overview of the process for creating a Compute Classic instance using a Debian-provided image:

  1. Build the Debian image.
  2. Upload the image to Oracle Cloud Infrastructure Object Storage Classic.
  3. Register the image in Compute Classic.
  4. Create an instance using the image.
  5. Create storage volumes and attach them to the instance.
  6. Mount the storage volumes.

What Do You Need?

  • You must be a Compute Classic user with the Compute_Operations role.

    If you don’t have the required role or aren’t sure, then ask your service administrator to ensure that you have the required role in Oracle Cloud My Services. See Managing User Roles in Managing and Monitoring Oracle Cloud.

  • You must be able to log in to the web console of Compute Classic.

    See Accessing Compute Classic Using the Web Console in Using Oracle Cloud Infrastructure Compute Classic.

  • Build the Debian image by using the bootstrap-vz bootstrapping framework, as described in the documentation at https://wiki.debian.org/Cloud/OracleComputeImage.
  • You must have the required role to upload images to Oracle Cloud Infrastructure Object Storage Classic.
    • If this is the first machine image being uploaded to Oracle Cloud Infrastructure Object Storage Classic, then you must have the Storage Administrator role.
    • If one or more machine images have previously been uploaded to Oracle Cloud Infrastructure Object Storage Classic, then any user with the Storage_ReadWriteGroup role can upload images.

    If you don’t have the required role or aren’t sure, then ask your service administrator to ensure that you have the required role in Oracle Cloud My Services. See Managing User Roles in Managing and Monitoring Oracle Cloud.

  • A replication policy must have been set for your Oracle Cloud Infrastructure Object Storage Classic account.

    If a replication policy is already set, the Set Replication Policy link in My Services would be disabled. If the Set Replication Policy link is enabled, then click it to set the policy for your account. See Selecting a Replication Policy for Your Service Instance in Using Oracle Cloud Infrastructure Object Storage Classic.

Uploading the Image to Oracle Cloud Infrastructure Object Storage Classic

Upload the Debian image file that you built earlier (tar.gz file). See Uploading Image Files to Oracle Cloud Infrastructure Object Storage Classic in Using Oracle Cloud Infrastructure Compute Classic.

Important Note: While uploading the image file, take care to specify a unique name for the target object, to differentiate the image that you're uploading from other images in Oracle Cloud Infrastructure Object Storage Classic. Also, make a note of the name that you specify. You'll need this name for the next step.

Registering the Image in Compute Classic

See Registering a Machine Image in Compute Classic in Using Oracle Cloud Infrastructure Compute Classic.

Creating an Instance Using the Image

See Creating an Instance Using a Private Image in Using Oracle Cloud Infrastructure Compute Classic.

Note: After the instance is created, you can ssh to it as the opc user:

ssh opc@public_ip_address_of_the_instance -i /path/to/private_key

Creating Storage Volumes and Attaching Them to the Instance

A storage volume is a virtual disk that provides persistent block storage space for instances in Compute Classic.

To create storage volumes, see Creating a Storage Volume in Using Oracle Cloud Infrastructure Compute Classic.

To attach storage volumes to your CentOS Linux 7 instance, see Attaching a Storage Volume to an Instance in Using Oracle Cloud Infrastructure Compute Classic.

After attaching the storage volumes, mount them as described in Mounting a Storage Volume in Using Oracle Cloud Infrastructure Compute Classic.

Want to Learn More?

Credits

  • Curriculum Developer: Anoop Srivastava