Step-by-Step Production Guide

Triển khai Proxmox Cluster 3-Node
với Ceph Storage

Hướng dẫn từ A → Z: chuẩn bị hardware, cài Proxmox, build Cluster, deploy Ceph, bật HA — sẵn sàng production.

6
Phase
3
Nodes
~3h
Thực hiện
$0
License

Kiến trúc tổng quan

Hệ thống gồm 3 node Proxmox giống hệt nhau, mỗi node vừa làm compute (chạy VM) vừa làm storage (OSD Ceph). Kiến trúc Hyper-Converged Infrastructure (HCI) — không cần SAN/NAS riêng.

graph TB subgraph Network["🌐 Network Layer"] SW1[Core Switch 10Gbps - VLAN 10 Mgmt] SW2[Storage Switch 25Gbps - VLAN 20 Ceph] end subgraph Node1["🖥️ pve-node1 (192.168.10.11)"] N1C[CPU: 32 cores
RAM: 128GB] N1D1[(OSD Disk 1
2TB SSD)] N1D2[(OSD Disk 2
2TB SSD)] N1D3[(OSD Disk 3
2TB SSD)] end subgraph Node2["🖥️ pve-node2 (192.168.10.12)"] N2C[CPU: 32 cores
RAM: 128GB] N2D1[(OSD Disk 1
2TB SSD)] N2D2[(OSD Disk 2
2TB SSD)] N2D3[(OSD Disk 3
2TB SSD)] end subgraph Node3["🖥️ pve-node3 (192.168.10.13)"] N3C[CPU: 32 cores
RAM: 128GB] N3D1[(OSD Disk 1
2TB SSD)] N3D2[(OSD Disk 2
2TB SSD)] N3D3[(OSD Disk 3
2TB SSD)] end SW1 --> Node1 SW1 --> Node2 SW1 --> Node3 SW2 -.Ceph Cluster Net.-> Node1 SW2 -.Ceph Cluster Net.-> Node2 SW2 -.Ceph Cluster Net.-> Node3 style Node1 fill:#fef3c7,stroke:#f59e0b,stroke-width:2px style Node2 fill:#fef3c7,stroke:#f59e0b,stroke-width:2px style Node3 fill:#fef3c7,stroke:#f59e0b,stroke-width:2px style SW1 fill:#dbeafe,stroke:#3b82f6 style SW2 fill:#e9d5ff,stroke:#8b5cf6

Bảng quy hoạch hạ tầng

Thành phần pve-node1 pve-node2 pve-node3
Mgmt IP (vmbr0)192.168.10.11/24192.168.10.12/24192.168.10.13/24
Ceph Public Net10.10.10.11/2410.10.10.12/2410.10.10.13/24
Ceph Cluster Net10.20.20.11/2410.20.20.12/2410.20.20.13/24
Hostname (FQDN)pve-node1.lab.localpve-node2.lab.localpve-node3.lab.local
OS Disk2× 240GB SSD RAID12× 240GB SSD RAID12× 240GB SSD RAID1
OSD Disks3× 2TB SSD (JBOD)3× 2TB SSD (JBOD)3× 2TB SSD (JBOD)
CPU / RAM32C / 128GB32C / 128GB32C / 128GB
NICs2× 10G + 2× 25G2× 10G + 2× 25G2× 10G + 2× 25G

Nguyên tắc thiết kế

  • 3 node tối thiểu cho Ceph quorum (Monitor cần lẻ ≥ 3)
  • Ceph Public Net: client (VM) đọc/ghi data
  • Ceph Cluster Net: replication + recovery giữa OSD — TÁCH RIÊNG để không nghẽn
  • Mạng storage tối thiểu 10Gbps (khuyến nghị 25Gbps + RDMA)
  • Disk OSD phải JBOD/HBA mode — KHÔNG RAID
P-1

Chuẩn bị hardware & BIOS

~30 phút — thực hiện vật lý tại datacenter

  1. 1

    Cấu hình BIOS từng server

    • Virtualization: enable Intel VT-x / VT-d (AMD-V / IOMMU)
    • Boot mode: UEFI (khuyến nghị, hỗ trợ Secure Boot)
    • SR-IOV: enable (cho passthrough NIC sau này)
    • Power Profile: Performance / OS Control
    • NUMA: enable
  2. 2

    Cấu hình Storage Controller

    • OS disks (2× SSD nhỏ): cấu hình RAID 1 cứng (HW RAID OK)
    • OSD disks (Ceph): chuyển sang HBA/IT mode/JBOD — Ceph cần thấy disk thuần
    • Tốt nhất dùng 2 controller riêng: 1 cho OS RAID, 1 HBA cho OSD
  3. 3

    Kết nối mạng vật lý

    • NIC 10G #1+#2: bond LACP → Mgmt switch (VLAN 10)
    • NIC 25G #1+#2: bond LACP → Storage switch (VLAN 20)
    • Cable label rõ ràng — quan trọng khi troubleshoot

Đồng nhất hardware

3 node nên giống hệt nhau (CPU/RAM/disk count) → tránh imbalance trong cluster Ceph & HA decision khó dự đoán.

P-2

Cài đặt Proxmox VE trên 3 node

~45 phút — lặp lại trên cả 3 node

  1. 1

    Download & tạo USB boot

    Download Proxmox VE 8.x ISO từ proxmox.com/en/downloads. Dùng Rufus (Win) hoặc dd (Linux) tạo USB boot.

  2. 2

    Boot Installer Wizard

    F11 → boot USB → chọn Install Proxmox VE → Agree EULA

  3. 3

    Chọn Target Disk

    Chọn ổ OS RAID1 240GB (KHÔNG chọn OSD disks!) → Options → ZFS (RAID1) hoặc ext4. ZFS có snapshot, compression, recommended.

  4. 4

    Network & Hostname

    Nhập thông tin node hiện tại (ví dụ node 1):

    • Hostname (FQDN): pve-node1.lab.local
    • IP: 192.168.10.11/24
    • Gateway: 192.168.10.1
    • DNS: 192.168.10.1
  5. 5

    Sau cài đặt — đổi repository (no-subscription)

    # SSH vào node bằng root # Tắt enterprise repo sed -i 's|^deb|#deb|' /etc/apt/sources.list.d/pve-enterprise.list sed -i 's|^deb|#deb|' /etc/apt/sources.list.d/ceph.list # Thêm no-subscription repos echo "deb http://download.proxmox.com/debian/pve bookworm pve-no-subscription" > /etc/apt/sources.list.d/pve-no-sub.list echo "deb http://download.proxmox.com/debian/ceph-reef bookworm no-subscription" > /etc/apt/sources.list.d/ceph-no-sub.list apt update apt upgrade -y reboot
  6. 6

    Lặp lại Step 1–5 cho node 2 và node 3

    Đổi hostname + IP tương ứng. KHÔNG bỏ qua bước update.

P-3

Cấu hình mạng phân tách

~30 phút — tạo 2 bridge cho Mgmt và Ceph traffic

Trên mỗi node, cấu hình 2 bridge:

# File: /etc/network/interfaces (trên node 1, lặp lại cho node 2,3 với IP tương ứng) # Bond 10G cho Mgmt + VM (vmbr0) auto bond0 iface bond0 inet manual bond-slaves eno1 eno2 bond-miimon 100 bond-mode 802.3ad bond-xmit-hash-policy layer3+4 auto vmbr0 iface vmbr0 inet static address 192.168.10.11/24 gateway 192.168.10.1 bridge-ports bond0 bridge-stp off bridge-fd 0 # Bond 25G cho Ceph Public Network (vmbr1) auto bond1 iface bond1 inet manual bond-slaves eno3 eno4 bond-miimon 100 bond-mode 802.3ad auto vmbr1 iface vmbr1 inet static address 10.10.10.11/24 bridge-ports bond1 bridge-stp off bridge-fd 0 mtu 9000 # VLAN 20 trên bond1 cho Ceph Cluster Net (vmbr1.20) auto vmbr1.20 iface vmbr1.20 inet static address 10.20.20.11/24 mtu 9000

Apply config:

ifreload -a ip a # verify # Test connectivity giữa các node trên Ceph network ping -c 4 -M do -s 8972 10.10.10.12 # test jumbo frame ping -c 4 10.20.20.13

Cấu hình /etc/hosts trên cả 3 node

# /etc/hosts — IDENTICAL trên cả 3 node 127.0.0.1 localhost.localdomain localhost # Management network (corosync sẽ dùng) 192.168.10.11 pve-node1.lab.local pve-node1 192.168.10.12 pve-node2.lab.local pve-node2 192.168.10.13 pve-node3.lab.local pve-node3
P-4

Tạo Proxmox Cluster

~15 phút — gộp 3 node thành 1 cluster quản lý chung

sequenceDiagram participant N1 as pve-node1 participant N2 as pve-node2 participant N3 as pve-node3 Note over N1: pvecm create CLUSTER01 N1->>N1: Tạo cluster master Note over N2: pvecm add 192.168.10.11 N2->>N1: Request join N1-->>N2: Sync config (corosync) Note over N3: pvecm add 192.168.10.11 N3->>N1: Request join N1-->>N3: Sync config N1->>N2: pmxcfs DB replication N1->>N3: pmxcfs DB replication N2->>N3: Quorum established (3 votes)
  1. 1

    Trên node 1 — tạo cluster

    # Truy cập Web UI: https://192.168.10.11:8006 # Hoặc dùng SSH: pvecm create CLUSTER01 # Verify pvecm status
  2. 2

    Lấy Join Information từ node 1 (GUI)

    Datacenter → Cluster → Join Information → Copy text

  3. 3

    Trên node 2 và 3 — Join Cluster

    # GUI: Datacenter → Cluster → Join Cluster → Paste join info → root password node 1 # Hoặc CLI: pvecm add 192.168.10.11 # Nhập root password của node 1 khi prompt
  4. 4

    Verify cluster

    pvecm status pvecm nodes # Phải thấy: Total votes: 3, Quorate: Yes

Sau bước này

Mở Web UI bất kỳ node nào → thấy cả 3 node trong panel trái. Quản lý từ đâu cũng được.

P-5

Triển khai Ceph Storage

~60 phút — software-defined storage phân tán

graph TB subgraph VMLayer["💻 VM / Client Layer"] VM1[VM 1] VM2[VM 2] VM3[VM 3] end subgraph CephPool["🗄️ RBD Pool: vm-storage (3 replicas)"] Pool[(Pool: vm-storage
size=3, min_size=2)] end subgraph N1["pve-node1"] MON1[MON.1] MGR1[MGR.1] OSD11[OSD.0
2TB SSD] OSD12[OSD.1
2TB SSD] OSD13[OSD.2
2TB SSD] end subgraph N2["pve-node2"] MON2[MON.2] MGR2[MGR.2] OSD21[OSD.3] OSD22[OSD.4] OSD23[OSD.5] end subgraph N3["pve-node3"] MON3[MON.3] OSD31[OSD.6] OSD32[OSD.7] OSD33[OSD.8] end VMLayer --> Pool Pool --> OSD11 Pool --> OSD22 Pool --> OSD33 MON1 -.- MON2 MON2 -.- MON3 MON3 -.- MON1 style Pool fill:#e9d5ff,stroke:#8b5cf6,stroke-width:3px style MON1 fill:#fef3c7,stroke:#f59e0b style MON2 fill:#fef3c7,stroke:#f59e0b style MON3 fill:#fef3c7,stroke:#f59e0b
  1. 1

    Cài Ceph trên cả 3 node

    Web UI: chọn từng node → Ceph → click Install Ceph → version Reef (18.x) → repo No-Subscription → Start Installation

    # Hoặc CLI trên mỗi node: pveceph install --repository no-subscription
  2. 2

    Initialize Ceph (chỉ làm trên node 1)

    pveceph init \ --network 10.10.10.0/24 \ --cluster-network 10.20.20.0/24 # Public network: client traffic # Cluster network: OSD-to-OSD replication
  3. 3

    Tạo 3 Monitors (MON) — 1 trên mỗi node

    Ceph → Monitor → Create → chọn host → Create. Lặp lại cho node 2, 3.

    # Hoặc CLI: pveceph mon create # chạy trên mỗi node
  4. 4

    Tạo 2 Managers (MGR)

    Ceph → Manager → Create → trên node 1 và node 2 (active/standby pair)

  5. 5

    Tạo OSDs (1 OSD cho mỗi disk, mỗi node 3 OSD = total 9 OSD)

    Ceph → OSD → Create: OSD → chọn disk → Default DB/WAL trên cùng OSD device → Create. Lặp lại cho từng disk trên từng node.

    # CLI tạo nhanh tất cả OSD trên node hiện tại: for dev in /dev/sdb /dev/sdc /dev/sdd; do pveceph osd create $dev done # Verify ceph osd tree
  6. 6

    Tạo Pool cho VM storage

    Ceph → Pools → Create:

    • Name: vm-storage
    • Size: 3 (3 replicas)
    • Min Size: 2 (chấp nhận 1 OSD down vẫn write OK)
    • PG Autoscale: on
    • ✅ Add as Storage
  7. 7

    Check Ceph Health

    ceph -s # Mong đợi: # cluster: health: HEALTH_OK # services: 3 mons, 2 mgrs, 9 osds # data: pools 1, pgs ~128

Tính dung lượng usable

9 OSD × 2TB = 18TB raw → chia 3 (replicas) = 6TB usable. Đừng dùng quá 80% (≈ 4.8TB) để Ceph có chỗ recovery khi 1 OSD/node fail.

P-6

Bật HA & Test Failover

~20 phút — đảm bảo VM tự động restart khi 1 node fail

flowchart LR A[Node1 Power OFF] --> B{HA Watchdog
detects loss} B -->|after 60s| C[Fencing via softdog] C --> D[ha-manager picks new node] D --> E[Mount Ceph RBD
on Node2] E --> F[Start VM on Node2] F --> G[VM Running
~2 min downtime] style A fill:#fecaca,stroke:#ef4444 style G fill:#bbf7d0,stroke:#22c55e
  1. 1

    Tạo HA Group

    Datacenter → HA → Groups → Create:

    • ID: ha-group-prod
    • Nodes: tick cả 3 (priority 100/100/100)
    • ✅ restricted (chỉ chạy trên các node này)
    • ✅ nofailback (không tự động chuyển ngược)
  2. 2

    Tạo VM test trên Ceph storage

    Create VM → tại bước Disk, chọn Storage: vm-storage (Ceph pool) → finish

  3. 3

    Add VM vào HA

    Datacenter → HA → Resources → Add → chọn VM ID → Group: ha-group-prod → State: started → Max Restart: 2 → Max Relocate: 1 → Add

  4. 4

    Test Failover

    # Trên node đang chạy VM, simulate fail bằng cách power off cứng # Cách 1: tắt nguồn vật lý / IPMI power off # Cách 2: kernel panic echo c > /proc/sysrq-trigger # Quan sát trên node còn sống: ha-manager status journalctl -u pve-ha-lrm -f # Kết quả: sau ~2 phút, VM tự khởi động lại trên node khác

Hoàn thành!

Bạn đã có hệ thống Proxmox Cluster + Ceph + HA sẵn sàng production. Chi phí license: $0.

Việc cần làm sau khi deploy

Bảo mật

  • ✅ Đổi default password root
  • ✅ Tạo user/role riêng (PVE Realm)
  • ✅ Bật 2FA cho admin
  • ✅ Cấu hình Firewall ở cluster/node level
  • ✅ Disable SSH password — dùng key
  • ✅ Restrict Web UI bằng reverse proxy + cert

Backup

  • ✅ Deploy Proxmox Backup Server (PBS) riêng
  • ✅ Cấu hình backup schedule daily/weekly
  • ✅ Backup ra NAS hoặc cloud
  • ✅ Test restore mỗi tháng
  • ✅ Snapshot Ceph pool định kỳ
  • ✅ Document recovery procedures

Monitoring

  • ✅ Bật Ceph Dashboard (mgr module)
  • ✅ Cấu hình email alert (postfix)
  • ✅ Tích hợp Prometheus + Grafana
  • ✅ Monitor IOPS/latency/usage hàng ngày
  • ✅ Setup SNMP traps tới NMS

Performance Tuning

  • ✅ Enable VirtIO SCSI cho VM disk
  • ✅ Cấu hình NUMA awareness
  • ✅ Enable balloon driver cho RAM
  • ✅ Tăng tcp_window_size cho Ceph
  • ✅ Test IOPS bằng fio benchmark