Files
loc_az_hci/infrastructure/proxmox/UPDATE_CLUSTER_IPS.md
defiQUG c39465c2bd
Some checks failed
Test / test (push) Has been cancelled
Initial commit: loc_az_hci (smom-dbis-138 excluded via .gitignore)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-08 09:04:46 -08:00

4.4 KiB

Update Proxmox Cluster IP Addresses

Overview

When a Proxmox node's IP address changes, you need to update the cluster configuration so nodes can communicate with each other.

Current IP Addresses

  • pve (ML110): 192.168.1.207
  • pve2 (R630): 192.168.1.55

Files to Update

  1. /etc/hosts - Hostname resolution
  2. /etc/pve/corosync.conf - Cluster communication configuration

Manual Update Steps

Step 1: Update /etc/hosts on Both Nodes

On pve (ML110 - 192.168.1.207):

# Edit /etc/hosts
nano /etc/hosts

# Add or update entry for pve2:
192.168.1.55    pve2 pve2.local

# Save and exit

On pve2 (R630 - 192.168.1.55):

# Edit /etc/hosts
nano /etc/hosts

# Add or update entry for pve:
192.168.1.207   pve pve.local

# Save and exit

Step 2: Update corosync.conf on Both Nodes

On pve (ML110):

# Backup first
cp /etc/pve/corosync.conf /etc/pve/corosync.conf.backup

# Edit corosync.conf
nano /etc/pve/corosync.conf

# Find the node entries and update ring0_addr:
# Change pve2's ring0_addr to: 192.168.1.55
# Keep pve's ring0_addr as: 192.168.1.207

# Example corosync.conf:
totem {
    version: 2
    cluster_name: your-cluster-name
    config_version: 2
    interface {
        ringnumber: 0
        bindnetaddr: 192.168.1.0
        mcastport: 5405
        ttl: 1
    }
}

nodelist {
    node {
        name: pve
        nodeid: 1
        quorum_votes: 1
        ring0_addr: 192.168.1.207
    }
    node {
        name: pve2
        nodeid: 2
        quorum_votes: 1
        ring0_addr: 192.168.1.55
    }
}

quorum {
    provider: corosync_votequorum
}

logging {
    to_logfile: yes
    logfile: /var/log/corosync/corosync.log
    to_syslog: yes
}

On pve2 (R630):

# Backup first
cp /etc/pve/corosync.conf /etc/pve/corosync.conf.backup

# Edit corosync.conf
nano /etc/pve/corosync.conf

# Update ring0_addr entries as shown above

Step 3: Restart Cluster Services

On BOTH nodes, restart cluster services:

systemctl restart corosync
systemctl restart pve-cluster

Important: Restart on one node at a time, wait for it to stabilize, then restart on the other node.

Step 4: Verify Cluster Status

On either node:

# Check cluster status
pvecm status

# List nodes
pvecm nodes

# Check cluster membership
corosync-quorumtool -s

Automated Update Script

Use the provided script to automate the update:

cd infrastructure/proxmox
./update-cluster-ips.sh

This script will:

  • Backup existing files
  • Update /etc/hosts on both nodes
  • Update corosync.conf on both nodes
  • Optionally restart cluster services

Quick Update Commands

Update /etc/hosts Only

On pve (ML110):

grep -q "pve2" /etc/hosts && \
  sed -i 's/.*pve2/192.168.1.55    pve2 pve2.local/' /etc/hosts || \
  echo "192.168.1.55    pve2 pve2.local" >> /etc/hosts

On pve2 (R630):

grep -q "pve" /etc/hosts && \
  sed -i 's/.*pve /192.168.1.207   pve pve.local /' /etc/hosts || \
  echo "192.168.1.207   pve pve.local" >> /etc/hosts

Update corosync.conf ring0_addr

On both nodes:

# Backup
cp /etc/pve/corosync.conf /etc/pve/corosync.conf.backup

# Update pve IP
sed -i 's/ring0_addr:.*pve$/ring0_addr: 192.168.1.207/' /etc/pve/corosync.conf

# Update pve2 IP
sed -i 's/ring0_addr:.*pve2$/ring0_addr: 192.168.1.55/' /etc/pve/corosync.conf

# Verify changes
grep ring0_addr /etc/pve/corosync.conf

Verification

After updating, verify on both nodes:

# Check /etc/hosts
cat /etc/hosts | grep -E "pve|pve2"

# Check corosync.conf
grep ring0_addr /etc/pve/corosync.conf

# Check cluster connectivity
ping -c 3 pve2   # On pve
ping -c 3 pve    # On pve2

# Check cluster status
pvecm status

Troubleshooting

Cluster Services Won't Start

# Check logs
journalctl -u corosync -n 50
journalctl -u pve-cluster -n 50

# Check configuration syntax
corosync-cfgtool -R

Nodes Can't See Each Other

  1. Verify IP addresses are correct in both files
  2. Check firewall isn't blocking ports 5405 (corosync) and 2224 (pve)
  3. Ensure both nodes are on same network segment
  4. Try restarting services one at a time

Rollback

If something goes wrong:

# Restore backups
cp /etc/pve/corosync.conf.backup /etc/pve/corosync.conf
cp /etc/hosts.backup.* /etc/hosts

# Restart services
systemctl restart corosync
systemctl restart pve-cluster