KVM虚拟机迁移至VMware

1.将kvm下虚拟机关机;

[root@localhost ~]# virsh list --all
 Id    Name                           State
----------------------------------------------------
 -     gamedev10                      shut off
 -     gamedev11                      shut off
 -     gamedev12                      shut off
 -     gamedev13                      shut off
 -     gamedev2                       shut off
 -     gamedev6                       shut off
 -     gamedev7                       shut off
 -     gamedev8                       shut off
 -     gamedev9                       shut off
 -     gamedevtpl                     shut off
 -     yunwei                         shut off

 

2.将kvm下img文件格式的虚拟机转换成vmdk格式,命令如下:

qemu-img convert /data/img/gamedev2.dsk  -O vmdk /data/img/gamedev2.vmdk 

#转换完成后会有一个 gamedev2.vmdk 的文件,将此文件上传到VMware vSphere

#/data/img/  磁盘文件的路径
[root@localhost ~]# ls /data/img/
gamedev10.dsk  gamedev12.dsk  gamedev2.vmdk  gamedev7.dsk  gamedev9.dsk    git.dsk
gamedev11.dsk  gamedev2.dsk   gamedev6.dsk   gamedev8.dsk  gamedevtpl.dsk  test.img

 

3.在VMware vSphere环境里创建一个虚拟机 “选择自定义”,不用创建磁盘使用刚刚转换的vmdk文件,开启虚拟机即可

IP地址可能会变,配置IP

[root@pub network-scripts]# mv ifcfg-eth0 ifcfg-ens160
[root@pub network-scripts]# vim ifcfg-ens160 
 TYPE="Ethernet"
 BOOTPROTO="none"
 DEFROUTE="yes"
 IPV4_FAILURE_FATAL="no"
 IPV6INIT="yes"
 IPV6_AUTOCONF="yes"
 IPV6_DEFROUTE="yes"
 IPV6_FAILURE_FATAL="no"
 IPV6_ADDR_GEN_MODE="stable-privacy"
 NAME="ens160"
 UUID="bf79d93a-2c0e-418d-a341-a2268c5e7da0"
 DEVICE="ens160"
 ONBOOT="yes"
 IPADDR=10.0.3.44
 NETMASK=255.255.255.0
 GATEWAY=10.0.3.1
[root@pub network-scripts]# /etc/init.d/network restart

 

 

转载自:https://www.cnblogs.com/root0/p/9409264.html

你可能感兴趣的:(OpenStack)