1、 虚拟机vmvare准备
迁移的过程如下:
1. 登录宿主机,在 VMwareWorkstation上检查 A 虚拟机,如果安装了 VMware Tools,以 root用户运行 vmware-uninstall-tools.pl卸载它。
卸载:
/vmware-tools-distrib/bin/vmware-uninstall-tools.pl
2. 关闭 A虚拟机。
3. 检查虚拟机的镜像文件。本例中,虚拟机的镜像存储在多个 vmdk文件中,所以需要在迁移前合并他们。
vmware-vdiskmanager.exe -r sourceDisk.vmdk -t 0 destinationDisk.vmdk
参数介绍:
-r<source-disk> : convert thespecified disk; need to specify
destinationdisk-type. For local destination disks
the disk type mustbe specified.
-t <disk-type> : disk type id
Disk types:
0 : single growable virtual disk
ex : vmware-vdiskmanager.exe -r sourceDisk.vmdk -t 0 destinationDisk.vmdk
2、 格式转换
使用linux系统
1.#yum install qemu-img –y2.【qemu-img info source-name.vmdk 查看虚拟机信息】#qemu-img info Ubuntu-64-bit_12.04_EJBCA.vmdk3.【转换虚拟机格式,将vmdk转换为qcow2qemu-img convert -f vmdk -O qcow2 source-name.vmdk target-name.qcow2 】#qemu-img convert -f vmdk -O qcow2 Ubuntu-64-bit_12.04_EJBCA.vmdk ubuntu-EJBCA.qcow24. 【转换虚拟机格式,将vmdk压缩转换为qcow2qemu-img convert -c -f vmdk -O qcow2 source-name.vmdk target-name.qcow2】