Red Hat Training

A Red Hat training course is available for Red Hat Enterprise Linux

第 3 章 为在由 libvirt 管理的 KVM 上运行转换虚拟机

virt-v2v 可以转换虚拟机来在 Red Hat Enterprise Linux(使用 libvirt 管理的 KVM)上运行。运行在 Xen、KVM、VMware ESX / ESX(i) 和 Hyper-V 环境中的虚拟机都可以被转换。Red Hat Enterprise Linux Virtualization 管理指南 中包括了对 libvirtvirsh 命令的介绍,您也可以使用 man virsh 命令来获得相关的信息。

3.1. 介绍

virt-v2v 命令可以对运行在其它虚拟机管理程序上的虚拟机进行转换来在由 libvirt 管理的 KVM 上运行。virt-v2v 支持转换运行以下操作系统的虚拟机:
  • Red Hat Enterprise Linux 3.9
  • Red Hat Enterprise Linux 4
  • Red Hat Enterprise Linux 5
  • Red Hat Enterprise Linux 6
  • Windows XP
  • Windows Vista
  • Windows 7
  • Windows Server 2003
  • Windows Server 2008
以下虚拟机监控程序被支持:
  • KVM
  • libvirt 管理的 Xen
  • VMware ESX / ESX(i) - 版本 3.5、4.0、4.1、5.0、5.1
在可能的情况下,virt-v2v 命令会在被转换的虚拟机上启用准虚拟化(virtio)驱动。
virt-v2v 由红帽客户门户网站中的 Red Hat Enterprise Linux Server (v.6 for 64-bit x86_64)Red Hat Enterprise Linux Workstation (v.6 for x86_64) 频道提供。
virt-v2v 工具程序需要有主机的 root 访问权限。
Red Hat Enterprise Linux 6 开始支持的 virt-v2v 新功能包括:
  • 虽然 -op-osd 命令行选项仍然被支持,但是现在我们倾向使用 -os 来替代它们。在使用这两个选项时,不会出现警告信息。
  • -of 命令行选项可以指定目标存储所使用的文件格式:rawqcow2。使用这个功能可以把虚拟机存储格式从 raw 转换为 qcow2,或把 qcow2 转换为 raw。
  • -oa 命令行选项可以指定目标存储所使用的分配策略:sparsepreallocated。使用这个功能可以在 sparse 和 preallocated 间进行转换,因此,现在可以支持 sparse 卷。
  • 现在的配置文件可以包括目标配置集,它指定了模板的存储位置、输出格式和分配策略。因此,用户可以通过使用 --profile<foo> 来替代 -os<a> -op<b> -oa<oc>
  • 支持转换 Windows 虚拟机。
请参阅 virt-v2v man 页来获得与功能相关的详细信息。
要从红帽客户门户网站安装 virt-v2v,请确认系统已经订阅了所需的频道,然后运行:
# yum install virt-v2v