
Introduction
The goal of this document is describe 'ova2vm' tool as solution to deploy an OVA Guest VM Format Template on Oracle Linux KVM (OL-KVM) or on Oracle VirtualBox
OVA2VM is not only importing an OVA template in the target provider (KVM or Virtualbox) but leveraging on cloud-init it will make the guest VM setup (user, password, sshkey, network configuration,...) automatically for you.
Assumptions
- You must have a KVM or Virtualbox host running on OracleLinux (ODA - Oracle Database Appliance running KVM can be used too)
- If you are going to leverage on auto-setup with cloud-init, you must have an Oracle OVA template cloud-init compliant
Details
OVA2VM is offering two 'verbs':
- import - to import the OVM template
- make - to make the cloud-init configuration
Import the OVM template
Usage:
ova2vm import --ova <ova template file>
{--provider kvm
--repo <KVM repository path>
[--vmname <guest vm name>]
[--bridge <bridge name> [--macvtap]]
[--cpu <virtual CPU>]
[--diskbus <disk bus type ide|sata|scsi|virtio>]
[--typedisk <disk type qcow2|raw>]
[--memory <memory MB>]
[--netmodel <network card model e1000|rtl8139|virtio>]
[--video <video model cirrus|qxl|vga|virtio>]
[--cloud_config <cloud-init iso file path>]
[--force]
}
|
{--provider virtualbox
[--vmname <guest vm name>]
[--cpu <virtual CPU>]
[--memory <memory MB>]
[--nettype <network type: nat|bridge|hostonly> --netname <none|<devicename>]
[--cloud_config <cloud-init iso file path>]
[--force]
}
where
ova2vm 'import' OPTIONS
--ova OVA file to convert
--vmname Guest VM name
--cpu Virtual CPU (Default from source OVA template)
--memory Memory in Mb (Default from source OVA template)
--cloud_config Attach cloud-init iso
--help Show this help message and exit
--version Show program's version number and exit
ova2vm 'import' OPTIONS for KVM provider
--bridge Use bridged network instead of default network
--macvtap It will setup a MACVTAB bridge
--diskbus Specify which bus to use for disk (Default: ide)
--netmodel Specify which network card model to use for network cards (Default: virtio)
--repo KVM repository path
--typedisk Specify which bus to use for disk (Default: qcow2)
--video Specify the video type (Default: virtio)
--force It will import the domain with random name if present
ova2vm 'import' OPTIONS for Virtualbox provider
--nettype VirtualBox network type nat|bridge|hostonly
--netname Host network device name
KVM host provider
Required parameters are the following:
- Provider name, in this case 'kvm'
- OVA file to convert
- KVM Guests repository path (kvm pool)
Storage Format
OVA2VM is performing automatically a conversion from "vmdk" disks (OVA) to "qcow2" (default) or "raw" (base on "--typedisk" command option)
Disk Bus
OVA2VM is permitting different disk bus such
- ide (default)
- sata
- scsi
- virtio
Oracle Linux OVA templates (from edelivery.oracle.com) are supporting "IDE" disk bus
Network Type
The default network type is NAT using KVM default network, it can be a bridged and in such case you need to provide the bridge NIC name
CPU & Memory
ova2vm reading the OVA template is getting information about vCPU and memory setup automatically. If you want overwrite such setting you need to use related command options "–cpu" and or "–memory"
VMName
If the VMname is not provided, it will be the template name. If the VM is already present and '--force' option is in use, the vmname will be: existing_vmname-<random 5 chars>
Automatic Setup
If after the import you need the guest up&running and configured with a specific user and network setup, you need to specify the cloud_init configuration file '--cloud_config' command option
VirtualBox host provider
Required parameters are the following:
- Provider name, in this case 'virtualbox'
Network Type
The default network type is NAT. It can be changed to bridge or hostonly providing the virtualbox host network devicename
CPU & Memory
ova2vm reading the OVA template is getting information about vCPU and memory setup automatically. If you want overwrite such setting you need to use related command options "–cpu" and or "–memory"
VMName
If the VMname is not provided, it will be the template name. If the VM is already present and '--force' option is in use, the vmname will be: existing_vmname-<random 5 chars>
Automatic Setup
If after the import you need the guest up&running and configured with a specific user and network setup, you need to specify the cloud_init configuration file '--cloud_config' command option
Make the cloud-init configuration file
Usage:
ova2vm make --cloud_config <cloud-init iso file path>
--vm-hostname <guest vm hostname>
--vm-domain <guest vm domain>
--vm-timezone <guest vm timezone>
--vm-username <guest vm user name>
--vm-userpassword <guest vm user password>
--vm-sshpublickey <guest vm user ssh public key>
--vm-publicip <guest vm public IP>
--vm-netmask <guest vm netmaks>
--vm-gateway <guest vm gateway>
[--vm-netdevice <guest vm netdevice>]
--vm-dnsserver <guest vm DNS server>
--vm-searchdomain <guest vm DNS search domain>
[--vm-customscript <guest vm custom script to be executed>]
where
ova2vm 'make' OPTIONS
--vm-hostname Guest VM hostname
--vm-domain Guest VM domain
--vm-timezone Guest VM timezone
--vm-username Guest VM user name
--vm-userpassword Guest VM user password
--vm-sshpublickey Guest VM user ssh authorized key
--vm-publicip Guest VM public IP
--vm-netmask Guest VM netmaks
--vm-gateway Guest VM gateway
--vm-netdevice Guest VM netdevice (Default: eth0)
--vm-dnsserver Guest VM DNS server
--vm-searchdomain Guest VM DNS search domain
--vm-customscript Guest VM custom script to be executed
Usage Example
1. Import an OVA template into KVM storage pool and on VirtualBox

and the imported guest VM will be visible from the Virtual Machine Manager:

The same command is executed but using VirtualBox as provider:

At this time the Guest VM is up&running under VirtualBox

2. Import an OVA template and setup the Guest VM automatically
In this example the "cloud_config" parameter is in use :

After the import he new Guest VM will be configured with a specific user, hostname and network setup

3.Make the configuration file
IN this example, we are going to make the cloud_config file to setup the Guest VM later after the "import" command.

How to get OL7 OVA Template cloud-init ready
The new Oracle Linux 7 Template for Oracle Linux KVM and Oracle Linux Virtualization Manager supplies powerful . It is built on cloud-init, the same technology used today on Oracle Cloud Infrastructure and includes improvements and regression fixes.
The template has been built with the following components/options:
- Oracle Linux 7 Update 8 x86_64 with the Unbreakable Enterprise Kernel 5 Update 3 - kernel-uek-4.14.35-1902.301.1.el7uek.x86_64
- Red Hat Compatible Kernel - 3.10.0-1127.el7.x86_64
- 8GB of RAM
- 15GB of OS virtual disk
Downloading Oracle Linux 7 Template for Oracle Linux KVM
- Oracle Linux 7 Template for Oracle Linux KVM is available on Oracle Software Delivery Cloud. Search for "Oracle Linux KVM" and select "Oracle Linux KVM Templates for Oracle Linux"
- Click on the "Add to Cart" button and then click on "Checkout" in the right upper corner. On the following window, select "Linux-x86_64" and click on the "Continue" button:
- Accept the "Oracle Standard Terms and Restrictions" to continue and, on the following window, click on "V988166-01.zip" to download the Oracle Linux 7 Template for Oracle Linux KVM and on "V988167-01.zip" to download the README with instructions
How to get OVA2VM
You can get the tool from the MOS article:
Import an OVA Guest VM format template into KVM (DocID: 2284806.1)