Before You Begin
Purpose
This tutorial shows how to create a Compute Classic instance using a CentOS Linux 7 machine image provided by CentOS.
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 CentOS-provided Linux image:
- Download the image from the CentOS web site.
- Upload the image to Oracle Cloud Infrastructure Object Storage Classic.
- Register the image in Compute Classic.
- Create an instance using the image.
- Create storage volumes and attach them to the instance.
- 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.
- The CentOS Linux 7 image (
tar.gz
file) that you want to use must be available on the host from which you'll access the web console of Compute Classic.To download the CentOS Linux 7 image:
- Go to http://cloud.centos.org/centos/7/images.
- Look for the Oracle Cloud images.
Typically, the Oracle Cloud images contain
OracleCloud
in the file name (example:CentOS-7-x86_64-OracleCloud.raw.tar.gz
). - Identify the image that you want to use, and download it.
- 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 CentOS Linux 7 image file that you
downloaded earlier (tar.gz
file). See Uploading Machine 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 Custom Image in Using Oracle Cloud Infrastructure Compute Classic.
Note: After the instance is
created, you can ssh
to it as the centos
user:
ssh centos@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?
- Managing Instances in Using Oracle Cloud Infrastructure Compute Classic
- Managing Storage Volumes in Using Oracle Cloud Infrastructure Compute Classic
Credits
-
Curriculum Developer: Ajay Seetharam