1, Method of installing fence-agents on linux:
$ git clone https://github.com/ClusterLabs/fence-agents
$ cd fence-agents
$ ./autogen.sh && ./configure && make && sudo make install
2, Method of installing kvm packages and creating VMs:
# yum –y install qemu-kvm qemu-img bridge-utils
# yum –y install libvirt virt-install virt-manager
# systemctl start libvirtd
And I created VMs manually with “virtual machine manager” GUI.
3, Fencing KVM Virtual Servers:
(1)first, prepare two physical hosts, each create one vm on them.
HOST_A(ip:10.108.125.112) kvmcentos7(ip:192.168.122.184, belong to HOST_A)
HOST_B(ip:10.108.126.182)
kvmubuntu1404(ip:192.168.122.197, belong to HOST_B)
(2) install fence-agents on the two vms.
(3) on HOST_A, use ssh login ‘kvmcentos7’, and exec “fence_virsh” command to reboot ‘kvmubuntu1404’.
(4) on HOST_B, use ssh login ‘kvmubuntu1404’, exec “fence_virsh” command to reboot ‘kvmcentos7’.