<?xml version="1.0"?>
<cluster config_version="57" name="HA">
<clusternodes>
<clusternode name="cluster1" nodeid="1">
<fence>
<method name="1">
<device name="VBoxManage" vmname="Cluster1"/>
</method>
</fence>
</clusternode>
<clusternode name="cluster2" nodeid="2">
<fence>
<method name="1">
<device name="VBoxManage" vmname="Cluster2"/>
</method>
</fence>
</clusternode>
</clusternodes>
<cman expected_votes="1" two_node="1"/>
<rm>
<failoverdomains>
<failoverdomain name="HA" ordered="1" restricted="1">
<failoverdomainnode name="cluster1" priority="1"/>
<failoverdomainnode name="cluster2" priority="2"/>
</failoverdomain>
</failoverdomains>
<resources>
<ip address="192.168.1.151/24" sleeptime="10"/>
<drbd name="DRBD" resource="r0"/>
<nfsserver name="NFS"/>
<fs device="/dev/drbd0" force_unmount="1" fsid="9595" fstype="ext4" mountpoint="/media/nfs" name="/media/nfs" nfsrestart="1" options="noatime" self_fence="1"/>
</resources>
<service domain="HA" exclusive="1" max_restarts="2" name="HA" recovery="restart" restart_expire_time="30">
<ip ref="192.168.1.151/24">
<drbd ref="DRBD">
<fs ref="/media/nfs">
<nfsserver ref="NFS"/>
</fs>
</drbd>
</ip>
</service>
</rm>
<fencedevices>
<fencedevice agent="fence_vbox" login="kamui0523" name="VBoxManage" vboxhost="192.168.0.128"/>
</fencedevices>
</cluster>
=======================================================================================
fence_vbox的要求如下
1.guest需要能够不通过密码ssh到host机.
2.需要确认vbox的运行用户,比如这里是kamui0523
fence_vbox测试
fence_vbox -s 192.168.1.100 -g Cluster1 -a status
-s为host机的ip地址,-g是vbox的VMName