当前位置:网站首页>KVM hot migration for KVM virtual management

KVM hot migration for KVM virtual management

2022-06-13 05:11:00 I love Qianxi

I can't write down the last article , Fill in this article

kvm Virtual management kvm Heat transfer


The principle of heat transfer is as follows :

If you want to migrate a running virtual machine, you must use shared storage , Mount the disk on shared storage , Anyone who wants to use it can mount it

 Insert picture description here
The environment configuration of the three machines is as follows :
 Insert picture description here
stay nfs The file configuration on the host is as follows

[[email protected] data]# vim /etc/exports
#shared dir
/data 192.168.119.0/24(rw,async,no_root_squash,no_all_squash)

On both sides kvm Test on the virtual machine

[[email protected] ~]# showmount -e 192.168.119.129
Export list for 192.168.119.129:

[[email protected] ~]# showmount -e 192.168.119.146
Export list for 192.168.119.146:

Mount the path of the disk file on the two host computers to nfs Of /data Catalog

[[email protected] images]# cd /data/
[[email protected] data]# ls
nebula1.qcow2  nebula1.xml
[[email protected] data]# mount -t nfs 192.168.119.7:/data /home/images
[[email protected] data]# mv /data/nebula1.qcow2 /home/images/

[[email protected] ~]# mount -t nfs 192.168.119.7:/data /home/images/

And then nfs View on the host

[[email protected] data]# ll -h
total 1.7G
-rw-------. 1  107  107 11G May  6  2021 nebula1.qcow2
qemu Put in UID Namely 107

Install on the first host kvm virtual machine

[[email protected] data]# virt-install --virt-type kvm --os-type=linux --name web01 --memory 1024 --vcpus 1,maxvcpus=10 --cdrom=/home/iso/CentOS-7-x86_64-Minimal-1708.iso  --disk /home/images/web01.qcow2,size=10 --network bridge=virbr0 --graphics vnc,listen=0.0.0.0 --noautoconsole --check disk_size=off

Starting install...
Allocating 'web01.qcow2'                                                                                 |  10 GB  00:00:00
Domain installation still in progress. You can reconnect to the console to complete the installation process.

View the disk file on the second host , prove nfs Shared storage succeeded

[[email protected] ~]# ls /home/images/
nebula1.qcow2  web01.qcow2

Do it on two hosts host analysis , Add the following

192.168.119.146 kvm
192.168.119.129 backup

And then in kvm Do the migration above , Check again virsh list,kvm The virtual machines are gone , Moved to backup Up there

[[email protected] data]# virsh migrate --live --verbose web01 qemu+ssh://192.168.119.129/system --unsafe

Parameter interpretation :

migrate Migration means
- -live Running state migration
- -verbose Which one to migrate Kvm virtual machine
qemu+ssh://192.168.119.129/system qemu+ssh authentication ,IP by backup Of IP
- -unsafe This parameter must be added , Otherwise, it will report a mistake , Do not allow migration

原网站

版权声明
本文为[I love Qianxi]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202280515161087.html