01 - Lab - Creating A Single Instance
01 - Lab - Creating A Single Instance
ORACLE COMPUTE
CLOUD WORKSHOP
ORACLE PLATFORM
TECHNOLOGY SOLUTIONS
Pre Requisites
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. 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. Configure the instance for HTTP access.
After creating the instance, you'll log in to it by using your SSH private key
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.
3. Move your mouse around the blank area to generate randomness. The
SSH key pair is generated.
5.
6. 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/textbox.
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.
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.
7. 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.
To create an IP reservation:
1. On the Oracle Compute Cloud Service web console, click the Network tab.
2. Click the IP Reservations tile, 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.
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 ssh requests from hosts on the
public Internet to port 22 of the instances in the default 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 tile.
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 DefaultSSHAccess.
b. Status: Retain the default, Enabled.
c. Security Application: Select ssh.
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 tile.
d. Source: From the Security IP Lists list, select public-internet.
e. Destination: From the Destination list, select the security list that is
already available i.e. default security list
f. Description: Enter a description DefaultSSHAccess
Creating an Instance
1. If you are not already on the Instances page, click the Instances tab.
2. Click Create Instance button.
The Create Instance wizard starts.
3. Image: On the Image page, select the image that you want to use. For the
purpose of this tutorial, select an ol_6.6*** image and then click > button
4. Shape: On the Shape page, 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)
and click on next (>) button.
5. In the instance page, select or enter the following information and click on Next
(>) button:
a. High Availability Policy: Leave it to default as Active
b. Name: You may change the auto generated name to some meaningful name. For
this lab, give name as VM-1
c. Label: Enter a label to help identify the instance. If you provide a label, the label
is used to list the instance on the Overview page. For this lab, provide label as
My-First-Instance
d. Description: (Optional) Provide some meaningful description
e. Tags: If required, specify a tag to help identify your instance. For this lab, leave
this as blank.
f. 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 lab, you can leave this blank.
g. Public IP Address: Select Persistent Public IP Reservation, and from the list,
select the IP reservation that you created earlier.
h. Security Lists: You may select the existing security list (will be shown once you
click in the text field). For the purpose of this tutorial, please select the default
security list.
i. SSH Keys: Select the SSH Public Keys that you created earlier from the list which
will be shown once you click in the text field
j. Custom Attributes: You may add the required custom attributes, if you want to
pass. For the purpose of this tutorial, you can leave this blank.
6. On the Storage page, select the following, and then click Next (>) button:
a. If you have created storage volumes to store applications and data, then
click on Attach Existing Volume and select those volumes.
Note: 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.
b. Select the bootable storage volume bootable-vol-1 from the list.
c. Also check Boot Drive option
d. Then, click on Add button
7. On the Review page, verify the information that you've entered and then click Create.
Your instance is created. Your instance is now configured to allow public access only
over SSH, and only those having the private key(e.g. rsa-key-1.ppk) will be able to
access.
Select the security list that you just created, and then click Attach.This is the
second security list attached to the instance in addition to the default
security list.
Your instance is added to the For-http-access security list.
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.
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 can find it by
going to the Instances tile on the Oracle Compute Cloud Service console and clicking
your instance to get to the details page.
3. In the Connection type: field, select SSH if it is not already selected.
Start Python Web Server and access the same from the Browser
2). Use the Public Ip of your VM instance and paste it in a new browser window.
(Click on your VM instance in the UI Web Console and note down the Public IP
address of the VM instance)
An example screenshot below :
NOTE: Your VM instance IP address will be different than the one shown in
the figure below
APPENDIX