在VirtualBox中迁移CentOS虚拟机的步骤如下:
源主机的启动命令示例:
./qemu-system-x86_64 -m 512 -hda /home/yangguang/nfs_mnt/images/debian_lenny_i386_small.qcow2 -net tap -net nic,model=rtl8139 -vnc :1 -monitor stdio
目的虚拟机的启动命令示例:
./qemu-system-x86_64 -m 512 -hda /home/yangguang/nfs_mnt/images/debian_lenny_i386_small.qcow2 -net tap -net nic,model=rtl8139 -vnc :1 -monitor stdio -incoming tcp:0:8888
(qemu) help migratemigrate [-d] [-b] [-i] uri -- migrate to URI (using -d to not wait for completion)
-b for migration without shared storage with full copy of disk
-i for migration without shared storage with incremental copy of disk (base image shared between src and destination)
(qemu) migrate -d tcp:10.60.1.92:8888
paused
,目的虚拟机状态会变为running
。此时,迁移完成,源虚拟机可以退出。以上就是在VirtualBox中迁移CentOS虚拟机的基本步骤,需要注意的是,在进行虚拟机迁移时,应确保虚拟机内部服务的中间时间以及整个虚拟机迁移的时间尽可能短,以减少服务中断时间。