Designing a custom Fencing device

robertut

Member
Sep 20, 2022
41
11
8
Dear community and Proxmox support/devs!

Looking at the documentation at the time of this post, I see rather expensive solutions being available for fencing. It's either APC PDU or MasterSwitch, managed switch (only for network going through that), UPS and IPMI, which may be missing from certain hardware connfigurations. These seem cumbersome solutions and are specific to certain configurations and environments.

Would be nice to have something more universal and affordable, and I thought I'd build my own. Something independent which could be used in any environment.

My intention is to have a fencing device based on an ESP32 MCU, with the following features:
  • would be able to drive a number of relays having NC (normally closed) contacts, which when triggered, interrupt the circuit (cut the power to the servers). The relay stays idle normally, letting power through, only cuts power when triggered.
  • optionally the relays could de-engage automatically by themselves (eg. only one command would be needed to trigger fencing, power would be restored after some seconds automatically)
  • multiple relays could act in parallel for servers with multiple power supplies connected to different power sources/phases
  • would have a web UI and a REST-like API to trigger the relays (eg. with a POST request to hxxp: / /MCU . IP . ADDRESS/switch/relay_num_X/turn_on)
  • would be possible to use multiple such devices with relays connected in series for functional redundancy, each on different IP address (to be 100% sure that if for some reason a fencing device fails, there are more on the line which can do the job)
  • eventually, since ESP32 has 3 UARTs, we could connect to the device via RS232 from each server if we want to exclude the switch as a single point of failure between the servers and the fencing device. This would limit of course the usability to clusters with 3 nodes, and not sure it's worth the effort, since if the switch is dead, maybe there's no need for fencing in the first place as everything is already fenced and all site is down... (+extra circuitry would be needed due to UART-RS233 TTL level shifting)
  • Rack enclosure, IEC connectors to loop power through etc.
What are your thoughts? How difficult would be to add a configuration to Proxmox to trigger fencing for example with a parametrized curl command sending a POST request? (optionally with User-Agent, Digest authorization, etc)
 
Last edited:
Looking at the documentation at the time of this post, I see rather expensive solutions being available for fencing.
Each server I know and use has a management interface which does a lot of stuff including fencing.

Besides that being said, your idea should work and every "fencing device for cheap hardware" I tried a few decades ago worked similarly. In previous PVE versions, there was the intergration of manual fencing commands and I thought this was completely replaced by the new "in system" fencing method.
 
For example HP stuff Ilo etc are unreliable...

There's no way to use custom fencing commands like I described above? A curl, echo etc commands or run a shell script to fence?
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!