[TUTORIAL] Cluster made of permanent + adhoc nodes

silverstone

Active Member
Apr 28, 2018
11
0
41
35
Hi,

I wanted to share my bits with you concerning my home lab cluster made of:
- Permanent on-state machines
- Ad-hoc machines (in order to reduce power consumption)

Of course, besides the "usual" problems of voting (solved by assigning a much higher number of votes to the permanently-on machines), also a communication problem occurs if you try to power on a ad-hoc host which features an older version of corosync.

I solved this problem by running this script (manually) whenever the adhoc machine is not recognised in the web interface:
Code:
#!/bin/bash

# Host to import from
source="192.168.1.231"

# Enter local mode
systemctl stop pve-cluster
/usr/bin/pmxcfs -l

# Backup file
mkdir -p /etc/corosync/backups

prefix=`date '+%Y%m%d_%H%M%S'`
cp /etc/corosync/corosync.conf /etc/corosync/backups/corosync-$prefix.conf

# Copy new file from source
scp root@$source:/etc/corosync/corosync.conf /etc/corosync/corosync.conf

# End local mode
killall pmxcfs

# Restart pve-cluster and corosync
systemctl restart pve-cluster
systemctl restart corosync

This downloades the "corosync.conf" from a (supposedly sane) permanent on machine and replaces the local corosync.conf (old) so that the machine can become active again in the cluster. No check on the corosync version is performed. Possibly the proper way to do this would be to try to fetch all corosync from all cluster nodes and decide with votes which is the latest / most reliable / ... :cool:

I'm not even sure why Proxmox didn't include this feature by default o_O

I know this is not officially supported by Proxmox Developers, but if somebody is interested, please add this to the wiki if you feel interested. I don't know where/if I can create wiki pages so :(
 

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!