Sei sulla pagina 1di 20

19/05/2016 Creating a Single Instance Using the Oracle Compute Cloud Service Web Console

Creating a Single Instance Using the Oracle
Compute Cloud Service Web Console

Before You Begin

Purpose

This tutorial shows how to create an instance in Oracle Compute Cloud Service. In this tutorial, you'll
create an instance by using an Oracle­provided Oracle Linux image and boot the instance from a
persistent disk. After creating the instance, you’ll also set up a security rule to enable HTTP access to
the instance on port 80.

Time to Complete

30 minutes

Background

You can use Oracle Compute Cloud Service to rapidly provision virtual machines with the necessary
storage and networking resources.

What Do You Need?

To perform the steps in this tutorial, you must have a subscription to Oracle Compute Cloud Service.
You must be a user with the  Compute_Operations  roles. For more information, see How to Begin
with Oracle Compute Cloud Service Subscriptions (http://www.oracle.com/pls/topic/lookup?
ctx=stcomputecs&id=GUID­51C7D6D3­6366­407D­86EE­097BA6BA2A39) in Using Oracle Compute
Cloud Service.

One of the following tools for generating SSH key pairs:

On Windows: PuTTY (http://www.putty.org (http://www.putty.org))

On UNIX or UNIX­like machines: The  ssh­keygen  utility. Many UNIX and UNIX­like installations


already include  ssh­keygen . To see if you have it, run the  ssh­keygen  command. If it isn't
available, then obtain OpenSSH from http://www.openssh.com/portable.html
http://www.oracle.com/webfolder/technetwork/tutorials/obe/cloud/compute­iaas/creating_an_instance_using_the_web_console/creating_an_instance_using_the… 1/20
19/05/2016 Creating a Single Instance Using the Oracle Compute Cloud Service Web Console
available, then obtain OpenSSH from http://www.openssh.com/portable.html
(http://www.openssh.com/portable.html).

Process Overview

To create an Oracle Compute Cloud Service instance and set up HTTP access to the instance, you
must complete the following tasks:

1. Generate an SSH key pair on your local system.
2. Upload the SSH public key to Oracle Compute Cloud Service.
3. Reserve a public IP address for your instance.
4. (Optional) Create storage volumes to boot the instance from, or to store your data and applications.
5. Create your instance, associate a public IP address with it, configure it for SSH access, and attach the
storage volumes that you created, if any.
6. (Optional) Configure the instance for HTTP access.

After creating the instance, you'll log in to it by using your SSH private key.

Generating an SSH Key Pair

When you create your Oracle Compute Cloud Service instance, you must provide an SSH public key
that will be used for authentication when you log in to the instance. Generate your SSH key pair and
upload the SSH public key to the Oracle Compute Cloud Service before you start to create your
instance.

Generating an SSH Key Pair on UNIX or UNIX­Like Systems Using ssh­keygen

1. Run the  ssh­keygen  command.

ssh­keygen ­b 2048 ­t rsa

2. The command prompts you to enter the path to the file in which you want to save the key. A default
path and file name are suggested in parentheses. For example:
/home/user_name/.ssh/id_rsa.

To accept the default path and file name, press Enter.

Otherwise, enter the required path and file name, and then press Enter.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/cloud/compute­iaas/creating_an_instance_using_the_web_console/creating_an_instance_using_the… 2/20
19/05/2016 Creating a Single Instance Using the Oracle Compute Cloud Service Web Console
Otherwise, enter the required path and file name, and then press Enter.

3. The command prompts you for a passphrase. Enter a passphrase.

Note that the passphrase isn't displayed when you type it in. Remember the passphrase. If you
forget the passphrase, you can't recover it.

4. When prompted, enter the passphrase again to confirm it.

The command generates an SSH key pair consisting of a public key and a private key, and saves
them in the specified path. The file name of the public key is created automatically by appending
.pub  to the name of the private key file. For example, if the file name of the SSH private key is
id_rsa , then the file name of the public key would be  id_rsa.pub.

5. Make a note of the path where you've saved the SSH key pair. When you create instances, you must
provide the SSH public key. When you log in to an instance, you must specify the corresponding
private key and enter the passphrase when prompted.

Generating an SSH Key Pair On Windows Using the PuTTY Key Generator

1. Find  puttygen.exe  in the PuTTY folder on your computer, and double­click it.

2. Accept the default key type, SSH­2 RSA, and set the Number of bits in a generated key to 2048, if
it is not already set. Then click Generate.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/cloud/compute­iaas/creating_an_instance_using_the_web_console/creating_an_instance_using_the… 3/20
19/05/2016 Creating a Single Instance Using the Oracle Compute Cloud Service Web Console

3. Move your mouse around the blank area to generate randomness. The SSH key pair is generated.

4. Save your private key.

a. The key comment is the name of the key. You can keep the generated key comment or create
your own.

b. Enter a passphrase in the Key passphrase and the Confirm passphrase fields.

Note: Remember the passphrase. You can't recover a passphrase if you forget it.

c. To save the private key in the PuTTY PPK format, click Save private key.

Enter the same name as you used for the key comment, so that you know which public key to
use this private key with. The private key is saved in PuTTY's Private Key (PPK) format, which is
a proprietary format that works only with the PuTTY toolset. You can use this key whenever you
use PuTTY for SSH.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/cloud/compute­iaas/creating_an_instance_using_the_web_console/creating_an_instance_using_the… 4/20
19/05/2016 Creating a Single Instance Using the Oracle Compute Cloud Service Web Console

5. Next, save your SSH public key.

a. In the PuTTY Key Generator, select all of the characters in the Public key for pasting into
OpenSSH authorized_keys file: field.

Note: Make sure you select all the characters, not just the ones you can see in the narrow
window. If there is a scroll bar next to the characters, you aren't seeing all the characters.

b. Right click somewhere in the selected text and select Copy from the menu.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/cloud/compute­iaas/creating_an_instance_using_the_web_console/creating_an_instance_using_the… 5/20
19/05/2016 Creating a Single Instance Using the Oracle Compute Cloud Service Web Console

c. Open a text editor and paste the characters. Ensure that you paste the text at the first character
in the text editor, and don't insert any line breaks.

d. Save the key using the same root name that you used for the private key. Add a  .pub  extension.


You can give it any extension you want, but  .pub  is a useful convention to indicate that this is a
public key.

e. Exit PuTTY Key Generator.

6. Make a note of the public and private key names and where they are saved. When you create
instances, you must specify the SSH public key. When you log in to an instance, you must provide
the path to the corresponding SSH private key and enter the passphrase when prompted.

Uploading the SSH Public Key

1. Sign in to the Oracle Cloud My Services application at https://cloud.oracle.com/sign_in
(https://cloud.oracle.com/sign_in). The My Services Dashboard page is displayed.

2. Click the   menu at the upper left corner of the page and select Oracle Compute Cloud Service.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/cloud/compute­iaas/creating_an_instance_using_the_web_console/creating_an_instance_using_the… 6/20
19/05/2016 Creating a Single Instance Using the Oracle Compute Cloud Service Web Console

The Oracle Compute Cloud Service console is displayed.

3. Click the Network tab.

4. Click SSH Public Keys in the left pane.

The SSH Public Keys page is displayed.

5. Click Add SSH Public Key.

6. In the Add SSH Public Key dialog box, enter a name and the value of the SSH public key you
generated, and then click Add.

Note: Paste the key value exactly as it was generated. Don't append or insert any extra characters,
line breaks, or spaces.

Your SSH public key is added to Oracle Compute Cloud Service.

Reserving a Public IP Address

Next, reserve a public IP address reservation. Later in this tutorial, you'll associate this IP address to
your instance when you create it.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/cloud/compute­iaas/creating_an_instance_using_the_web_console/creating_an_instance_using_the… 7/20
19/05/2016 Creating a Single Instance Using the Oracle Compute Cloud Service Web Console
your instance when you create it.

1. On the Oracle Compute Cloud Service web console, click the Network tab.

2. Click the IP Reservations tab in the left pane, and then click Create IP Reservation.

3. In the Create Public IP Reservation dialog box, enter a name for the IP address reservation, and
then click Create.

Note: Do not select an instance from the For Instance list. You'll use this IP address for the
instance that you are about to create.

Note: Make a note of this public IP address. You'll use it to access your instance using SSH later.

Creating a Bootable Storage Volume

When you create an Oracle Compute Cloud Service instance, by default, it is set up to boot from a
nonpersistent disk. To use a persistent boot disk, create a bootable storage volume. If you use a
bootable storage volume as the boot disk for an instance, then any changes that you make to the boot
disk aren't lost even when you delete the instance.

To create a bootable storage volume:

1. On the Oracle Compute Cloud Service web console, click the Storage tab, and then click Create
Storage Volume.

2. In the Create Storage Volume dialog box, select or enter the following and then click Create.

a. Name: Enter an appropriate name. For the purpose of this tutorial, enter bootable­vol­1.

b. Boot Image: Select the image that you want to use to create the bootable storage volume. For
example, select oel_6.4_20GB_x11_RE.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/cloud/compute­iaas/creating_an_instance_using_the_web_console/creating_an_instance_using_the… 8/20
19/05/2016 Creating a Single Instance Using the Oracle Compute Cloud Service Web Console

c. Size: Enter an appropriate size, in GB. For the purpose of this tutorial, enter 21.

Note: The size of the storage volume must be at least 5% larger than the selected image size.

d. Storage Property: Select storage/default.

e. Description: Enter an appropriate description. For the purpose of this tutorial, enter Bootable
Storage Volume, 20 GB.

Your storage volume is created.

(Optional) Creating Storage Volumes for Applications and Data

If you want to create separate storage volumes for your applications and data, then repeat the steps in
Creating a Bootable Storage Volume for each volume that you want to create, but don't select a boot
image.

Creating an Instance

1. On the Oracle Compute Cloud Service console, click the Instances tab, and then click Create
Instance.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/cloud/compute­iaas/creating_an_instance_using_the_web_console/creating_an_instance_using_the… 9/20
19/05/2016 Creating a Single Instance Using the Oracle Compute Cloud Service Web Console

The Create Instance wizard starts.

2. On the General page, select or enter the following information, and then click Next:

a. Name: Enter an appropriate name. If you don’t specify a name, the instance name will be
generated automatically.

b. Label: Enter a description to help identify the instance. If you provide a label, the label is used to
list the instance on the Instances page.

c. Image: Select the image that you want to use. For the purpose of this tutorial, select
/oracle/public/oel_6_2G ("OEL 6 with 2 GB disk").

d. Shape: Select an appropriate shape for your instance. The shape determines the number of
CPUs and RAM that your instance will have. For the purpose of this tutorial, select oc3 (OCPUs:
1, Memory: 7.5 GB).

e. Tags: If required, specify a tag to help identify your instance.

f. Custom Attributes: This field allows you to customize your instance by providing additional
information specific to each instance. For example, you might have specified certain scripts in the
custom machine image that you use to boot your instance. Such scripts could require instance­
specific user data. You can enter that instance­specific user data in this field, in JSON format. The
information that you enter here is stored as user data on your instance. After the instance is
created, the attributes that you specify here are available within the instance at
http://192.0.0.192/latest/userdata.

For the purpose of this tutorial, leave this field blank.

g. Manage Instance Using an Orchestration: After the instance is created, if you'd like to be able
to stop and re­create it at any time by using an orchestration, then select this check box and
enter the required details. For the purpose of this tutorial, don't select this option.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/cloud/compute­iaas/creating_an_instance_using_the_web_console/creating_an_instance_using_th… 10/20
19/05/2016 Creating a Single Instance Using the Oracle Compute Cloud Service Web Console

3. On the Network page, select the following, and then click Next:

a. DNS Hostname Prefix: Enter a string that will be used as a prefix in the domain host name for
your instance. For the purpose of this tutorial, you can leave this blank.

b. Public IP Address: Select Persistent Public IP Reservation, and from the list, select the IP
reservation that you created earlier.

c. Configure Instance for Public SSH Access: Select this option.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/cloud/compute­iaas/creating_an_instance_using_the_web_console/creating_an_instance_using_th… 11/20
19/05/2016 Creating a Single Instance Using the Oracle Compute Cloud Service Web Console

4. On the Storage page, enter the following, and then click Next:

a. If you've created a bootable storage volume and optionally also storage volumes to store
applications and data, then select the required storage volumes from the Available Storage
Volumes list and move them to the Selected Storage Volumes list. You can select only storage
volumes that are not already attached to an instance. Storage volumes that have been attached
are displayed but grayed out.

Note: This tutorial assumes that you've already created a bootable storage volume as described
earlier. If you haven't created a bootable storage volume, you can select the option to do so now.

b. If you select multiple storage volumes, re­arrange the volumes in the Selected Storage Volumes
list such that the bootable storage volume is the first volume in the list.

c. From the Boot Volume list, select the bootable storage volume that you created earlier

http://www.oracle.com/webfolder/technetwork/tutorials/obe/cloud/compute­iaas/creating_an_instance_using_the_web_console/creating_an_instance_using_th… 12/20
19/05/2016 Creating a Single Instance Using the Oracle Compute Cloud Service Web Console

5. On the SSH Public Keys page, select the following, and then click Next:

a. Select the Select Existing SSH Public Key(s) option.

b. From the Available SSH Public Keys list, select the SSH public key that you had uploaded
earlier and move it to the Selected SSH Public Keys list.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/cloud/compute­iaas/creating_an_instance_using_the_web_console/creating_an_instance_using_th… 13/20
19/05/2016 Creating a Single Instance Using the Oracle Compute Cloud Service Web Console

6. On the Review page, verify the information that you've entered and then click Create.

Your instance is created.

(Optional) Configuring the Instance for HTTP Access

Your instance is now configured to allow public access only over SSH.

To enable access to the instance over other protocols, such as HTTP or HTTPS, you must open the
required ports. In this tutorial, you'll create a security rule to enable HTTP access to your instance over
port 80.

Creating a Security List

A security list is a set of instances that can communicate with each other across all protocols and ports.
When you create a security rule, you specify a security list as a destination. This allows traffic from a
specified source (such as the public Internet) to access all the instances that are part of the destination
security list over a specified protocol and port.

To create a security list:

http://www.oracle.com/webfolder/technetwork/tutorials/obe/cloud/compute­iaas/creating_an_instance_using_the_web_console/creating_an_instance_using_th… 14/20
19/05/2016 Creating a Single Instance Using the Oracle Compute Cloud Service Web Console

1. On the Oracle Compute Cloud Service web console, click the Network tab.

2. Click the Security Lists tab in the left pane, and then click Create Security List.

3. In the Create Security List dialog box, select or enter the following information, and then click
Create.

a. Name: Enter an appropriate name. For the purpose of this tutorial, enter For­http­access.

b. Inbound Policy: Retain the default policy, Deny (Drop packets, no reply).

c. Outbound Policy: Retain the default policy, Permit (Allow packets).

d. Description: Enter a description.

Adding Your Instance to the Security List

1. On the Oracle Compute Cloud Service web console, click the Instances tab.

2. Go to the instance that you just created, and from the   menu, select View.

3. On the instance details page, click Add to Security List. Select the security list that you just
created, and then click Attach.

Your instance is added to the For­http­access security list.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/cloud/compute­iaas/creating_an_instance_using_the_web_console/creating_an_instance_using_th… 15/20
19/05/2016 Creating a Single Instance Using the Oracle Compute Cloud Service Web Console

Creating a Security Rule

When you create a security list, the instances in the security list are isolated from hosts outside the
security list. You can use security rules to override the default access settings of security lists. Each
security rule defines a source, a destination, and a protocol­port combination over which
communication is allowed.

In this tutorial, you'll set up a security rule to permit HTTP requests from hosts on the public Internet to
port 80 of the instances in the  For­http­access  security list.

To create a security rule:

1. On the Oracle Compute Cloud Service web console, click the Network tab, and then click the
Security Rules tab in the left pane.

2. Click Create Security Rule.

3. In the Create Security Rule dialog box, select or enter the following information, and then click
Create.

a. Name: Enter an appropriate name. For the purpose of this tutorial, enter Allow­http­access.

b. Status: Retain the default, Enabled.

c. Security Application: Select http.

Note: Many of the commonly­used protocol and port combinations are provided as predefined
security applications in Oracle Compute Cloud Service. However, if you wish to specify a
particular protocol­port mapping that is not predefined, you can create the required security
application in the Security Applications tab in the left pane.

d. Source: From the Security IP Lists list, select public­internet.

e. Destination: From the Destination list, select the security list that you created earlier, For­http­
access.

f. Description: Enter a description.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/cloud/compute­iaas/creating_an_instance_using_the_web_console/creating_an_instance_using_th… 16/20
19/05/2016 Creating a Single Instance Using the Oracle Compute Cloud Service Web Console

Repeat these steps if you want to create security rules to enable access to instances using other
protocols and ports, or if you want to specify a different source or destination.

Logging In to Your Instance Using SSH

Logging In from a UNIX or UNIX­Like Host

1. Enter the following command:

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

Note: If you don't know the public IP address of your instance, you'll find it on the Instances page of
the Oracle Compute Cloud Service console.

2. When prompted, enter the passphrase you had provided for your SSH key pair.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/cloud/compute­iaas/creating_an_instance_using_the_web_console/creating_an_instance_using_th… 17/20
19/05/2016 Creating a Single Instance Using the Oracle Compute Cloud Service Web Console

Logging In from a Windows System

1. Start PuTTY.

The PuTTY Configuration window is displayed, showing the Session panel.

2. In the Host Name (or IP address) field, enter the public IP address of your instance.

Note: If you don't know the public IP address of your instance, you'll find it on the Instances page of
the Oracle Compute Cloud Service console.

3. In the Connection type: field, select SSH if it is not already selected.

4. In the Category pane, expand Connection, and then click Data.

The Data panel is displayed.

5. In the Auto­login username field, enter opc.

Confirm that the When username is not specified option is set to Prompt.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/cloud/compute­iaas/creating_an_instance_using_the_web_console/creating_an_instance_using_th… 18/20
19/05/2016 Creating a Single Instance Using the Oracle Compute Cloud Service Web Console

6. In the Category pane, expand SSH, and then click Auth.

The Auth panel is displayed.

7. In the Private key file for authentication field, click Browse and select the private key file that you
saved earlier.

Log in to your instance using PuTTY

8. In the Category tree, click Session.

The Session panel is displayed.

9. In the Saved Sessions field, enter a name for this connection configuration, and then click Save.

10. Click Open to open the connection.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/cloud/compute­iaas/creating_an_instance_using_the_web_console/creating_an_instance_using_th… 19/20
19/05/2016 Creating a Single Instance Using the Oracle Compute Cloud Service Web Console

The PuTTY Configuration window is closed and the PuTTY window is displayed.

11. Enter the passphrase you had provided for your SSH key pair.

12. The first time you connect to your instance, the PuTTY Security Alert window is displayed, prompting
you to confirm the public key. Click Yes to continue.

Want to Learn More?

Managing Oracle Compute Cloud Service Instances (http://www.oracle.com/pls/topic/lookup?
ctx=stcomputecs&id=GUID­4890B36C­D8E3­4B16­A414­9F57FC2DF043) in Using Oracle Compute
Cloud Service

Managing Storage Volumes (http://www.oracle.com/pls/topic/lookup?ctx=stcomputecs&id=GUID­
93ABE622­B6F0­4A95­A191­53BD69455B16) in Using Oracle Compute Cloud Service

Configuring Network Settings (http://www.oracle.com/pls/topic/lookup?ctx=stcomputecs&id=GUID­
F0D4C038­980D­4641­8715­F6C699A65871) in Using Oracle Compute Cloud Service

Credits

Lead Curriculum Developer: Anamika Mukherjee

About Oracle (http://www.oracle.com/corporate/index.html)   Contact Us (http://www.oracle.com/us/corporate/contact/index.html)
Legal Notices (http://www.oracle.com/us/legal/index.html)   Terms of Use (http://www.oracle.com/us/legal/terms/index.html)
Your Privacy Rights (http://www.oracle.com/us/legal/privacy/index.html)
Copyright © 2015, 2016, Oracle and/or its affiliates. All rights reserved.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/cloud/compute­iaas/creating_an_instance_using_the_web_console/creating_an_instance_using_th… 20/20

Potrebbero piacerti anche