系统相关
首页 > 系统相关> > KVM虚拟机迁移至VMWare ESXi

KVM虚拟机迁移至VMWare ESXi

作者:互联网

需求

由于服务器迁移,为维护方便,将统一使用vmware 平台管理虚拟机,因此需将kvm 虚拟机统一迁至vmware

kvm 磁盘镜像转换

# virsh list --all
 Id    Name                           State
----------------------------------------------------
 180   CentOS7.8-x86_64-10.65.6.61    running
# virsh edit  CentOS7.8-x86_64-10.65.6.61
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/export/kvm_images/volume-3cd374e0-bdd0-43d9-b1d3-edc694a05b13.qcow2'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </disk>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source file='/export/kvm_images/volume-3cd374e0-bdd0-43d9-b1d3-edc694a05b13-1.qcow2'/>
      <target dev='vdb' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
    </disk>
  </devices>
# mkdir /export/covert-test 
# cd /export/covert-test
# qemu-img convert -f qcow2 /export/kvm_images/volume-3cd374e0-bdd0-43d9-b1d3-edc694a05b13.qcow2   -O vmdk test-91-61-os.vmdk -o  compat6   
# qemu-img convert -f qcow2  /export/kvm_images/volume-3cd374e0-bdd0-43d9-b1d3-edc694a05b13-1.qcow2  -O vmdk  test-91-61-data.vmdk -o  compat6     
# scp vmdk test-91-61-os.vmdk  test-91-61-data.vmdk 10.65.0.90:/vmfs/volumes/SATA/convert-test
# vmkfstools -i test-91-61-os.vmdk  -d thin   test-91-20-os-v1.vmdk
Destination disk format: VMFS thin-provisioned
Cloning disk 'test-91-61-os.vmdk'...
Clone: 100% done.

# vmkfstools -i test-91-61-data.vmdk -d thin  test-91-20-data-v1.vmdk
Destination disk format: VMFS thin-provisioned
Cloning disk 'test-91-61-data.vmdk'...
Clone: 100% done.

# ls /vmfs/volumes/SATA/convert-test
test-91-20-data-v1-flat.vmdk  test-91-20-os-v1-flat.vmdk    test-91-61-data.vmdk
test-91-20-data-v1.vmdk       test-91-20-os-v1.vmdk         test-91-61.vmdk

创建vmware 虚拟机

标签:61,ESXi,虚拟机,KVM,91,vmdk,test,vmware
来源: https://www.cnblogs.com/lixinliang/p/16288254.html