Skip to content

Commit 473a7ca

Browse files
author
Mihaela Blendea
committed
Add VMware fencing agent to HA samples
1 parent 3aadfa5 commit 473a7ca

File tree

7 files changed

+67
-0
lines changed

7 files changed

+67
-0
lines changed
100 KB
Loading
71.7 KB
Loading
85.6 KB
Loading
29.5 KB
Loading
37.1 KB
Loading
82.6 KB
Loading
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Configure STONITH With fence_vmare Fencing Agent
2+
3+
>[!NOTE]
4+
>All examples of using fencing agent for vmware in [RHEL documentation](https://access.redhat.com/solutions/306233) are with `-ssl` option ( or `-z`). That “Default” behavior has changed from just checking any certificate to just signed certs that can be validated. Hence in testing use the `–ssl-insecure`. Can use default if you have a valid certificate.
5+
6+
## Manually Test Fencing Device
7+
8+
The options that are passed in the example below have the following usage: `-a` is IP of Vsphere, `-l` is username, `-p` is password, `-n` is node name you want to fence. Can use `-v` as verbose mode to debug.
9+
10+
```bash
11+
sudo cd /sbin
12+
sudo ./fence_vmware_soap -a 172.16.50.50 -l stonithuser -p 'MyStrongPassword1!' --ssl-insecure --action status -n esxi-rhel7-c
13+
```
14+
Output:
15+
```bash
16+
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:769: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html
17+
Status: ON
18+
```
19+
20+
## Create Fencing Agent Resource
21+
22+
To create the resource run the following commands:
23+
```bash
24+
sudo pcs stonith create esxi-rhel7-c_fence fence_vmware_soap ipaddr=172.16.50.50 ssl_insecure=1 login=stonithuser passwd='MyStrongPassword1!' pcmk_host_list=esxi-rhel7-c
25+
```
26+
27+
## Check Status
28+
29+
Run the following commands to check the status of the cluster nodes and reources:
30+
```bash
31+
sudo pcs status
32+
```
33+
Sample output:
34+
```bash
35+
3 nodes and 5 resources configured
36+
37+
38+
Full list of resources:
39+
40+
Master/Slave Set: ag_cluster-master [ag_cluster]
41+
Masters: [ dl380g7-07 ]
42+
Slaves: [ dl380g7-08 ]
43+
Stopped: [ esxi-rhel7-c ]
44+
virtualip (ocf::heartbeat:IPaddr2): Started dl380g7-07
45+
esxi-rhel7-c_fence (stonith:fence_vmware_soap): Started dl380g7-08
46+
```
47+
48+
## Testing
49+
50+
```bash
51+
sudo pcs stonith fence esxi-rhel7-c
52+
```
53+
You can see it will turn the VM off and then back on:
54+
![Stonith action](../../../../../../media/features/high-availability/stonith-action.png "Stonith action")
55+
56+
## VMware Permissions
57+
58+
On VMware vSphere, in order to use limited set of permissions, create a specific user in ESXI to not use root:
59+
![Create user](../../../../../../media/features/high-availability/create-user-vmware.png "Create user")
60+
61+
Created a Role with only subset of permissions:
62+
![Create role](../../../../../../media/features/high-availability/create-role-vmware.png "Create role")
63+
64+
Tie the 2 together aka assign user to the role:
65+
![Assign user to role](../../../../../../media/features/high-availability/assign-user-to-role-vmware.png "Assign user to role")
66+
![Manage permissions](../../../../../../media/features/high-availability/manage-permissions1-vmware.png "Manage permissions")
67+
![Manage permissions](../../../../../../media/features/high-availability/manage-permissions2-vmware.png "Manage permissions")

0 commit comments

Comments
 (0)