On 2020-09-11 3:02 a.m., Marius Wilhelm wrote: > Hello, > > Since the fence_virtd didnt work Ive wrote an own script which does this > job. > Now I just want to write an agent which executes the script as soon as a > Node goes to the offline state. > Im pretty new to pacemaker so I probably just doing some stupid mistakes. > Could you give me a simple and short tutorial for that? > > Best regards > Marius Wilhelm
Hi Marius, Have you tried fence_virsh or fence_xvm? You shouldn't need to write a fence agent in practice. To answer your question though, you need to write an agent that follows the FenceAgentAPI; https://github.com/ClusterLabs/fence-agents/blob/master/doc/FenceAgentAPI.md The main components are that command line switches (used when called manually) need to have 'variable=value' equivalents that the agents reads by STDIN as well (one pair per line). The agent can internally work however you want, but communicates success/failure/status via exit/return codes. It's generally pretty easy to write. You can use any agent you want, so the packagers prefer agents be in python, should you wish to have the agent later added to the fence_agents packages. digimer -- Digimer Papers and Projects: https://alteeve.com/w/ "I am, somehow, less interested in the weight and convolutions of Einstein’s brain than in the near certainty that people of equal talent have lived and died in cotton fields and sweatshops." - Stephen Jay Gould _______________________________________________ Manage your subscription: https://lists.clusterlabs.org/mailman/listinfo/developers ClusterLabs home: https://www.clusterlabs.org/