1

I’m learning how to fence pacemaker using fence_virtualbox from [ClusterLabs] Fence agent for VirtualBox, but I can’t get it working. When I try to run stonith_admin –-reboot <node id> it failed.

Currently, my setup is:

Node ID:        VM name:
orcllinux1      OL7
orcllinux2      OL7_2

I set it up using:

pcs stonith create fence_vbox fence_virtualbox pcmk_host_map=”orcllinux1:OL7,orcllinux2:OL7_2” pcmk_host_list=”orcllinux1,orcllinux2” pcmk_host_check=static_list ipaddr=”192.168.57.1” login=”root”

But stonith_admin –-reboot <node id> resulting in this error: Error

I tried to use the fence_virtualbox manually using:

fence_virtualbox -s 192.168.57.1 -p OL7 -o=reboot

and it succeeded.

Is my stonith create syntax wrong? What's the right syntax if it's wrong?

  • I resort to change my virtual guest name accordingly with my node ID (orcllinux1 and orcllinux2). Then I add it using `pcs stonith create fence_vbox fence_virtualbox ipaddr=”192.168.57.1"`. This works perfectly when I run `stonith_admin –-reboot ` but still doesn't answer my question (if it's different name with node ID). Any further help would be appreciated. – Christophorus Reyhan Jan 11 '21 at 03:46

1 Answers1

0

This worked for me:

pcs stonith create myfence_vbox fence_vbox identity_file=/root/.ssh/id_rsa ipaddr=192.168.1.20 login=bk201 host_os=linux pcmk_host_map="node1:6051319b-6d94-4469-93ec-b918d047e849 node2:8cbc8c1c-2da0-4ae6-a902-fcc15dfa7745"

To get a list of UUIDs for each VM, run: fence_vbox -o list -l bk201 -x -a 192.168.1.20 -k /root/.ssh/id_rsa

Tested with stonith_admin --reboot node2 from node1 and node2 rebooted.

bk201
  • 166
  • 1
  • 1
  • 8
  • This use fence_vbox stonith agent instead of fence_virtualbox. I don't know if it has the same functionality. – Christophorus Reyhan Feb 16 '21 at 06:49
  • Ah yeah it is different, this fence_vbox is the one supplied by Clusterlabs: https://github.com/ClusterLabs/fence-agents/tree/master/agents/vbox – bk201 Feb 16 '21 at 22:16