[root@k-node2 ~]# yum install centos-release-qemu-ev #<--生成yum源文件 [root@k-node2 yum.repos.d]# ll CentOS-QEMU-EV.repo -rw-r--r-- 1 root root 514 5月 10 22:33 CentOS-QEMU-EV.repo [root@k-node2 yum.repos.d]# rpm -qa|grep kvm libvirt-daemon-kvm-3.2.0-14.el7_4.9.x86_64 qemu-kvm-common-1.5.3-141.el7_4.6.x86_64 qemu-kvm-1.5.3-141.el7_4.6.x86_64 [root@k-node2 yum.repos.d]# vim CentOS-QEMU-EV.repo # CentOS-QEMU-EV.repo # # Please see http://wiki.centos.org/SpecialInterestGroup/Virtualization for more # information [centos-qemu-ev] name=CentOS-$releasever - QEMU EV baseurl=http://mirror.centos.org/centos/$releasever/virt/$basearch/kvm-common/ gpgcheck=1 enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Virtualization [centos-qemu-ev-test] name=CentOS-$releasever - QEMU EV Testing baseurl=http://buildlogs.centos.org/centos/$releasever/virt/$basearch/kvm-common/ gpgcheck=0 enabled=0 [root@k-node2 yum.repos.d]# yum repolist [root@k-node2 yum.repos.d]# yum install qemu-kvm-ev [root@k-node2 ~]# rpm -qa |grep kvm qemu-kvm-ev-2.9.0-16.el7_4.14.1.x86_64 libvirt-daemon-kvm-3.2.0-14.el7_4.9.x86_64 qemu-kvm-common-ev-2.9.0-16.el7_4.14.1.x86_64 [root@master ~]# virsh Welcome to virsh, the virtualization interactive terminal. Type: 'help' for help with commands 'quit' to quit virsh # start centos7.1 域 centos7.1 已开始 virsh # migrate centos7.1 qemu+ssh://master.kvm.com/system --live --persistent --undefinesource --copy-storage-all --verbose root@master.kvm.com's password: 迁移: [100 %]
目标主机:
[root@master ~]# yum install centos-release-qemu-ev [root@master yum.repos.d]# ll CentOS-QEMU-EV.repo -rw-r--r--. 1 root root 514 May 10 22:33 CentOS-QEMU-EV.repo [root@master yum.repos.d]# vim CentOS-QEMU-EV.repo # CentOS-QEMU-EV.repo # # Please see http://wiki.centos.org/SpecialInterestGroup/Virtualization for more # information [centos-qemu-ev] name=CentOS-$releasever - QEMU EV baseurl=http://mirror.centos.org/centos/$releasever/virt/$basearch/kvm-common/ gpgcheck=1 enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Virtualization [centos-qemu-ev-test] name=CentOS-$releasever - QEMU EV Testing baseurl=http://buildlogs.centos.org/centos/$releasever/virt/$basearch/kvm-common/ gpgcheck=0 enabled=0 [root@master yum.repos.d]# yum repolist [root@master yum.repos.d]# yum install qemu-kvm-ev [root@master ~]# rpm -qa |grep kvm qemu-kvm-ev-2.9.0-16.el7_4.14.1.x86_64 libvirt-daemon-kvm-3.2.0-14.el7_4.9.x86_64 qemu-kvm-common-ev-2.9.0-16.el7_4.14.1.x86_64 创建存储池 [root@master ~]# virsh Welcome to virsh, the virtualization interactive terminal. Type: 'help' for help with commands 'quit' to quit virsh # pool-define-as vm dir --target "/vm" Pool vm defined virsh # pool-start vm Pool vm started virsh # pool-autostart vm Pool vm marked as autostarted [root@master vm]# virsh list --all Id Name State ---------------------------------------------------- 1 centos7.1 running - centos6.7 shut off - centos6.7-1 shut off - centos6.7-2 shut off [root@master vm]# sar -n DEV 1 Linux 3.10.0-514.el7.x86_64 (master.kvm.com) 05/17/2018 _x86_64_ (2 CPU) 11:42:05 AM IFACE rxpck/s txpck/s rxkB/s txkB/s rxcmp/s txcmp/s rxmcst/s 11:42:06 AM vnet1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 11:42:06 AM eth0 20938.00 402.00 30919.13 27.26 0.00 0.00 0.00 11:42:06 AM lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00 11:42:06 AM virbr0-nic 0.00 0.00 0.00 0.00 0.00 0.00 0.00 11:42:06 AM virbr0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 11:42:06 AM vnet0 0.00 0.00 0.00 0.00 0.00 0.00 0.00
原文地址:http://blog.51cto.com/stuart/2118989