一、、配置kvm服务器
1、配置virtio源
wget https://fedorapeople.org/groups/virt/virtio-win/virtio-win.repo -O /etc/yum.repos.d/virtio-win.repo
2、安装相关软件包
yum install virt-v2v libguestfs-winsupport virtio-win libvirt qemu-kvm
二、准备被转换虚拟机
1、关闭被转换的虚拟机
三、创建default pool
virsh pool-define-as default --type dir --target /var/lib/libvirt/images
四、将vcenter虚拟机转换为kvm虚拟机
export LIBGUESTFS_BACKEND=direct # local模式,%40为@ # 172.168.20.20 为vcenterIP # 172.168.2.10 为待转换虚拟机所在的esxi服务器IP virt-v2v -ic vpx://administrator%[email protected]/Datacenter/172.168.20.10?no_verify=1 WIN -o local -os /opt/ -of qcow2 # 直接转换到libvir中,%40为@ # 172.168.20.20 为vcenterIP # 172.168.2.10 为待转换虚拟机所在的esxi服务器IP virt-v2v -ic vpx://administrator%[email protected]/Datacenter/172.168.20.10?no_verify=1 WIN -o libvirt -of qcow2
五、已知的问题:
virt-v2v-1.32.7-3.el7.centos.2.x86_64有bug不能对rhel6.5/centos6.5进行转换,会报一个与selinux有关的错,可以参看链接
https://bugzilla.redhat.com/show_bug.cgi?id=1374232
输出报错信息:
virt-v2v: error: libguestfs error: selinux_relabel: /sysroot/etc/selinux/targeted/contexts/files/file_contexts: Invalid argument: Success
参考链接:
http://jiangjianlong.blog.51cto.com/3735273/1812311
时间: 2024-12-27 22:04:08