KubeVirt becomes usable. And to make it easier to use it would be nice to be able to import existing VMs. After all migration is a strong point of KubeVirt.
virt-v2v is the tool of choice to convert some guest to run on the KVM hypervisor. What a great fit.
Thus recently I started a little POC to check if this would really work.
This post is just to wrap it up, as I just tagged v0.2.0 and finished a nice OVA import.
What the POC does:
- Take an URL pointing to an OVA
- Download and convert the OVA to a domxml and raw disk image
- Create a PVC and move the raw disk image to it
- Create an OfflineVirtualMachine from the domxml using xslt
This is pretty straight forward and currently living in a Job which can be found here: https://github.com/fabiand/v2v-job
It’s actually using an OpenShift Template, but only works on Kubernetes so far, because I didn’t finish the RBAC profiles. However, using the oc tool you can even run it on Kubernetes without Template support by using:
$ oc process --local -f manifests/template.yaml -p SOURCE_TYPE=ova -p SOURCE_NAME=https://192.168.42.1:8000/my.ova | kubectl apply -f - serviceaccount "kubevirt-privileged" created job "v2v" created
The interested reader can take a peek at the whole process in this log.
And btw – This little but awesome patch on libguestfs by Pino – will help this job to auto-detect – well, guess – the the guest operating system and set the OfflineVirtualMachine annotations correctly, in order to then – at runtime – apply the right VirtualMachinePresets, in order to launch the guest with optimized defaults.

