[root@controller data]# virt-v2v-copy-to-local -ic esx://root@10.200.115.55?no_verify=1 test-centos7 [ 0.0] Fetching the remote libvirt XMLmetadata ... 2024-03-2703:58:07.008+0000: 26523: info : libvirt version: 4.5.0, package: 10.el7 (CentOS BuildSystem <http://bugs.centos.org>, 2018-10-31-00:13:25, x86-01.bsys.centos.org) 2024-03-2703:58:07.008+0000: 26523: info : hostname: controller 2024-03-2703:58:07.008+0000: 26523: warning : esxConnectOpen:857 : Ignoring unexpected path '' for non-vpx scheme 'esx' Enter root's password for 10.200.115.55: [ 4.0] Parsing the remote libvirt XMLmetadata ... Enter host password for user'root': Enter host password for user'root': [ 11.3] Copying remote disk 1/1 to test-centos7-disk1 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 10010.0G 10010.0G 0085.0M00:02:000:02:00 --:--:-- 87.4M [ 131.7] Writing libvirt XMLmetadata to test-centos7.xml... [ 131.7] Finishing off
3、转换数据格式,把磁盘文件的格式转换成OpenStack能够识别的格式
1
virt-v2v -i libvirtxml vm_name.xml-o local -os /data/vms/ -of raw
-of: 转换为raw格式 -os: 指定输出路径 vm_name.xml: 为步骤2中生成的文件
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
[root@controller data]# export LIBGUESTFS_BACKEND=direct;virt-v2v -i libvirtxml test-centos7.xml -o local -os /root/data/vms/ -of raw [ 0.0] Opening the source -i libvirtxml test-centos7.xml [ 0.0] Creating an overlay to protect the source from being modified [ 0.3] Initializing the target -o local -os /root/data/vms/ [ 0.3] Opening the overlay [ 4.7] Inspecting the overlay [ 16.9] Checking for sufficient free disk space in the guest [ 16.9] Estimating space required on target for each disk [ 16.9] ConvertingCentOSLinux release 7.5.1804 (Core) to run on KVM virt-v2v: This guest has virtio drivers installed. [ 75.7] Mapping filesystem data to avoid copying unused and blank areas [ 75.9] Closing the overlay [ 76.1] Checking if the guest needs BIOS or UEFI to boot [ 76.1] Assigning disks to buses [ 76.1] Copying disk 1/1 to /root/data/vms/test-centos7-sda (raw) (100.00/100%) [ 134.4] Creating output metadata [ 134.4] Finishing off