[TUTORIAL] Cluster made of permanent + adhoc nodes

Discussion in 'Proxmox VE: Installation and configuration' started by silverstone, Apr 21, 2019.

  1. silverstone

    silverstone New Member

    Joined:
    Apr 28, 2018
    Messages:
    3
    Likes Received:
    0
    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 :(
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice