Vmware esxi虚拟机冷迁移至各虚拟化平台方案

目录

Vmware esxi虚拟机冷迁移至各虚拟化平台方案... 1

注意事项.... 2

Linux虚拟机-centos7测试.... 2

Vmware to openstack. 2

Vmware to proxmox6. 10

ova导入启动.... 10

Vmware to local 12

方法1:本地转换启动... 12

方法2:ova导入启动... 16

方法3:本地vmdk导入.... 17

Windows虚拟机-win7测试.... 18

Vmware to local 18

方法1:本地转换测试... 18

驱动安装.... 21

ip修改.... 22

方法2:ova导入测试... 22

Vmware to openstack. 24

1、部署window虚拟机.... 24

2、导出虚拟机ova文件.... 28

3、操作openstack. 28

Vmware to proxmox6. 31

ova导入启动.... 31

因该博客平台上传图片超级麻烦,原文地址在如下网盘地址。

链接: https://pan.baidu.com/s/1T8ENaPDNc0XN2vgV04forw 提取码: j8ie

注意事项

  1. 如果虚拟机上安装了 VMware Tools,必须先卸载它。因为 KVM 的虚拟机不支持 VMware Tools 里面的虚拟驱动。
  2. 在 VMware ESX 上停止等待迁移的虚拟机,因为 virt-v2v 只支持静态迁移。
  3. 为自动登录 VMware ESX 服务器创建 .netrc 文件。VMware ESX 服务器的连接需要授权,virt-v2v 支持密码方式的授权连接,可以从 $HOME/.netrc 文件中读取密码并自动登录。如果主机系统没有这个文件,就手动创建它。并且 .netrc 文件需要 0600 权限,使 virt-v2v 工具可以正确读取它。

.netrc 文件的格式

machine esx.example.com login root password xxxxxx 本例没有这样做,直接终端输入密码。
  1. 使用 virt-v2v 命令进行迁移。VMware ESX 服务器采用 HTTPS 连接方式,连接时需要配置 SSL 证书。本文通过添加'?no_verify=1'; 到 VMware 服务器的 URI 连接中,来关闭证书检查。

 

5、测试过程中,kvm1中转服务器主机是单独的一台主机 安装virt相关包

yum install -y qemu-kvm  libvirt*  virt-manager   virt-v2v  libguestfs-winsupport

 

其中包libguestfs-winsupport是windows虚拟机需要

 

Linux虚拟机-centos7测试

Vmware to openstack

连接esxi主机,查看虚拟机

[root@kvm1 test]# virsh  -c esx://root@192.168.5.35?no_verify=1 list --all

2019-07-26 08:08:20.323+0000: 31492: info : libvirt version: 4.5.0, package: 10.el7_6.12 (CentOS BuildSystem <http://bugs.centos.org&gt;, 2019-06-20-15:01:15, x86-01.bsys.centos.org)

2019-07-26 08:08:20.323+0000: 31492: info : hostname: kvm1

2019-07-26 08:08:20.323+0000: 31492: warning : esxConnectOpen:857 : Ignoring unexpected path '' for non-vpx scheme 'esx'

Enter root's password for 192.168.5.35:

Id    Name                           State


-     centos7-1                      shut off

 

迁移到本地

[root@kvm1 test]# virt-v2v-copy-to-local -ic esx://root@192.168.5.35?no_verify=1 centos7-1

 

(centos7-1 为本地名字  no_verify=1 不需要认证)

[   0.0] Fetching the remote libvirt XML metadata ...

2019-07-26 08:36:19.102+0000: 31571: info : libvirt version: 4.5.0, package: 10.el7_6.12 (CentOS BuildSystem <http://bugs.centos.org&gt;, 2019-06-20-15:01:15, x86-01.bsys.centos.org)

2019-07-26 08:36:19.102+0000: 31571: info : hostname: kvm1

2019-07-26 08:36:19.102+0000: 31571: warning : esxConnectOpen:857 : Ignoring unexpected path '' for non-vpx scheme 'esx'

Enter root's password for 192.168.5.35:

[   2.6] Parsing the remote libvirt XML metadata ...

Enter host password for user 'root':(exsi主机root密码)

Enter host password for user 'root':

Enter host password for user 'root':

Enter host password for user 'root':

[  10.6] Copying remote disk 1/2 to centos7-1-disk1

% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

Dload  Upload   Total   Spent    Left  Speed

100 16.0G  100 16.0G    0     0  38.3M      0  0:07:06  0:07:06 --:--:-- 33.9M

[ 438.6] Copying remote disk 2/2 to centos7-1-disk2

% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

Dload  Upload   Total   Spent    Left  Speed

100 10.0G  100 10.0G    0     0  39.0M      0  0:04:22  0:04:22 --:--:-- 42.4M

[ 701.7] Writing libvirt XML metadata to centos7-1.xml ...

[ 701.7] Finishing off

You have new mail in /var/spool/mail/root

[root@kvm1 test]# ll

total 28867972

-rw-r--r-- 1 nfsnobody nfsnobody 17179869184 Jul 26 16:43 centos7-1-disk1

-rw-r--r-- 1 nfsnobody nfsnobody 10737418240 Jul 26 16:48 centos7-1-disk2

-rw-r--r-- 1 nfsnobody nfsnobody        1560 Jul 26 16:48 centos7-1.xml

 

转换为openstack格式 这里为raw

[root@kvm1 test]# virt-v2v -i libvirtxml centos7-1.xml -o local --os  ./ --of raw

[   0.0] Opening the source -i libvirtxml centos7-1.xml

[   0.0] Creating an overlay to protect the source from being modified

[   0.4] Initializing the target -o local -os .

[   0.4] Opening the overlay

[  28.8] Inspecting the overlay

[  37.1] Checking for sufficient free disk space in the guest

[  37.1] Estimating space required on target for each disk

[  37.1] Converting CentOS Linux release 7.2.1511 (Core)  to run on KVM

virt-v2v: This guest has virtio drivers installed.

[  90.5] Mapping filesystem data to avoid copying unused and blank areas

[  91.4] Closing the overlay

[  92.1] Checking if the guest needs BIOS or UEFI to boot

[  92.1] Assigning disks to buses

[  92.1] Copying disk 1/2 to ./centos7-1-sda (raw)

(100.00/100%)

[ 222.6] Copying disk 2/2 to ./centos7-1-sdb (raw)

(100.00/100%)

[ 287.9] Creating output metadata

[ 287.9] Finishing off

[root@kvm1 test]# ll

total 29061796

-rw-r--r-- 1 nfsnobody nfsnobody 17179869184 Jul 26 16:43 centos7-1-disk1

-rw-r--r-- 1 nfsnobody nfsnobody 10737418240 Jul 26 16:48 centos7-1-disk2

-rw-r--r-- 1 nfsnobody nfsnobody 17179869184 Jul 26 17:17 centos7-1-sda

-rw-r--r-- 1 nfsnobody nfsnobody 10737418240 Jul 26 17:18 centos7-1-sdb

-rw-r--r-- 1 nfsnobody nfsnobody        1649 Jul 26 17:18 centos7-1.xml

Openstack使用vmware磁盘镜像创建云主机

 

1、上传转换格式后的磁盘镜像文件到openstack控制节点上

 

2、在openstack控制节点上创建镜像文件

openstack image create centos7-1-sda --disk-format raw --public --file /root/centos7-1-sda.raw

openstack image create centos7-1-sdb --disk-format raw --public --file /root/centos7-1-sdb.raw

 

3、使用镜像centos7-1-sda在openstack平台上创建一个云主机实例

 

4、使用镜像centos7-1-sdb创建一个卷

 

4、将卷vdb连接到云主机上vm002上

 

5、进入云主机控制台

 

 

 

Vmware to proxmox6

ova导入启动

 

1、首先从ESXi的管理客户端vSphere Client中把要迁移的虚拟机关机,然后选中它,在菜单“文件”-“导出”-“导出OVF模板”,然后格式选择“单个文件(OVA)”,等待导出完成。

 

2、然后就是把ova文件上传到超融合平台的节点主机上。

 

3、解压ova文件,解压出来后,得到一个ovf文件,这个文件包含了虚拟机的硬件配置,例如cpu规格、内存等和若干个vmdk文件,这些是虚拟机的硬盘镜像,数量取决于虚拟机有多少个硬盘。

tar -xvf centos7-2.ova

 

 

4、在超融合节点后台使用qm importovf工具导入ovf文件,创建一个虚拟机

root@prox1:~# qm importovf 100 centos7-2.ovf nfs37 --format qcow2

Formatting '/mnt/pve/nfs37/images/100/vm-100-disk-0.qcow2', fmt=qcow2 size=17179869184 cluster_size=65536 preallocation=metadata lazy_refcounts=off refcount_bits=16

(100.00/100%)

Formatting '/mnt/pve/nfs37/images/100/vm-100-disk-1.qcow2', fmt=qcow2 size=10737418240 cluster_size=65536 preallocation=metadata lazy_refcounts=off refcount_bits=16

(100.00/100%)

 

5、在proxmox管理平台上查看虚拟机创建成功,但硬件页面看不到该虚拟机网卡配置信息

根据实际情况添加网卡,本例虚拟机只有一个网卡。

 

 

6、在后台修改虚拟机配置文件

改为ide

root@prox1:~# cat /etc/pve/qemu-server/100.conf

bootdisk: ide0

cores: 1

ide0: nfs37:100/vm-100-disk-0.qcow2

ide1: nfs37:100/vm-100-disk-1.qcow2

memory: 2048

name: centos7-2

net0: e1000=6E:89:23:7F:3B:00,bridge=vmbr0,firewall=1

smbios1: uuid=5374fb93-8fc0-4a27-adb5-71e770117b04

vmgenid: 965d5b61-dc99-41e7-aaee-a214785c85fb

 

7、开启虚拟机,查看虚拟机磁盘信息和网卡信息

 

 

 

Vmware to local

方法1:本地转换启动

[root@kvm1 test]#  virsh  -c esx://root@192.168.5.36?no_verify=1 list --all

2019-07-30 06:12:11.457+0000: 14772: info : libvirt version: 4.5.0, package: 10.el7_6.12 (CentOS BuildSystem <http://bugs.centos.org&gt;, 2019-06-20-15:01:15, x86-01.bsys.centos.org)

2019-07-30 06:12:11.457+0000: 14772: info : hostname: kvm1

2019-07-30 06:12:11.457+0000: 14772: warning : esxConnectOpen:857 : Ignoring unexpected path '' for non-vpx scheme 'esx'

Enter root's password for 192.168.5.36:

Id    Name                           State


-     centos7-2                      shut off

 

下载到本地

[root@kvm1 test]# virt-v2v-copy-to-local -ic esx://root@192.168.5.36?no_verify=1 centos7-2

[   0.0] Fetching the remote libvirt XML metadata ...

2019-07-30 06:14:22.374+0000: 14899: info : libvirt version: 4.5.0, package: 10.el7_6.12 (CentOS BuildSystem <http://bugs.centos.org&gt;, 2019-06-20-15:01:15, x86-01.bsys.centos.org)

2019-07-30 06:14:22.374+0000: 14899: info : hostname: kvm1

2019-07-30 06:14:22.374+0000: 14899: warning : esxConnectOpen:857 : Ignoring unexpected path '' for non-vpx scheme 'esx'

Enter root's password for 192.168.5.36:

[   2.5] Parsing the remote libvirt XML metadata ...

Enter host password for user 'root':

Enter host password for user 'root':

Enter host password for user 'root':

Enter host password for user 'root':

[  12.1] Copying remote disk 1/2 to centos7-2-disk1

% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

Dload  Upload   Total   Spent    Left  Speed

100 16.0G  100 16.0G    0     0  50.5M      0  0:05:23  0:05:23 --:--:-- 53.6M

[ 336.0] Copying remote disk 2/2 to centos7-2-disk2

% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

Dload  Upload   Total   Spent    Left  Speed

100 10.0G  100 10.0G    0     0  56.9M      0  0:02:59  0:02:59 --:--:-- 58.1M

[ 516.1] Writing libvirt XML metadata to centos7-2.xml ...

[ 516.1] Finishing off

本地转换

[root@kvm1 test]# virt-v2v -i libvirtxml centos7-2.xml -o local --os  ./out/ --of qcow2

[   0.0] Opening the source -i libvirtxml centos7-2.xml

[   0.0] Creating an overlay to protect the source from being modified

[   0.4] Initializing the target -o local -os ./out/

[   0.4] Opening the overlay

[   4.6] Inspecting the overlay

[  12.5] Checking for sufficient free disk space in the guest

[  12.5] Estimating space required on target for each disk

[  12.5] Converting CentOS Linux release 7.2.1511 (Core)  to run on KVM

virt-v2v: This guest has virtio drivers installed.

[  53.0] Mapping filesystem data to avoid copying unused and blank areas

[  53.3] Closing the overlay

[  53.7] Checking if the guest needs BIOS or UEFI to boot

[  53.7] Assigning disks to buses

[  53.7] Copying disk 1/2 to ./out/centos7-2-sda (qcow2)

(100.00/100%)

[ 112.8] Copying disk 2/2 to ./out/centos7-2-sdb (qcow2)

(100.00/100%)

[ 127.9] Creating output metadata

[ 128.0] Finishing off

 

进入到out输出目录,修改xml文件

这里首先自定义了一个桥 br1

[root@kvm1 test]# virsh iface-bridge eno16777736 br1

重启网卡。

[root@kvm1 out]# vim centos7-2.xml   修改桥接

<interface type='bridge'>

<source bridge='br1'/>

<model type='virtio'/>

<mac address='00:50:56:89:32:41'/>

</interface>

 

定义虚拟机

[root@kvm1 out]# virsh define centos7-2.xml

Domain centos7-2 defined from centos7-2.xml

 

[root@kvm1 out]# virsh list --all

Id    Name                           State


-     centos7-2                      shut off

编辑配置文件增加vnc

[root@kvm1 out]# virsh edit centos7-2

<graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0'>

 

Domain centos7-2 XML configuration edited.

 

[root@kvm1 out]#

[root@kvm1 out]#

[root@kvm1 out]#

[root@kvm1 out]# virsh start centos7-2

Domain centos7-2 started

 

[root@kvm1 out]# ps -ef|grep kvm

root       1001      2  0 09:16 ?        00:00:00 [kvm-irqfd-clean]

qemu      17804      1 86 14:49 ?        00:00:05 /usr/libexec/qemu-kvm -name centos7-2 -S -machine pc-i440fx-rhel7.0.0,accel=kvm,usb=off,dump-guest-core=off -m 2048 -realtime mlock=off -smp 1,sockets=1,cores=1,threads=1 -uuid caccd47b-e7a3-4871-854f-654313e51994 -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/domain-2-centos7-2/monitor.sock,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -boot strict=on -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive file=/test/./out/centos7-2-sda,format=qcow2,if=none,id=drive-virtio-disk0,cache=none -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -drive file=/test/./out/centos7-2-sdb,format=qcow2,if=none,id=drive-virtio-disk1,cache=none -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x5,drive=drive-virtio-disk1,id=virtio-disk1 -drive if=none,id=drive-ide0-1-0,readonly=on -device ide-cd,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -netdev tap,fd=26,id=hostnet0,vhost=on,vhostfd=28 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=00:50:56:89:32:41,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -device usb-tablet,id=input0,bus=usb.0,port=1 -vnc 0.0.0.0:0 -vga qxl -global qxl-vga.ram_size=67108864 -global qxl-vga.vram_size=67108864 -global qxl-vga.vgamem_mb=16 -global qxl-vga.max_outputs=1 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x6 -object rng-random,id=objrng0,filename=/dev/urandom -device virtio-rng-pci,rng=objrng0,id=rng0,bus=pci.0,addr=0x7 -device pvpanic,ioport=1285 -msg timestamp=on

 

vnc查看

之前文件都存在。

 

方法2:ova导入启动

将虚拟机导出ova格式

上传ova到本地并转换

[root@kvm1 test]#  virt-v2v -i ova centos7-2.ova -o local -os ./out1/  -of qcow2

[   0.0] Opening the source -i ova centos7-2.ova

virt-v2v: warning: making OVA directory public readable to work around

libvirt bug https://bugzilla.redhat.com/1045069

[   5.8] Creating an overlay to protect the source from being modified

[   6.0] Initializing the target -o local -os ./out1/

[   6.0] Opening the overlay

[  11.6] Inspecting the overlay

[  19.1] Checking for sufficient free disk space in the guest

[  19.1] Estimating space required on target for each disk

[  19.1] Converting CentOS Linux release 7.2.1511 (Core)  to run on KVM

virt-v2v: This guest has virtio drivers installed.

[  56.5] Mapping filesystem data to avoid copying unused and blank areas

[  56.8] Closing the overlay

[  57.2] Checking if the guest needs BIOS or UEFI to boot

[  57.2] Assigning disks to buses

[  57.2] Copying disk 1/2 to ./out1/centos7-2-sda (qcow2)

(100.00/100%)

[  81.5] Copying disk 2/2 to ./out1/centos7-2-sdb (qcow2)

(100.00/100%)

[  83.2] Creating output metadata

[  83.2] Finishing off

剩余步骤和本地转换并启动一致。

方法3:本地vmdk导入

新建虚拟机,参考本地qcow2转换导入。删除之前虚拟机磁盘。

根据ova导入启动,上传vmdk磁盘到共享路劲

root@vcloud191:/mnt/pve/cifs001/disk# ls -l centos7-1-*.vmdk

-rwxr-xr-x 1 root root 716296704 Jul 30 12:34 centos7-1-disk1.vmdk

-rwxr-xr-x 1 root root     80384 Jul 30 12:34 centos7-1-disk2.vmdk

Web端删除磁盘并导入磁盘,并设置ide

启动虚拟机

Windows虚拟机-win7测试

Vmware to local

方法1:本地转换测试

[root@kvm1 test]#  virsh  -c esx://root@192.168.5.35?no_verify=1 list --all

2019-07-31 08:28:30.553+0000: 10423: info : libvirt version: 4.5.0, package: 10.el7_6.12 (CentOS BuildSystem <http://bugs.centos.org&gt;, 2019-06-20-15:01:15, x86-01.bsys.centos.org)

2019-07-31 08:28:30.553+0000: 10423: info : hostname: kvm1

2019-07-31 08:28:30.553+0000: 10423: warning : esxConnectOpen:857 : Ignoring unexpected path '' for non-vpx scheme 'esx'

Enter root's password for 192.168.5.35:

Id    Name                           State


-     centos7-1                      shut off

-     win7                           shut off

 

下载到本地

[root@kvm1 test]# virt-v2v-copy-to-local -ic esx://root@192.168.5.35?no_verify=1 win7

[   0.0] Fetching the remote libvirt XML metadata ...

2019-07-31 08:29:21.946+0000: 10425: info : libvirt version: 4.5.0, package: 10.el7_6.12 (CentOS BuildSystem <http://bugs.centos.org&gt;, 2019-06-20-15:01:15, x86-01.bsys.centos.org)

2019-07-31 08:29:21.946+0000: 10425: info : hostname: kvm1

2019-07-31 08:29:21.946+0000: 10425: warning : esxConnectOpen:857 : Ignoring unexpected path '' for non-vpx scheme 'esx'

Enter root's password for 192.168.5.35:

[   2.4] Parsing the remote libvirt XML metadata ...

Enter host password for user 'root':

Enter host password for user 'root':

Enter host password for user 'root':

Enter host password for user 'root':

[  10.4] Copying remote disk 1/2 to win7-disk1

% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

Dload  Upload   Total   Spent    Left  Speed

100 32.0G  100 32.0G    0     0  42.1M      0  0:12:58  0:12:58 --:--:-- 47.5M

[ 788.5] Copying remote disk 2/2 to win7-disk2

% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

Dload  Upload   Total   Spent    Left  Speed

100 4096M  100 4096M    0     0  47.1M      0  0:01:26  0:01:26 --:--:-- 46.2M

[ 875.5] Writing libvirt XML metadata to win7.xml ...

[ 875.5] Finishing off

 

本地转换

[root@kvm1 test]#  virt-v2v -i libvirtxml win7.xml -o local --os  ./out2/ --of qcow2

[   0.0] Opening the source -i libvirtxml win7.xml

[   0.0] Creating an overlay to protect the source from being modified

[   0.4] Initializing the target -o local -os ./out2/

[   0.4] Opening the overlay

[   5.0] Inspecting the overlay

[   6.5] Checking for sufficient free disk space in the guest

[   6.5] Estimating space required on target for each disk

[   6.5] Converting Windows 7 Ultimate to run on KVM

virt-v2v: warning: /usr/share/virt-tools/pnp_wait.exe is missing.

Firstboot scripts may conflict with PnP.

virt-v2v: warning: there are no virtio drivers available for this version

of Windows (6.1 x86_64 Client).  virt-v2v looks for drivers in

/usr/share/virtio-win

 

The guest will be configured to use slower emulated devices.

virt-v2v: This guest does not have virtio drivers installed.

[   7.4] Mapping filesystem data to avoid copying unused and blank areas

[   8.0] Closing the overlay

[   8.4] Checking if the guest needs BIOS or UEFI to boot

[   8.4] Assigning disks to buses

[   8.4] Copying disk 1/2 to ./out2/win7-sda (qcow2)

(100.00/100%)

[ 160.1] Copying disk 2/2 to ./out2/win7-sdb (qcow2)

(100.00/100%)

[ 162.8] Creating output metadata

[ 162.8] Finishing off

 

 

进入到out2输出目录,修改xml文件

这里首先自定义了一个桥 br1(之前已创建)

 

[root@kvm1 out2]# vim win7xml   修改桥接

<interface type='bridge'>

<source bridge='br1'/>

<model type='virtio'/>

<mac address='00:50:56:89:32:41'/>

</interface>

 

定义虚拟机

[root@kvm1 out2]# virsh define win7.xml

Domain win7 defined from win7.xml

 

[root@kvm1 out2]# virsh list --all

Id    Name                           State


-     centos7-2                      shut off

-     win7                           shut off

编辑配置文件增加vnc

[root@kvm1 out]# virsh edit win7

<graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0'>

 

Domain win7 XML configuration edited.

 

[root@kvm1 out2]# virsh  start win7

Domain win7 started

[root@kvm1 out]# ps -ef|grep kvm

Vnc连接

查看虚拟机信息

磁盘信息均正常,之前数据也都在。

驱动安装

需安装驱动。

首先下载驱动包

[root@kvm1 out2]# wget  https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso

Attach到虚拟机

[root@kvm1 out2]# virsh attach-disk win7  pwd/virtio-win-0.1.141.iso hdc --sourcetype block --driver qemu --subdriver raw --type cdrom

Disk attached successfully

完成。

ip修改

在更新完成驱动后,设置网卡ip与原来在vmware esxi中相同的时候,系统会提示如下该ip

 

已经被计算机的另一个网卡占用,但是另一个网卡在系统中被隐藏。我们需要做的时候在册表中删除该ip信息

HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Tcpip/Parameters/Interfaces中找到源ip的数值,并删除那条注册表信息即可,重新设置ip为原来的ip地址就可以了.禁用启用即可。

 

 

方法2:ova导入测试

将虚拟机导出ova格式

上传ova到本地并转换

 

[root@kvm1 test]#  virt-v2v -i ova win7.ova -o local -os ./out3/  -of qcow2

[   0.0] Opening the source -i ova win7.ova

virt-v2v: warning: making OVA directory public readable to work around

libvirt bug https://bugzilla.redhat.com/1045069

[ 142.3] Creating an overlay to protect the source from being modified

[ 143.1] Initializing the target -o local -os ./out3/

[ 143.1] Opening the overlay

[ 148.3] Inspecting the overlay

[ 150.2] Checking for sufficient free disk space in the guest

[ 150.2] Estimating space required on target for each disk

[ 150.2] Converting Windows 7 Ultimate to run on KVM

virt-v2v: warning: /usr/share/virt-tools/pnp_wait.exe is missing.

Firstboot scripts may conflict with PnP.

virt-v2v: warning: there are no virtio drivers available for this version

of Windows (6.1 x86_64 Client).  virt-v2v looks for drivers in

/usr/share/virtio-win

 

The guest will be configured to use slower emulated devices.

virt-v2v: This guest does not have virtio drivers installed.

[ 150.9] Mapping filesystem data to avoid copying unused and blank areas

[ 151.6] Closing the overlay

[ 152.1] Checking if the guest needs BIOS or UEFI to boot

[ 152.1] Assigning disks to buses

virt-v2v: warning: removable CD-ROM device in slot 0 clashes with another

disk, so it has been moved to a higher numbered slot on the same bus.  This

may mean that this removable device has a different name inside the guest

(for example a CD-ROM originally called /dev/hdc might move to /dev/hdd, or

from D: to E: on a Windows guest).

[ 152.1] Copying disk 1/2 to ./out3/win7-sda (qcow2)

(100.00/100%)

[ 275.4] Copying disk 2/2 to ./out3/win7-sdb (qcow2)

(100.00/100%)

[ 276.4] Creating output metadata

[ 276.4] Finishing off

 

剩余步骤和本地转换并启动一致。

 

 

Vmware to openstack

1、部署window虚拟机

这个迁移比较麻烦,下面步骤必须在被迁移的window虚拟机中进行。

Virtio驱动程序下载到运行vSphere Client的计算机上。将ISO附加到VM。

选择从本地导入

在Windows VM上打开“设备管理器”。然后,右键单击根设备并选择“添加旧硬件”。

点击下一步。然后选择“安装我手动选择的硬件...”并单击“下一步”。

再次单击下一步。然后,单击“从磁盘安装...”。 单击“浏览...”

 

点击“balloon”。然后,选择您的操作系统版本。 选择体系结构(x86或amd64)。然后,选择INF文件(应该只有其中一个)。 单击OK,然后单击Next,再单击Next。您可能需要确认驱动程序安装。

 

 

安装驱动程序时,您可能会收到错误消息,指出设备无法启动或无法正常工作。这是正常的,当VM在KVM管理程序上引导时,驱动程序应该能够启动。

对目录NetKVM,qemupciserial,viorng,vioscsi,vioserial和viostor重复上述过程。

如果qemupciserial驱动程序抱怨机器体系结构,则忽略错误。

最后,在VM上安装QEMU来宾代理。安装程序位于ISO文件中。 仅使用与您的体系结构匹配的安装程序(x86或x64)。

 

将Virtio驱动程序添加到Windows注册表(地址http://migration.platform9.com.s3-us-west-1.amazonaws.com/virtio.reg)

Virtio注册表文件(拷贝到本地后修改后缀名为reg)下载到VM。 然后,通过从开始菜单中搜索regedit打开Windows注册表编辑器。 单击文件 - >导入...

然后关闭虚拟机。

2、导出虚拟机ova文件

3、操作openstack

1、上传ova文件到kvm1虚拟机中进行解压并且格式转换

 

[root@kvm1 test]# ll

-rw-r--r-- 1 root root 3692941312 Aug  1 18:52 win7-1.ova

[root@kvm1 test]# tar -xvf win7-1.ova

win7-1.ovf

win7-1-disk1.vmdk

win7-1-disk2.vmdk

win7-1.mf

[root@kvm1 test]# qemu-img convert -O raw win7-1-disk1.vmdk win7-1-disk1.raw

[root@kvm1 test]# qemu-img convert -O raw win7-1-disk2.vmdk win7-1-disk2.raw

 

2、上传转换格式后的磁盘镜像文件到openstack控制节点上

[root@kvm1 test]# scp win7-1-disk1.raw win7-1-disk2.raw 192.168.6.41:/root/aa

3、在openstack控制节点上创建镜像文件

[root@controller aa]# openstack image create win7-disk1 --disk-format raw --public --file ./win7-1-disk1.raw

[root@controller aa]# openstack image create win7-disk2 --disk-format raw --public --file ./win7-1-disk2.raw

 

 

4、使用镜像win7—disk1在openstack平台上创建一个云主机实例

控制台查看虚拟机或者通过查看kvm进程找到vnc端口号,通过vnc客户端连接

无法上外网是因为openstack网络禁止连接外网。查看内网IP

 

5、使用镜像win7-disk2创建一个卷

 

6、将卷vdb连接到云主机上上

 

 

 

7、进入云主机控制台

查看之前文件。

 

 

 

 

 

 

Vmware to proxmox6

ova导入启动

 

1、首先从ESXi的管理客户端vSphere Client中把要迁移的虚拟机关机,然后选中它,在菜单“文件”-“导出”-“导出OVF模板”,然后格式选择“单个文件(OVA)”,等待导出完成。

 

2、然后就是把ova文件上传到超融合平台的节点主机上。

 

3、解压ova文件,解压出来后,得到一个ovf文件,这个文件包含了虚拟机的硬件配置,例如cpu规格、内存等和若干个vmdk文件,这些是虚拟机的硬盘镜像,数量取决于虚拟机有多少个硬盘。

tar -xvf win7.ova

 

root@prox1:/testt# tar -xvf win7.ova

win7.ovf

win7-file1.iso(之前光盘挂载的镜像,没有取消,无视)

win7-disk1.vmdk

win7-disk2.vmdk

win7.mf

 

4、在超融合节点后台使用qm importovf工具导入ovf文件,创建一个虚拟机

root@prox1:/test# qm importovf 102 win7.ovf nfs37 --format qcow2

Formatting '/mnt/pve/nfs37/images/102/vm-102-disk-0.qcow2', fmt=qcow2 size=34359738368 cluster_size=65536 preallocation=metadata lazy_refcounts=off refcount_bits=16

(100.00/100%)

Formatting '/mnt/pve/nfs37/images/102/vm-102-disk-1.qcow2', fmt=qcow2 size=4294967296 cluster_size=65536 preallocation=metadata lazy_refcounts=off refcount_bits=16

(100.00/100%)

5、在proxmox管理平台上查看虚拟机创建成功,但硬件页面看不到该虚拟机网卡配置信息

根据实际情况添加网卡,本例虚拟机只有一个网卡。

 

 

6、在后台修改虚拟机配置文件

改为ide

root@prox1:/test# cat /etc/pve/qemu-server/102.conf

bootdisk: ide0

cores: 4

memory: 4096

name: win7

net0: e1000=46:7C:AE:F5:CF:F6,bridge=vmbr0,firewall=1

ide0: nfs37:102/vm-102-disk-0.qcow2

ide1: nfs37:102/vm-102-disk-1.qcow2

smbios1: uuid=b67b54aa-0397-4056-a3d1-d88d218d03eb

vmgenid: af37555a-91f5-4f4f-bc53-4cd5b37ddc30

7、开启虚拟机,查看虚拟机磁盘信息和网卡信息,以及之前数据都在。

 

PCI驱动安装,查看设备管理器,发现有驱动没安装

虚拟机硬件加载光驱,并指定驱动iso(下载地址:参考Vmware to local本地转换测试)

手动更新驱动

即可。

posted on 2019-08-08 16:17  歪歪121  阅读(1950)  评论(0)    收藏  举报