forked from samli008/kvm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fence_virtd
executable file
·66 lines (52 loc) · 1.59 KB
/
fence_virtd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# config fence virtd on kvm host
yum -y install fence-virtd fence-virtd-multicast fence-virtd-libvirt fence-virt*
mkdir -p /etc/cluster
echo fecb9e62cbcf4e54dcfb > /etc/cluster/fence_xvm.key
fence_virtd -c
systemctl enable fence_virtd
systemctl start fence_virtd
systemctl status fence_virtd
fence_xvm -o list
fence_xvm -o off -H vm1
fence_xvm -o on -H vm1
fence_xvm -o reboot -H vm1
fence_xvm -o status -H vm1
# config pcs stonith on kvm-guest-vm
yum -y install fence-virt
mkdir -p /etc/cluster
echo fecb9e62cbcf4e54dcfb > /etc/cluster/fence_xvm.key
# view vm list on kvm-guset-vm, must need vm-bridge has ip address
fence_xvm -o list
pcs property set stonith-enabled=true
pcs stonith create fence1 fence_xvm multicast_address=225.0.0.12
pcs stonith create fence2 fence_xvm multicast_address=225.0.0.12
pcs stonith show
pcs stonith fence vm2
# fence_xvm on openvswtich networking
## add tap on physical host
ip link add br-tap100 type veth peer name tap100
ovs-vsctl add-port br100 br-tap100
ovs-vsctl set port br-tap100 tag=200
ip addr add 192.168.20.11/24 dev tap100
ip link set tap100 up
ip link set br-tap100 up
## fence_virtd -c and cat /etc/fence_virt.conf
fence_virtd {
listener = "multicast";
backend = "libvirt";
module_path = "/usr/lib64/fence-virt";
}
listeners {
multicast {
key_file = "/etc/cluster/fence_xvm.key";
address = "225.0.0.12";
interface = "tap100";
family = "ipv4";
port = "1229";
}
}
backends {
libvirt {
uri = "qemu:///system";
}
}