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:
Then Press “Ok” to have the image created, and you will see messages similar to these on your screen:
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:
Now create an instance with the recently uploaded image:
Choose the shape that you need:
Do not forget to associate your SSH Keys with the instance or you will not be able to logon to the instance:
I left the Network details default:
To change the storage details of the boot disk press the “hamburger menu” on the right (Just below “Boot Drive”):
I changed the boot disk from 11GB to 20GB so I can expand the filesystems if needed later on:
Review your input in the next step and press “Create” when you are satisfied:
You will see some messages passing by with the details of steps that have been put in motion:
If it all goes too fast you can press the little clock on the right side of you screen to get the ”Operations History”:
On the “Orchestrations” tab you can follow the status of the instance creation steps:
Once they have the status ready you will find a running instance on the instances tab:
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:
Sometimes I got the error below, but found that waiting a few minutes before repeating the action it sequentially succeeded:
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:
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:
If you did you will see something like:
I hope this helps building your own Linux 7 Cloud Images.
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
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!
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
I didn’t fix it myself. Your post unlocked that door. Thank YOU for posting this great tutorial. Much appreciated!