virt-v2v is a handy tool used to convert VMs from Xen, VMware and Hyper-V to KVM. In this post we’ll step through importing an OVA file for use on libvirt. This is a very narrowly scoped example, but the concepts are applicable to a wide range of conversions. Check the man page for a complete list of input and output options.
Consider the common scenario of a management appliance VM. It is a simple way to distribute complex software, but not all vendors can support all hypervisors. A common solution is to export the original VMs to an open standard such as OVA, then users can import the OVAs into their hypervisor.
Defining a pool for appliances
The hypervisor stores VM image files in pools. A dedicated pool will help keep VMs separate logically and/or physically. For example, the new pool could live on a different storage device. If you are going to use an existing pool, you can skip ahead to “Importing”.
Check to see what pools are available on your hypervisor:
# virsh pool-list
Name State Autostart
-------------------------------------------
default active yes
To create a separate pool called Appliances make the target directory, create and start the pool. Lastly, set it to start automatically:
# mkdir /var/lib/libvirt/Appliances # virsh pool-define-as Appliances --type dir \ --target /var/lib/libvirt/Appliances # virsh pool-start Appliances # virsh pool-autostart Appliances
Check the status of the new pool:
# virsh pool-list
Name State Autostart
-------------------------------------------
Appliances active yes
default active yes
Importing
Place the OVA file in a location that is accessible from the hypervisor. In this example the appliance is /root/third_party_appliance.ova. This is the command we’ll use:
# virt-v2v \ -i ova /root/third_party_appliance.ova \ -o libvirt -of qcow2 \ -os Appliances -n default
The options read as:
-
“-i ova /root/third_party_appliance.ova” == “input is an ova file called /root/third_party_appliance.ova”
-
“-o libvirt -of qcow2” == “output a libvirt VM in a qcow2 file format”
-
“-os Appliances” == “place the output VM in the Appliances pool”
-
“-n default” == “configure the VM to use the default network”
This could take a while depending on the speed of the hypervisor and the size of the input VM. The output gives plenty of relevant feedback.
[ 0.0] Opening the source -i ova third_party_appliance.ova
[ 0.1] Creating an overlay to protect the source from being modified
[ 0.1] Initializing the target -o libvirt -os Appliances
[ 0.1] Opening the overlay
[ 13.7] Inspecting the overlay
[ 14.6] Checking for sufficient free disk space in the guest
[ 14.6] Estimating space required on target for each disk
[ 14.6] Converting Windows 7 Enterprise to run on KVM
[ 15.0] Mapping filesystem data to avoid copying unused and blank areas
[ 15.4] Closing the overlay
[ 15.6] Checking if the guest needs BIOS or UEFI to boot
[ 15.6] Assigning disks to buses
[ 15.6] Copying disk 1/1 to /var/lib/libvirt/Appliances/third_party_appliance-sda (qcow2)
(100.00/100%)
[ 132.3] Creating output metadata
Pool Appliances refreshed
[ 132.5] Finishing off
Once the import is finished, start the appliance VM and check its status:
# virsh start third_party_appliance
Domain third_party_appliance started
# virsh list --all
Id Name State
----------------------------------------------------
12 third_party_appliance running
- cfme_demo shut off
- Fedora27-test shut off
The process is quite simple once you break down the options. As mentioned above, the same techniques could be used for more complex conversions. The main page has examples for migrating VMs from an existing virtualization infrastructure into Red Hat Virtualization or Red Hat OpenStack Platform.
Want to learn more about edge computing?
Edge computing is in use today across many industries, including telecommunications, manufacturing, transportation, and utilities. Visit our resources to see how Red Hat's bringing connectivity out to the edge.
Tim Quinlan (RHCE, RHCVA) is a Technical Account Manager (TAM) in the US Central region. Since 1996, he has applied Linux geekery in a wide array of industries including retail, energy, rail control and manufacturing before coming to Red Hat.
A Red Hat Technical Account Manager is a specialized product expert who works collaboratively with IT organizations to strategically plan for successful deployments and help realize optimal performance and growth. The TAM is part of Red Hat’s world-class Customer Experience and Engagement organization and provides proactive advice and guidance to help you identify and address potential problems before they occur. Should a problem arise, your TAM will own the issue and engage the best resources to resolve it as quickly as possible with minimal disruption to your business.
Connect with TAMs at a Red Hat Convergence event near you! Red Hat Convergence is a free, invitation-only event offering technical users an opportunity to deepen their Red Hat product knowledge and discover new ways to apply open source technology to meet their business goals. These events travel to cities around the world to provide you with a convenient, local one-day experience to learn and connect with Red Hat experts and industry peers.
저자 소개
채널별 검색
오토메이션
기술, 팀, 인프라를 위한 IT 자동화 최신 동향
인공지능
고객이 어디서나 AI 워크로드를 실행할 수 있도록 지원하는 플랫폼 업데이트
오픈 하이브리드 클라우드
하이브리드 클라우드로 더욱 유연한 미래를 구축하는 방법을 알아보세요
보안
환경과 기술 전반에 걸쳐 리스크를 감소하는 방법에 대한 최신 정보
엣지 컴퓨팅
엣지에서의 운영을 단순화하는 플랫폼 업데이트
인프라
세계적으로 인정받은 기업용 Linux 플랫폼에 대한 최신 정보
애플리케이션
복잡한 애플리케이션에 대한 솔루션 더 보기
오리지널 쇼
엔터프라이즈 기술 분야의 제작자와 리더가 전하는 흥미로운 스토리
제품
- Red Hat Enterprise Linux
- Red Hat OpenShift Enterprise
- Red Hat Ansible Automation Platform
- 클라우드 서비스
- 모든 제품 보기
툴
체험, 구매 & 영업
커뮤니케이션
Red Hat 소개
Red Hat은 Linux, 클라우드, 컨테이너, 쿠버네티스 등을 포함한 글로벌 엔터프라이즈 오픈소스 솔루션 공급업체입니다. Red Hat은 코어 데이터센터에서 네트워크 엣지에 이르기까지 다양한 플랫폼과 환경에서 기업의 업무 편의성을 높여 주는 강화된 기능의 솔루션을 제공합니다.