Oracle Compute Cloud – Uploading My Image – Part Two – Linux 7

Patrick Roozen 4
0 0
Read Time:3 Minute, 51 Second

In this sequel of part one I will show how you can upload your own (Oracle) Linux 7 image in the IAAS Cloud of Oracle. This post will use the lessons learnt by using AWS which I described here.

The tools used are: VirtualBox, Oracle Linux 7, Oracle IAAS Documentation and lots of time.

With Oracle as Cloud provider it is possible to use the UEKR3 or UEKR4 kernels in your image that you prepare in VirtualBox. There is no need to temporarily disable the UEKR3 or UEKR4 repo’s in your installation. I reused the VirtualBox VM that I’d prepared for the previous blog: AWS – Build your own Oracle Linux 7 AMI in the Cloud.

The details:

The main part here is (again) making sure that the XEN blockfront en netfront drivers are installed in your initramfs. There are multiple ways of doing so. I prefer changing dracut.conf.

 # additional kernel modules to the default
 add_drivers+="xen-blkfront xen-netfront"

You could also use:

rpm -qa kernel | sed 's/^kernel-//'  | xargs -I {} dracut -f --add-drivers 'xen-blkfront xen-netfront' /boot/initramfs-{}.img {}

But it is easy to forget to check if you need to rebuild your initramfs after you have done a: “yum update”. I know, I have been there…

The nice part of the Oracle tutorial is that you can minimize the size you need to upload by using sparse copy etc. But on Windows or in Cygwin that doesn’t work. Nor on my iMac. Therefore I had to jump through some hoops by using an other VirtualBox Linux VM that could access the image file and make a sparse copy, create a tar file and copy it back to the host OS (Windows or OSX).

Then use the upload feature of Oracle Compute Cloud or Oracle Storage Cloud to be exact.

Tip: If you get errors that your password isn’t correct (like I did) you might not have set a replication policy. (See the Note at step 7 in the documentation link).

Now you can associate your image file, which you just uploaded, to an image. Use a Name and Description that you like:

2017-07-14 17_54_30-Oracle Compute Cloud Service - Images

Then Press “Ok” to have the image created, and you will see messages similar to these on your screen:

2017-07-14 17_54_40

2017-07-14 17_54_45-Oracle Compute Cloud Service - Images

I now have two images created in IAAS. One exactly the same as my AWS image source and one with a small but important change:

2017-07-14 17_55_16-Oracle Compute Cloud Service - Images

Now create an instance with the recently uploaded image:

2017-07-14 17_55_37-Oracle Compute Cloud Service - Images

2017-07-14 17_56_34-Oracle Compute Cloud Service - Instance Creation

Choose the shape that you need:

2017-07-14 17_56_45-Oracle Compute Cloud Service - Instance Creation

Do not forget to associate your SSH Keys with the instance or you will not be able to logon to the instance:

2017-07-14 17_58_18-Oracle Compute Cloud Service - Instance Creation

I left the Network details default:
2017-07-14 18_01_33-Oracle Compute Cloud Service - Instance Creation

To change the storage details of the boot disk press the “hamburger menu” on the right (Just below “Boot Drive”):

2017-07-14 18_02_12-Oracle Compute Cloud Service - Instance Creation

I changed the boot disk from 11GB to 20GB so I can expand the filesystems if needed later on:

2017-07-14 18_03_21-Oracle Compute Cloud Service - Instance Creation

Review your input in the next step and press “Create” when you are satisfied:

2017-07-14 18_04_16-Oracle Compute Cloud Service - Instance Creation

You will see some messages passing by with the details of steps that have been put in motion:

2017-07-14 18_04_27-Oracle Compute Cloud Service - Instances (Instances)

If it all goes too fast you can press the little clock on the right side of you screen to get the ”Operations History”:

2017-07-14 18_04_35-Oracle Compute Cloud Service - Instances (Instances)

On the “Orchestrations” tab you can follow the status of the instance creation steps:

2017-07-14 18_06_45-Oracle Compute Cloud Service - Orchestrations

Once they have the status ready you will find a running instance on the instances tab:

2017-07-14 18_09_21-Oracle Compute Cloud Service - Instances (Instances)

Then you can connect to the instance and do with it whatever you want. In the GUI you can use the “hamburger” menu on the right to view the details of the instance, and for instance stop it:

2017-07-14 18_14_22-Oracle Compute Cloud Service - Instance Details (Overview)

Sometimes I got the error below, but found that waiting a few minutes before repeating the action it sequentially succeeded:

2017-07-17 18_01_32-

A nice feature of the Oracle Cloud is that you can capture screenshots of the console output, just as if you were looking at a monitor:

2017-07-17 18_46_08-Oracle Compute Cloud Service - Instance Details (Screen Captures)

And to view the Console Log (albeit truncated to a certain size) if you added the highlighted text to GRUB_CMDLINE_LINUX in /etc/default/grub:

[ec2-user@d3c0d7 ~]$ cat /etc/default/grub 
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=ol/root rd.lvm.lv=ol/swap rhgb quiet net.ifnames=0 console=ttyS0"
GRUB_DISABLE_RECOVERY="true"

If you didn’t you will probably see something like:

2017-07-17 18_46_28-Oracle Compute Cloud Service - Instance Details (Logs)

If you did you will see something like:

2017-07-17 19_01_38-Oracle Compute Cloud Service - Instance Details (Logs)

I hope this helps building your own Linux 7 Cloud Images.

About Post Author

Patrick Roozen

Patrick is an Oracle consultant at AMIS interested in storage, hardware, Solaris, Linux, Weblogic, performance, the Oracle Database and much more.
Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %

Average Rating

5 Star
0%
4 Star
0%
3 Star
0%
2 Star
0%
1 Star
0%

4 thoughts on “Oracle Compute Cloud – Uploading My Image – Part Two – Linux 7

  1. Hi Patrick,

    Thanks for the article. I’m beginning to work on Oracle Cloud and I’m having a difficult time getting my OEL 7 image to work. I have successfully created an OEL private image. I have verified that the drivers are loaded properly and took a screenshot showing that the vm is up and running. However, when I try to connect I am unable to ssh into the box. I have the proper ssh key on the instance and the same security list that I had for the OEL 6 instance. I have a feeling that it might be the network settings in ifcfg-eth0 as mine are different from yours but matching those in the Oracle Cloud tutorial. They mention naming the interfaces emN instead of ethN for Oracle Linux 7. I tried that but no joy. I am going to try your network settings and see if it makes a difference. If you have any insight I would appreciate it.

    Thanks,

    Chris

    1. It worked! The whole time I was using Oracle’s suggestion for the interface file:

      DEVICE=interface
      ONBOOT=yes
      TYPE=Ethernet
      BOOTPROTO=dhcp
      PERSISTENT_DHCLIENT=1

      This worked with OEL 6 but did not with 7. I have banging my head against the wall for the past week looking for an answer to this and finally found it.

      Thanks again Patrick!

      1. Hi Chris,
        I know what you mean by banging your head. I’ve been there as well. Good to read that you have fixed the problem yourself. Thanks for leaving your comments!
        Regards, Patrick

Comments are closed.

Next Post

Industrial IoT Strategy, The Transference of Risk by using a Digital Twin

The Internet of Things (IoT) is all about getting in-depth insight about your customers. It is the inter-networking of physical devices, vehicles (also referred to as “connected devices” and “smart devices”), buildings, and other items embedded with electronics, software, sensors, actuators, and network connectivity which enable these objects to collect […]
%d bloggers like this: