虚拟机冷迁移

192.168.126.6虚拟机迁移到192.168.168.66

192.168.126.6
[root@zxw6 qemu]# virsh list --all
Id 名称 状态
----------------------------------------------------
- centos7.0 关闭

192.168.126.66
[root@zxw66 images]# virsh list --all
Id 名称 状态
----------------------------------------------------


第一步:发送配置文件
[root@zxw6 qemu]# scp centos7.0.xml 192.168.126.66:/root

第二步:查看磁盘所在路径
[root@zxw6 qemu]# virsh edit centos7.0
<devices>
<emulator>/usr/libexec/qemu-kvm</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/var/lib/libvirt/images/centos7.0.qcow2'/>
<target dev='vda' bus='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>

第三步:发送磁盘
[root@zxw6 images]# scp centos7.0.qcow2 192.168.126.66:/root

第四步:登录到192.168.126.66
[root@zxw6 ~]# ssh 192.168.126.66


第五步:移动磁盘
[root@zxw66 ~]# mv centos7.0.qcow2 /var/lib/libvirt/images/

第六步:回复虚拟机
[root@zxw66 ~]# virsh define centos7.0.xml
定义域 centos7.0(从 centos7.0.xml)

[root@zxw66 ~]# virsh list --all
Id 名称 状态
----------------------------------------------------
- centos7.0 关闭
第七步:查看使用
[root@zxw66 ~]# virsh start centos7.0
域 centos7.0 已开始

[root@zxw66 ~]# virsh list --all
Id 名称 状态
----------------------------------------------------
1 centos7.0 running

 

posted on 2019-08-08 09:08  我就是我没毛病  阅读(680)  评论(0编辑  收藏  举报

导航