rk1ve

proxmox-clustering

mysteriously, i had three servers with enterprise level specs. from there i installed proxmox ve on all three of them. they both were connected with two ten gig fibers to a ten gig switch.

upon installing proxmox on each node, i ran this script on each node.
bash -c “$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/pve/post-pve-install.sh). before that, proxmox can either be installed on a single disk or in a mirror, choose best fit for the drives available.

this was a post install script that disabled the test and enterprise repos, and removed the nagging subscription screen.

next, was creating the lacp connection to each node. for this step, it works best to have the switch configuration ready so that cut over is seamless. first is the proxmox configuration.

navigate to /etc/network/interfaces and paste this in
auto bond0
iface bond0 inet manual
bond-slaves nic1 nic2
bond-miimon 100
bond-mode 802.3ad
bond-xmit-hash-policy layer2+3
mtu 9000

auto vmbr0
iface vmbr0 inet static
bridge-ports bond0
bridge-stp off
bridge-fd 0
bridge-vlan-aware yes
bridge-vids 2-4092

auto vmbr0.10
iface vmbr0.10 inet static
address 192.168.10.x/24
gateway 192.168.10.1
#MGMT/VMs

auto vmbr0.20
iface vmbr0.20 inet static
address 192.168.20.x/24
#Cluster

auto vmbr0.30
iface vmbr0.30 inet static
address 192.168.30.x/24
#Storage

this configuration creates the bond0 interface which is combining the interfaces into ‘one’ with lacp. then we turn the bond0 interface into a bridge interface that is vlan aware. below is the bridged interfaces with vlans defined along with their ip address. there is three interfaces created; mgmt/vm, cluster, and storage. i make the mgmt network route-able, while making the other two internal only.

to reload this configuration after saving: ‘ifreload -a’

next is the switch configuration, which depends on the type of switch manufacturer. but the steps are fairly simple in creating a lacp interface and binding it to your interfaces.

ensure that the native vlan is correctly assigned, otherwise there will be issues connecting out.

once these two are completed, reload the management interface url. it should have stuck on the same ip, but now on the bridged bond0 interface.

next is to add each host to the hosts file; add all networks as needed.
192.168.10.x pve-1.domain.com pve-1
192.168.10.y pve-2.domain.com pve-2
192.168.10.z pve-3.domain.com pve-3

192.168.20.x pve-1
192.168.20.y pve-2
192.168.20.z pve-3

192.168.30.x pve-1
192.168.30.y pve-2
192.168.30.z pve-2

then set a time source, preferably a local time source. navigate to this file: nano /etc/chrony/sources.d/custom.sources
server time ntp.domain.com iburst
pool time.domain.com iburst

reload the sources and verify on all nodes
chronyc reload sources
chronyc sources list

create the proxmox cluster by:
datacenter > cluster > create cluster
assign the cluster vlan and copy the info, paste it into the other nodes to join.

now the proxmox nodes operate on a cluster level, but in the event there are vm/lxc’s running, if the node goes down or we want to migrate, the storage is on that node’s local storage device. this brings to topic of clustered storage. there are many ways to do this, i will highlight two ways; ceph and linstor drbd.

ceph is very integrated into proxmox and is very intuitive to setup from the gui. while linstor is very cli dependent and will require some technical knowledge of how to work the cli and commands. this will go over linstor drbd.

note with ceph, it doesn’t work with hardware raid controllers. linstor is more lenient.

first, if there is multiples of the same storage, pool them together with zfs in a mirror or whatever raid works for the storage available. this can be easily created through the gui of each node. then navigate to the shell of each node and run an ‘lsblk’ to view the disks. if there is an extra ssd for caching for zfs, use it.
zpool add “pool_name” cache “disk_name”
zpool status – verify

now that the drives are setup for linstor, installation process is simple.
(assumed to paste in each node, unless noted otherwise)

# wget -O /tmp/linbit-keyring.deb \
https://packages.linbit.com/public/linbit-keyring.deb
# dpkg -i /tmp/linbit-keyring.deb
# source /etc/os-release && PVERS=$(( VERSION_ID - 4 ))
# echo "deb [signed-by=/etc/apt/trusted.gpg.d/linbit-keyring.gpg] \
https://packages.linbit.com/public/ proxmox-$PVERS drbd-9" > /etc/apt/sources.list.d/linbit.list
# sudo apt update

# sudo apt -y install pve-headers-$(uname -r) drbd-dkms drbd-utils linstor-proxmox

# sudo apt -y install linstor-controller linstor-satellite linstor-client

# sudo systemctl edit linstor-satellite

[Service]
Type=notify
TimeoutStartSec=infinity

# sudo systemctl enable linstor-satellite --now

# sudo systemctl enable --now linstor-controller (*only the controller node*)

# linstor node create pve-1 192.168.30.x --node-type Combined
# linstor node create pve-2 192.168.30.y --node-type Combined
# linstor node create pve-3 192.168.30.z --node-type Combined

linstor storage-pool create "type" "node_name" "pool name" "driver name aka zfs name"
# linstor storage-pool create zfs pve-1 pve-storage zpool
# linstor storage-pool create zfs pve-2 pve-storage zpool
# linstor storage-pool create zfs pve-3 pve-storage zpool

# linstor resource-group create pve-rg --storage-pool=pve-storage --place-count=3

# linstor volume-group create pve-rg

# linstor resource-group list (verify)

configure proxmox to interface with pve-rg
*synced to all nodes

sudo nano /etc/pve/storage.cfg
drbd: linstor_storage
content images,rootdir
controller 192.168.30.x
resourcegroup pve-rg

restart proxmox services on all nodes
sudo systemctl restart pve-cluster pvedaemon pvestatd pveproxy pve-ha-lrm

command line to verify:
linstor r list
linstor n list

preserve the moment.