The first Oracle Linux Template for Oracle Linux KVM has just been announced and following Technical article will describe, step by step, how to import and configure an Oracle Linux 7 Template for Oracle Linux KVM.
The procedure shows:
- How to import the "Oracle Linux 7 Template for Oracle Linux KVM" appliance
- How to configure the Virtual Machine created (CPUs, RAM, Name and so on)
- How to automate the Virtual Machine deployment configurationby cloud-init
Import the Oracle Linux 7 Template for Oracle Linux KVM
- Copy the OVA file, obtained from the download on edelivery.oracle.com to your KVM host and assign proper permissions to the file; please, verify that "kvm" linux user can reach the path containing the OVA file.
# chown 36:36 /tmp/<myfile>.ova
To import the OVA proceed with following steps:
- Click on "Compute => Virtual Machines", click on the "3 points" (upper right) and select "Import"
- On the "Import Virtual Machine" window, select following options
- Data Center: <OLVM Datacenter>
- Source: "Virtual Appliance (OVA)"
- Host: <kvm-host-containing-ova>
- File Path: <ova_full_path>
- and then click on "Load" button.
- Select the "Virtual Machine" on Source and move it to the right; once done, click on "Next" button
- On the following window select the option "Clone" and proceed to configure options available under "General", "Network Interfaces" and "Disks" sections.
- The import process will get some minutes and the machine will remain in "Initializing" status until the process is completed; a padlock icon is also shown on the Virtual Machine row.
Configure the Virtual Machine created
- Once the Virtual Machine is ready to be used, you can then configure the same and apply your settings, like:
- Virtual Machine Name
- RAM Memory
- Possibly Add further virtual-disks
- ....and more
Automate the Virtual Machine deployment configuration by cloud-init
- Before starting the Virtual Machine we also have the option to configure different options for the guest Operating System, under the "Initial Run" TAB.
All the options above are managed by "cloud-init" on the first boot of the Virtual Machine.
- A very cool "cloud-init" option allows to execute a custom-script on the first boot of the Virtual Machine; the same is always available in the same "Initial Run" section.
The custom script has to be in the "YAML" format and you can find examples on Cloud-Init Documentation website.
- Once the configuration is in place, you can proceed to start the Virtual Machine created/configured
- To connect, by "ssh", to the Virtual Machine created by "Oracle Linux 7 Template for Oracle Linux KVM" you can then use the following options
If you try to directly access by "root" when the "SSH Key" has been defined, you'll get the following message
# ssh cloud-user@<hostname/ip-address>
- access will be granted, if defined, by SSH-key
# ssh <custom-user>@<hostname/ip-address>
- to then supply the password defined
Feel free to leave your feedback and comments on this blog article and I'll be glad to answer and help.