← Back to Course Index

Week 6 IconWeek 6 - Lab: Proxmox Cluster & High Availability

Module: Operating Systems 3 (Virtualisation & Cloud Technologies) Estimated Time: 120 Minutes
Lab Type: Practical / Simulation


1. Objectives

By the end of this lab, you will be able to:

  1. Prepare a Multi-Node Environment: Clone or install a secondary Proxmox node.
  2. Create a Cluster: Initialize a Proxmox Cluster using pvecm.
  3. Join Nodes: Connect a secondary node to the cluster.
  4. Configure High Availability: Setup HA Groups.
  5. Execute Live Migration: Move a running VM between nodes.

2. Prerequisites & Environment Prep

To perform clustering, you need two distinct Proxmox nodes.

Phase 0: Provision Cluster Nodes

Do this BEFORE starting Part A.

Since the lab computers are stateless (reset after use), we will start by creating two fresh Proxmox VE nodes.

  1. Create Node 1 (pve-01):

    • Create a new Virtual Machine.
    • Resources: 2 vCPU, 4GB RAM (minimum), 20GB Disk.
    • Install Proxmox VE:
      • Hostname: pve-01.lab
      • IP Address: 192.168.1.100 (or similar)
      • Gateway/DNS: Match your lab network.
  2. Create Node 2 (pve-02):

    • Create a second new Virtual Machine.
    • Resources: 2 vCPU, 4GB RAM (minimum), 20GB Disk.
    • Install Proxmox VE:
      • Hostname: pve-02.lab
      • IP Address: 192.168.1.101 (increment the last octet).

Validation: * Node 1 (pve-01): 192.168.1.100 (Example) * Node 2 (pve-02): 192.168.1.101 (Example) * Test: SSH into Node 1 and ping Node 2. If it fails, fix networking before proceeding.


3. Lab Steps

Part A: Creating the Cluster

Perform on Node 1 (The Master):

  1. Open the Shell.
  2. Initialize the cluster: bash pvecm create Lab-Cluster
  3. Verify: bash pvecm status

    • You should see 1 Node, Quorate: Yes.

Part B: Joining the Cluster

Perform on Node 2 (The Joiner):

  1. Critical Check: Ensure Hostnames are different! (hostname). If both are pve, rename one now: bash hostnamectl set-hostname pve2 nano /etc/hosts # Update 127.0.1.1 to pve2 reboot
  2. Join the cluster (Use Node 1's IP): bash # You will be asked for root password of Node 1 pvecm add <IP_OF_NODE_1>
  3. Wait 1 minute. The web GUI on Node 2 might freeze. Access the GUI via Node 1 (https://<IP_OF_NODE_1>:8006).
  4. You should now see "Datacenter" has two nodes.

Part C: Live Migration

  1. Create a Test VM on Node 1.

    • Use a tiny ISO like Alpine Linux.
    • Imp ortant: Store the Disk on Shared Storage (NFS/Ceph) if possible. If you only have Local storage, migration will take longer (Storage vMotion).
    • Start the VM. Open the Console.
    • Migrate:

    • Right-Right on VM > Migrate.

    • Target Node: pve2.
    • Mode: Online.
    • Click Migrate.
    • Observe:

    • Watch the Task Log.

    • Watch the VM Console. Did it disconnect? (Ideally no).

Part D: High Availability Simulation

  1. Configure HA:

    • Datacenter > HA > Groups > Create HA-Group. Select both nodes.
    • Datacenter > HA > Resources > Add. Select your Test VM.
    • Simulate Failure:

    • WARNING: This is disruptive.

    • Physically unplug power (or "Hard Stop" the Nested VM) for Node 1 (where the VM is running).
    • Observe Recovery:

    • Watch Node 2's GUI.

    • Within 2-3 minutes, the Cluster detects Node 1 is dead ("Fence").
    • The VM should magically appear on Node 2 and boot up.

4. Troubleshooting

"Task Error: migration aborted"

"Quorum information missing, see syslog"

5. Interactive Checkpoint

← Back to Course Index