Skip to content
Part 2: Proxmox VE Advanced: Clustering, HA & Migration Guide

Part 2: Proxmox VE Advanced Guide

Clustering, High Availability (HA) & Live Migration

Phần 2: Hướng dẫn nâng cao Proxmox VE

Cấu hình Cluster, HA & Di chuyển máy ảo (Migration) chuyên sâu

I. Comparison: Proxmox vs VMware I. So sánh Proxmox và VMware

1. Core Concepts

1. Khái niệm

ItemVMware vSphereProxmox VEReal-world Notes
Central MgmtvCenter ServerProxmox ClusterProxmox: No separate server needed; manage from any node.
HypervisorESXi HostProxmox Node1-to-1 Equivalent.
GroupingCluster (vCenter)Cluster (Datacenter)Formed when nodes join.
Admin UIvSphere ClientWeb UI (Any Node)Single pane of glass.
Live MigrationvMotionLive MigrationMove running VMs (needs shared storage usually).
Storage MoveStorage vMotionMove DiskMove disk while VM runs.
HAvSphere HAProxmox HABoth need quorum/heartbeat.
Load BalanceDRSNo native DRSProxmox has HA, but no auto-balancing logic.
NetworkingvSwitch/vDSLinux Bridge/OVSBridge = vSwitch.
Guest ToolsVMware ToolsQEMU Guest AgentFor IP, shutdown, fs-freeze.
Shared StoreVMFS/NFS/vSANNFS/Ceph/ZFSCritical for live migration.
CPU CompatEVC ModeCPU Type (Baseline)Must match for migration.
AccessRBACUsers/ACLSimilar mechanism.
Hạng mụcVMware vSphereProxmox VEGhi chú thực tế
Trung tâm quản lývCenter ServerProxmox ClusterProxmox không cần server riêng; quản trị từ node bất kỳ.
Máy chủ ảo hóaESXi HostProxmox NodeTương đương 1–1.
Tập hợp máy chủCluster (trong vCenter)Cluster (mức Datacenter)Tổ chức thành cluster khi node join.
Quản trị tập trungvCenter ServerProxmox Web UIMột điểm quản lý chung.
Di chuyển nóngvMotionLive MigrationChuyển VM đang chạy giữa các host.
Di chuyển lưu trữStorage vMotionMove DiskChuyển ổ đĩa khi máy đang chạy.
Tính năng HAvSphere HAProxmox HACả hai đều cần quorum/heartbeat đúng.
Cân bằng tảiDRSKhông có DRS nativeProxmox có HA, không tự load-balance.
Mạng ảo hóavSwitch / vDSLinux Bridge / OVSBridge ≈ vSwitch.
Công cụ trong guestVMware ToolsQEMU Guest AgentLấy IP, shutdown, backup consistent.
Shared datastoreVMFS / NFS / vSANNFS / Ceph / ZFSCần cho live migration ổn định.
Tương thích CPUEVC ModeCPU Type baselineTránh mismatch CPU flags khi migrate.
Phân quyềnvCenter RBACProxmox Users / ACLTương đương về cơ chế.

2. VM Migration Conditions

2. Điều kiện di chuyển VMs

RequirementVMwareProxmoxNotes
ManagementvCenterClusterCluster required.
NetworkVMkernel vMotionMigration NetworkSeparate subnet recommended.
CPUEVCType MatchFlags match.
StorageSharedSharedNFS/Ceph/iSCSI.
L2 NetPort GroupBridge/VLANMatch bridges.
LicenseEditionSubRepo/Support only.
Yêu cầuVMware (vMotion)Proxmox (Live Migration)Ghi chú
Trung tâm quản lýThực tế cần vCenterCần Proxmox ClusterKhông cluster thì không migrate chuẩn bài.
Mạng MigrationVMkernel vMotion NICMigration Network (CIDR)Proxmox tự chọn IP trong CIDR.
Tương thích CPUEVC / CPU tương thíchCPU Type khớpLệch cờ CPU -> migrate fail.
Shared storageShared datastoreShared (NFS/Ceph…)Dễ nhất để live migrate ổn định.
Network L2Port GroupBridge/VLAN khớpSai Bridge -> VM mất mạng.
LicensePhụ thuộc editionSubscriptionProxmox sub chủ yếu cho repo/support.

3. Snapshot & Backup

3. Snapshot & Backup

Tính năngVMware vSphereProxmox VEGhi chú
Snapshot VMNative (theo datastore)Snapshot (theo backend)Snapshot không phải backup.
Backup VMVeeam/Nakivo…Proxmox Backup ServerPBS tích hợp rất sâu.
IncrementalCBTPBS IncrementalDeduplication hiệu quả.
ReplicationvSphere ReplicationZFS/Ceph ReplicationGiải pháp khi không có shared storage.
FeatureVMwareProxmoxNotes
SnapshotNativeBackend dependentSnapshot is not backup.
BackupVeeam/NakivoPBSDeep integration.
IncrementalCBTPBS IncrementalEfficient dedup.
ReplicationvSphere RepZFS/Ceph RepFor shared-nothing setup.

4. Licensing & Operations

4. Licenses, chi phí và vận hành

Tiêu chíVMware vSphereProxmox VENhận xét thực tế (DN hạn chế ngân sách)
Quản lý tập trungThường cần vCenter Server để quản lý tập trung, phân quyền, thao tác clusterChỉ cần tạo Proxmox Cluster là quản lý tập trung (không cần server quản lý riêng)Proxmox giảm chi phí hạ tầng quản lý
Di chuyển VM khi đang chạy (Live Migration)vMotion phụ thuộc edition/bundle và kiến trúc triển khai (thực tế thường triển khai qua vCenter)Live Migration có sẵn khi đã có cluster + storage dùng chungProxmox thuận lợi nếu ưu tiên migrate với chi phí thấp
Tính sẵn sàng cao (HA)vSphere HA phụ thuộc edition/bundle + cấu hình heartbeat/isolation đúngProxmox HA có sẵn nhưng cần thiết kế quorum (2 node nên có qdevice/3rd vote)Cả hai đều triển khai HA được; Proxmox cần chú ý quorum để tránh split-brain
Tự cân bằng tảiDRS (nếu gói có) tự phân bổ VM theo tảiKhông có DRS nativeVMware lợi thế nếu DN cần tự động cân bằng tài nguyên
Chi phí bản quyềnChi phí có thể cao tuỳ gói/edition (host + vCenter)Có thể dùng miễn phí; trả phí chủ yếu cho enterprise repository + supportProxmox phù hợp khi mục tiêu là giảm chi phí bản quyền
Hỗ trợ kỹ thuật chính hãngThường theo hợp đồng/gói đi kèm licenseSubscription theo node (có thể mua khi cần)Proxmox linh hoạt hơn về thời điểm mua hỗ trợ
Cập nhật/patch khi không có supportTheo entitlement/portal của VMware; quy trình cập nhật thường gắn với licensingCó enterprise repo (trả phí) và no-subscription repo (miễn phí)Nếu dùng no-subscription cho production: cần quy trình update chặt (staging/backup/maintenance window)
Mức độ phức tạp khi triển khai ban đầuNhiều bước (vCenter + cluster + network vMotion/HA…) nhưng phù hợp mô hình enterprise chuẩn hoáÍt bước hơn (create cluster + join node + add storage + set migration network)Proxmox thường triển khai nhanh hơn khi đã có thiết kế network/storage rõ
Hệ sinh thái công cụ quản trịHệ sinh thái lớn: backup/monitoring/automation/SDN… (tuỳ giải pháp/bundle đi kèm)Có PBS tích hợp tốt; automation thường dựa script/Ansible và công cụ LinuxVMware mạnh khi DN cần “bộ công cụ enterprise” đầy đủ; Proxmox phù hợp mô hình tối ưu chi phí và tự vận hành
Giao diện quản trịvSphere Client nhiều chức năng quản trị chi tiếtProxmox Web UI đơn giản, tập trung vào vận hành thực tế; có CLI mạnhVMware cung cấp nhiều tính năng quản trị nâng cao; Proxmox tối giản và dễ thao tác hàng ngày
CriteriaVMware vSphereProxmox VEReal-world Remarks (Budget-constrained)
Central ManagementUsually requires vCenter Server for centralized mgmt, RBAC, cluster opsJust create Proxmox Cluster for centralized mgmt (no separate server needed)Proxmox reduces management infrastructure costs.
Live MigrationvMotion depends on edition/bundle and architecture (often requires vCenter)Live Migration available once cluster + shared storage existsProxmox favorable if low-cost live migration is a priority.
High Availability (HA)vSphere HA depends on edition/bundle + correct heartbeat/isolation configProxmox HA included but needs quorum design (2 nodes need qdevice/3rd vote)Both can implement HA; Proxmox requires attention to quorum to avoid split-brain.
Auto Load BalancingDRS (if bundled in package) auto-distributes VMs based on loadNo native DRSVMware advantageous if automated resource balancing is required.
Licensing CostCost can be high depending on package/edition (host + vCenter)Can be free; pay mainly for enterprise repository + supportProxmox suitable when the goal is reducing licensing costs.
Official SupportUsually via contract/bundle associated with licenseSubscription per node (can be purchased when needed)Proxmox offers more flexibility on when to purchase support.
Updates/Patching (No Support)Via entitlement/portal; updates often tied to licensingEnterprise repo (paid) vs No-subscription repo (free)If using no-subscription for production: strict update process (staging/backup) is needed.
Deployment ComplexityMany steps (vCenter + cluster + network vMotion/HA…) but standardized for enterpriseFewer steps (create cluster + join node + add storage + set migration network)Proxmox deployment is usually faster given a clear network/storage design.
Management EcosystemHuge ecosystem: backup/monitoring/automation/SDN… (depends on solution/bundle)PBS integrates well; automation often relies on script/Ansible and Linux toolsVMware strong when full “enterprise toolset” is needed; Proxmox fits cost-optimization & self-ops models.
Management UIvSphere Client offers deep granular management featuresProxmox Web UI is simple, focused on practical ops; strong CLIVMware offers advanced admin features; Proxmox is minimalist and easy for daily operations.

II. Triển khai Cluster Proxmox

1. Create Cluster on node 93.203

1. Tạo Cluster trên node 93.203

1.1: Initialize New Cluster

1.1: Tạo mới Cluster

Create Cluster Fig II.1.1: Create Cluster Button

1.2: Cluster Settings

1.2: Đặt Cluster name và chọn Network

Cluster Settings Fig II.1.2: Cluster Name & Network

1.3: Complete and Verify

1.3: Hoàn tất và kiểm tra thông tin

Join Info A Join Info B Fig II.1.3: Cluster Information

2. Get Join Information

2. Lấy thông tin “Join Information” của node 93.203

Join Info Fig II.2: Copy Join Info string

3. Join node 93.204

3. Join từ node 93.204

Join Cluster Fig II.3: Join Cluster Interface

4. Provide credentials

4. Khai báo thông tin

Credentials Fig II.4: Enter Root Password
CRITICAL NOTE: The joining node must be empty. No VMs/CTs should exist.
LƯU Ý QUAN TRỌNG: Node dùng để Join Cluster phải trống. Không được tồn tại bất kỳ VM/CT nào (kể cả đang Shutdown).

5. Join Successful

5. Hoàn tất Join Cluster

Log Fig II.5-a: Task Log
Status Fig II.5-b: Cluster Status
Nodes Fig II.5-c: Node View

6. Remove Cluster (Terminal)

6. Remove Cluster (Terminal)

root@pve01-93-203:~# systemctl stop pve-ha-lrm pve-ha-crm corosync
root@pve01-93-203:~# systemctl stop pve-cluster
root@pve01-93-203:~# pmxcfs -l
root@pve01-93-203:~# rm -f /etc/pve/corosync.conf
root@pve01-93-203:~# rm -f /etc/corosync/corosync.conf /etc/corosync/authkey
root@pve01-93-203:~# rm -f /etc/pve/priv/authorized_keys
root@pve01-93-203:~# killall pmxcfs
root@pve01-93-203:~# systemctl start pve-cluster
root@pve01-93-203:~# pvecm nodes

III. Live Migration

1. Kiểm tra lớp mạng

1. Check Network

Network Fig III.1: Network Setup

2. Xác nhận Shared Storage

2. Check Shared Storage

Storage Fig III.2: Storage Verification

3. Thực hiện Live Migrate

3. Execute Live Migrate

Target Fig III.3-a: Select Target Node
Settings Fig III.3-b: Network & Options
Task Fig III.3-c: Task Progress

4. Kiểm tra Traffic

4. Verify Traffic

Traffic Fig III.4: Traffic Analysis
root@pve02-93-204:~# iftop -i vmbr0.200

IV. Proxmox HA / Auto Failover

1. Tạo Group HA

1. Create HA Group

Proxmox HA GroupÝ nghĩa kỹ thuậtKhi dùng (production)Tương đương VMware
restrictedHard constraint: resource chỉ chạy trên node thuộc group.Bật khi muốn VM chỉ chạy trong 1 nhóm node xác định. Nếu ko còn node hợp lệ → resource không start.DRS VM-Host Affinity: Must run on group.
nofailbackDisable automatic failback: HA không tự relocate VM về node ưu tiên khi nó hồi phục.Bật để ổn định sau sự cố, tránh relocate không cần thiết. Tắt nếu policy yêu cầu “return-to-primary”.VMware HA không có toggle failback trực tiếp; thường đạt được bằng DRS rule.
Priority (per node)Soft preference / ordering: HA ưu tiên chọn node có priority nhỏ hơn khi start/relocate resource (trong phạm vi group).Đặt primary=1, secondary=2 (hoặc bằng nhau nếu không ưu tiên). Không phải cơ chế cân bằng tải.Gần nhất: DRS “Should run on” (soft) + host group.
OptionMeaningUsageVMware
restrictedRun only in group.Hard constraint.Must run on.
nofailbackNo auto return.Anti-flap.Disable failback.
PriorityLower = Higher.Pri/Sec setup.Should run on.

Use Cases

Kịch bảnProxmox HA Group configVMware tương đươngKết quả mong muốn
VM chỉ được chạy trên tier-1; tier-1 down hết thì VM không chạyrestricted=1, Nodes=tier-1DRS VM-Host **Must run on** tier-1Tôn trọng ràng buộc cứng (không “chạy lạc” sang tier-2).
VM ưu tiên pve01; pve01 down → failover pve02; pve01 lên lại → ở lại pve02restricted=1 (hoặc 0), nofailback=1, priority pve01=1 pve02=2“Disable failback” theo vận hành + DRS soft preferenceỔn định sau sự cố, tránh ping-pong relocation.
VM ưu tiên pve01; pve01 down → failover pve02; pve01 lên lại → tự quay về pve01nofailback=0, priority pve01=1 pve02=2DRS “preferred host” + automation/manual vMotionMô hình primary/secondary “return-to-primary”.
Không ưu tiên node nào (chỉ cần HA)priority pve01=1 pve02=1, nofailback=1Không có tương đương HA thuần; thường để DRS tự cânHA hoạt động, không ép “primary”.
ScenarioProxmox ConfigVMware EquivDesired Outcome
VM only runs on tier-1; if tier-1 is down, VM does not runrestricted=1, Nodes=tier-1DRS Must Run OnRespect hard constraint.
VM prefers pve01; pve01 down → failover pve02; pve01 up again → stays on pve02nofailback=1, pve01=1 pve02=2Disable FailbackStability after incident, avoid ping-pong.
VM prefers pve01; pve01 down → failover pve02; pve01 up again → auto returns to pve01nofailback=0, pve01=1 pve02=2Preferred HostReturn-to-primary model.
No preference (just need HA)priority pve01=1 pve02=1DRS BalancedHA active, no forced “primary”.
Group List Fig IV.1: HA Group List

2. Add các VMs cần HA vào group

2. Add VMs to HA Group

Trong Proxmox VE, HA là cơ chế opt-in theo từng VM/CT. Bạn phải thêm VM vào Datacenter -> HA -> Resources.

Trường (Proxmox HA Resource)Ý nghĩa kỹ thuậtKhi nào cấu hình / chọn giá trịTương đương VMware vSphere/ESXi
VM / CTChọn VM (KVM) hoặc CT (LXC) sẽ được HA quản lý (restart/relocate theo policy).Add đúng workload quan trọng cần HA. Không add → HA không quản lý.VM thuộc phạm vi vSphere HA (VM được HA quản lý).
GroupGán resource vào HA Group để áp chính sách placement (node priority / restricted / nofailback).Chọn đúng group theo tier. Bỏ trống → không có placement policy (có thể chạy trên mọi node). Nếu group có restricted=1 → chỉ được chạy trên node thuộc group; không còn node phù hợp → resource về stopped.Gần nhất: DRS Host Group + VM-Host Affinity Rule (must/should) + “preferred hosts”.
Max. RestartSố lần tối đa HA thử restart trên cùng node khi service bị xem là failed / fail to start (start failure policy).Prod thường 1–3. 0 = không retry restart trên node hiện tại (dễ down nếu lỗi tạm).Không có field 1:1. Gần concept “restart attempts”, VMware không expose rõ per-VM theo kiểu này.
Max. RelocateSố lần tối đa HA được relocate sang node khác (thường xảy ra sau khi vượt Max Restart trên node hiện tại).1 là phổ biến (anti-flap). >1 nếu cluster nhiều node và muốn “thử thêm node khác”. 0 = không relocate (failover gần như tắt).Gần nhất: restart VM on other host (Host Failure Response), nhưng VMware không có “relocate count” rõ ràng như Proxmox.
Request State / StateTrạng thái mong muốn: started / stopped / disabled / ignored (và enabled là alias của started).started: HA giữ chạy. stopped: HA giữ tắt. disabled: đưa về stopped và không relocate khi node failure (hay dùng để recovery). ignored: HA bỏ qua resource (bypass HA control).VMware gần nhất: HA enable/disable theo VM + power state.
CommentGhi chú metadata/annotation, không ảnh hưởng hành vi.Ghi owner/tier/SLA/ticket/ghi chú bảo trì.Notes / Annotations của VM trong vCenter.
Cảnh báo quorum (“At least three quorum votes…”)Cảnh báo về quorum vote (Corosync): cần đa số vote để tránh split-brain. Cụm 2 node “trần” dễ mất quorum khi 1 node down.Nếu 2 node: thêm QDevice (vote thứ 3) hoặc thêm node thứ 3.VMware dùng cơ chế khác (isolation/heartbeat), không gọi quorum votes nhưng cùng mục tiêu “chống split-brain”.

In Proxmox VE, HA is an opt-in mechanism per VM/CT. You must add VMs to Datacenter -> HA -> Resources.

Field (Proxmox HA Resource)Technical MeaningWhen to config / Best PracticeEquivalent on VMware vSphere/ESXi
VM / CTSelect VM (KVM) or CT (LXC) to be managed by HA (restart/relocate per policy).Add critical workloads needing HA. Not added → not managed by HA.VM in scope of vSphere HA.
GroupAssign resource to HA Group to apply placement policy (node priority / restricted / nofailback).Choose group by tier. Empty → runs on any node. restricted=1 → strict group enforcement.DRS Host Group + VM-Host Affinity Rule.
Max. RestartMax retries to restart on the SAME node upon failure.Prod: 1–3. 0 = no local retry (fast failover but sensitive to blips).Similar to “restart attempts” logic.
Max. RelocateMax retries to relocate to ANOTHER node after local restart fails.Prod: 1 (common to prevent flapping). >1 for large clusters.Host Failure Response (Restart on other host).
Request StateDesired state: started / stopped / disabled / ignored.started: Keep running. stopped: Keep off. disabled: Stop managing (maintenance).HA Enable/Disable per VM.
Quorum warningWarning about lack of majority vote (split-brain risk).For 2-node clusters, a QDevice (3rd vote) is mandatory for reliable HA.Isolation Response / Heartbeat Datastores.
Add Resource Fig IV.2-a: Add Dialog
Settings Fig IV.2-b: Settings
List Fig IV.2-c: Active List

3. Test HA

3. Test HA

Test IDMục tiêuĐiều kiện / SetupThao tác testExpected Result
TCs-01Baseline HA hoạt độngCluster ổn định, vm:111 đã add vào HA Resources và state = startedKhông làm gìquorum: OK, master: active, LRM active; vm:111 state started và hiển thị node đang chạy
TCs-02Failover khi node đang chạy VM bị downvm:111 đang chạy trên 1 nodeShutdown/poweroff node đang chạy VMvm:111 được relocate sang node còn lại và về started
TCs-03Failback “return-to-primary”HA-01: priority pve01=1, pve02=2, nofailback=0Sau TCs-02: bật pve01 lên lạiKhi pve01 online & cluster ổn định, VM có thể tự relocate về pve01 (tuỳ phiên bản/điều kiện HA trigger)
TCs-04No-failback “stay-put”HA-01: priority pve01=1, pve02=2, nofailback=1Sau TCs-02: bật node bị down lên lạiVM ở lại node hiện tại, không tự quay về node ưu tiên
TCs-05Restricted placement (hard rule)HA-01: restricted=1, nodes = {pve01, pve02}Tắt 1 node bất kỳVM chỉ chạy trên node còn lại (vì vẫn thuộc group)
TCs-06Restricted “không có node hợp lệ thì không chạy”restricted=1 và group chỉ chứa 1 node (ví dụ chỉ pve01)Tắt node pve01VM không start ở node khác; resource về stopped
TCs-07Manual migrate bị HA kéo vềpriority pve01=1, pve02=2, nofailback=0, VM thuộc HA-01Manual migrate VM 111 sang pve02Migrate xong VM có thể bị HA failback về pve01
TCs-08Manual migrate không bị kéo vềnofailback=1 hoặc priority pve01=1, pve02=1Manual migrate VM 111 sang node kiaVM ở lại node mới, HA không failback về node ưu tiên
TCs-09Max RestartSet Max Restart=2, Max Relocate=1Tạo điều kiện start fail rồi start VMHA retry restart trên cùng node tối đa 2 lần trước khi relocate
TCs-10Max RelocateSet Max Restart=1, Max Relocate=1Tạo start fail lặp lại sau khi relocateHA relocate tối đa 1 lần; vượt giới hạn thì resource có thể về stopped/give up
TCs-11Quorum lost behavior (2-node không QDevice)2-node, không QDeviceTắt 1 node hoặc cắt corosyncNode còn lại: Quorate: No / Activity blocked. HA freeze, không tự relocate/start VM để tránh split-brain
Test IDGoalCondition / SetupTest ActionExpected Result
TCs-01Baseline HA activeStable Cluster, vm:111 added to HA ResourcesDo nothingquorum: OK, master: active, LRM active; vm:111 state started and shows running node
TCs-02Failover when running node goes downvm:111 running on 1 nodeShutdown/poweroff running nodevm:111 relocated to remaining node and back to started
TCs-03Failback “return-to-primary”HA-01: priority pve01=1, pve02=2, nofailback=0After TCs-02: turn pve01 back onWhen pve01 online & cluster stable, VM may auto relocate back to pve01 when stable
TCs-04No-failback “stay-put”HA-01: priority pve01=1, pve02=2, nofailback=1After TCs-02: turn down node back onVM stays on current node, does not auto return to priority node
TCs-05Restricted placement (hard rule)HA-01: restricted=1, nodes = {pve01, pve02}Turn off any 1 nodeVM only runs on remaining node (as it’s still in group)
TCs-06Restricted “no valid node then no run”restricted=1 and group has 1 node (e.g. only pve01)Turn off node pve01VM does not start elsewhere; resource goes to stopped
TCs-07Manual migrate failbackpriority pve01=1, pve02=2, nofailback=0Manual migrate VM 111 to pve02HA may pull VM back to pve01 immediately
TCs-08Manual migrate staynofailback=1 or priority pve01=1, pve02=1Manual migrate VM 111 to other nodeVM stays on new node, HA does not failback
TCs-09Max RestartSet Max Restart=2, Max Relocate=1Force start failureHA retries local restart max 2 times before relocate
TCs-10Max RelocateSet Max Restart=1, Max Relocate=1Force start failure repeatedHA relocates max 1 time; exceeding limit resource may go to stopped/give up
TCs-11Quorum lost behavior (2-node no QDevice)2-node, no QDeviceTurn off 1 nodeRemaining node: Quorate: No. HA freezes, NO failover (split-brain protection)
TC1 Testcase-01: Baseline Status
TC2 Testcase-02: Failover (Node Down)
TC3 Testcase-03: Failback
TC4 Testcase-04: No Failback

V. Clone VMs V. Sao chép VM (Clone)

1. Initiate Clone

1. Thực hiện Clone

Clone Wizard Fig V.1: Clone Wizard

2. Clone Options

2. Chế độ Clone

Clone Options Fig V.2: Linked vs Full Clone

3. Completion

3. Hoàn tất

Clone Task Fig V.3: Task Finished

VI. Other Enterprise Features VI. Các tính năng khác

Hạng mụcÝ nghĩaVai trò (Production)Best practiceCách cấu hình (tóm tắt)
Fencing bằng IPMI (iDRAC/iLO/IMM)Cơ chế power off/reset node lỗi qua kênh out-of-band (không phụ thuộc OS của node lỗi), để đảm bảo không có dual-writerBắt buộc cho workload quan trọng (DB, filesystem nhạy) để chống split-brain/duplicate VM1) Mgmt network riêng cho IPMI 2) Tạo user “fence” (quyền power-control) 3) Cho phép UDP 623 (RMCP+/lanplus) giữa các node ↔ IPMI 4) Test thật trước go-live1) Test IPMI: ipmitool -I lanplus -H ip-ipmi -U user -P ‘pass’ power status 2) Set chế độ fencing của HA: fencing: hardware hoặc both (Datacenter options / /etc/pve/datacenter.cfg) 3) Khai báo fence devices trong /etc/pve/ha/fence.cfg 4) Test fence (có thể qua API/CLI) và kiểm tra HA log sau khi fence. ([Proxmox Support Forum][1])
Watchdog fencing (fallback/airbag)Fencing dạng watchdog (thường là software watchdog/softdog nếu không có HW watchdog), node có thể tự reset khi watchdog hết hạnLớp dự phòng khi OS/agent treo; không thay thế IPMI cho production nghiêm túcKhông tắt watchdog khi đang dùng HA; chỉ test trong maintenance window1) Kiểm tra watchdog: ls -l /dev/watchdog* ; lsmod | grep -i watchdog 2) Xác nhận cluster đang dùng watchdog-based fencing (mặc định) 3) Khi cần truy vết: xem log boot trước bằng journalctl -b -1 tìm “watchdog”. ([Proxmox VE][2])
Maintenance / Evacuate node (quy trình bảo trì)Đưa node vào maintenance để HA migrate/relocate resource ra khỏi node đó trước khi reboot/bảo trìTránh downtime ngoài ý muốn; bảo trì có kiểm soátRunbook bắt buộc: maintenance → xác nhận đã rỗng HA resources → reboot → disable maintenanceCLI chuẩn: ha-manager crm-command node-maintenance enable NODE → chờ VM/CT HA rời node → reboot node → ha-manager crm-command node-maintenance disable NODE; theo dõi ở Datacenter → HA → Status/Resources/Tasks. ([Proxmox VE][3])
Replication (khi VM nằm local disk)Đồng bộ disk VM theo lịch (async) để có bản chạy ở node khác khi không có shared storage (RPO > 0)Giải pháp sống còn nếu không có shared storageƯu tiên shared storage cho Tier-1; nếu buộc local: xác định rõ RPO/RTO và network replication riêngDatacenter → Replication → Add job (VMID, target node, schedule). Kiểm tra replica tồn tại trên node đích trước khi test failover; test bằng cách simulate node failure và xác nhận VM start từ replica (chấp nhận RPO theo lịch).
Network tách bạch & dự phòng (corosync/migration/storage/mgmt)Tách luồng: Corosync (heartbeat/vote), Migration, Storage, ManagementGiảm quorum loss do network flap; giảm migrate timeout; giảm storage contentionCorosync ưu tiên low-latency & ổn định; migration network riêng; storage riêng; mgmt riêng (và IPMI riêng nếu có)1) Migration network: Datacenter → Options hoặc /etc/pve/datacenter.cfg đặt migration: network=subnet 2) Kiểm tra corosync link ổn định, không share bừa với traffic nặng (backup/replication).
HA anti-flap tuning (Max Restart / Max Relocate / delay)Giới hạn restart/relocate để tránh VM “bounce/ping-pong” và tránh loopỔn định dịch vụ sau sự cố; giảm “tự phá” khi app lỗiThường dùng: Restart 1–3, Relocate 1 cho production; app ổn định thấp thì giảm restart, app flaky thì tăng restart nhưng giữ relocate thấpDatacenter → HA → Resources → Edit resource: set Max Restart/Relocate. Sau sự cố xem log pve-ha-* (qmstart/qmshutdown) để điều chỉnh.
QDevice placement đúng production (2-node)Vote thứ 3 để 2-node vẫn giữ majority khi 1 node downTránh “1/2 votes → HA freeze”QDevice đặt ngoài 2 node, tốt nhất khác host/switch/nguồn điện; chỉ chạy qnetd, không chạy VM prodQDevice: systemctl enable –now corosync-qnetd; mở TCP 5403. Trên cluster: pvecm qdevice setup qdevice-ip; verify pvecm status thấy Qdevice và cluster Quorate.
Monitoring/Alerting (quorum/HA/fencing/storage)Cảnh báo sớm: quorum, qdevice, fencing lỗi, HA task stuck, storage latencyGiảm sự cố “đến lúc mới biết”Alert theo mức: critical (no quorum, fencing fail), warning (qdevice unreachable, storage latency tăng, HA task lâu)Proxmox Notifications (mail/webhook) + monitor ngoài (Zabbix/Prometheus). Theo dõi định kỳ: pvecm status, ha-manager status, tasks/cluster log.
Backup/Restore (PBS) cho HA VMHA = uptime; không thay backup. Backup để cứu dữ liệu (corruption/delete/ransomware)Bắt buộc cho productionPBS riêng, retention theo tier, test restore định kỳAdd PBS storage → tạo backup jobs theo lịch → kiểm tra task result → test restore (restore sang VM tạm để verify rồi xoá).
CategoryMeaningRole (Production)Best practiceConfig (Summary)
Fencing via IPMI (iDRAC/iLO/IMM)Mechanism to power off/reset failed node via out-of-band channel (OS independent), ensuring no dual-writerMandatory for critical workloads (DB, sensitive filesystem) to prevent split-brain/duplicate VM1) Separate Mgmt network for IPMI 2) Create “fence” user (power-control rights) 3) Allow UDP 623 (RMCP+/lanplus) between nodes ↔ IPMI 4) Test thoroughly before go-live1) Test IPMI: ipmitool -I lanplus -H ipmi-ip -U user -P ‘pass’ power status 2) Set HA fencing mode: fencing: hardware or both (Datacenter options / /etc/pve/datacenter.cfg) 3) Declare fence devices in /etc/pve/ha/fence.cfg 4) Test fence (via API/CLI) and check HA log after fence.
Watchdog fencing (fallback/airbag)Watchdog-style fencing (usually software watchdog/softdog if no HW watchdog), node self-resets when watchdog expiresFallback layer when OS/agent hangs; does not replace IPMI for serious productionDo not disable watchdog when using HA; only test during maintenance window1) Check watchdog: ls -l /dev/watchdog* ; lsmod | grep -i watchdog 2) Confirm cluster uses watchdog-based fencing (default) 3) Trace if needed: check boot log via journalctl -b -1 searching “watchdog”.
Maintenance / Evacuate nodePut node into maintenance so HA migrates/relocates resources off it before reboot/maintenanceAvoid unintended downtime; controlled maintenanceMandatory runbook: maintenance → confirm empty HA resources → reboot → disable maintenanceStandard CLI: ha-manager crm-command node-maintenance enable NODE → wait for HA VM/CT to leave node → reboot node → ha-manager crm-command node-maintenance disable NODE; monitor in Datacenter → HA → Status/Resources/Tasks.
Replication (VM on local disk)Sync VM disk on schedule (async) to have a runnable copy on another node when no shared storage exists (RPO > 0)Vital solution if no shared storagePrioritize shared storage for Tier-1; if forced local: define clear RPO/RTO and separate replication networkDatacenter → Replication → Add job (VMID, target node, schedule). Check replica exists on target node before failover test; test by simulating node failure and confirm VM starts from replica (accept schedule-based RPO).
Network separation & redundancy (corosync/migration/storage/mgmt)Split traffic: Corosync (heartbeat/vote), Migration, Storage, ManagementReduce quorum loss due to network flap; reduce migrate timeout; reduce storage contentionCorosync prioritizes low-latency & stability; separate migration network; separate storage; separate mgmt (and separate IPMI if available)1) Migration network: Datacenter → Options or /etc/pve/datacenter.cfg set migration: network=subnet 2) Check corosync link stability, do not share recklessly with heavy traffic (backup/replication).
HA anti-flap tuning (Max Restart / Max Relocate / delay)Limit restart/relocate to avoid VM “bounce/ping-pong” and loopsStabilize service after incident; reduce “self-destruction” on app errorCommon usage: Restart 1–3, Relocate 1 for production; lower restart for low stability apps, higher restart but low relocate for flaky appsDatacenter → HA → Resources → Edit resource: set Max Restart/Relocate. After incident check pve-ha-* logs (qmstart/qmshutdown) to adjust.
QDevice placement correct for production (2-node)3rd vote so 2-node cluster keeps majority when 1 node downPrevent “1/2 votes → HA freeze”Place QDevice outside 2 nodes, ideally different host/switch/power; runs only qnetd, no prod VMQDevice: systemctl enable –now corosync-qnetd; open TCP 5403. On cluster: pvecm qdevice setup qdevice-ip; verify pvecm status shows Qdevice and cluster Quorate.
Monitoring/Alerting (quorum/HA/fencing/storage)Early warning: quorum, qdevice, fencing error, HA task stuck, storage latencyReduce “find out when it’s too late” incidentsAlert levels: critical (no quorum, fencing fail), warning (qdevice unreachable, storage latency up, HA task long)Proxmox Notifications (mail/webhook) + external monitor (Zabbix/Prometheus). Periodic check: pvecm status, ha-manager status, tasks/cluster log.
Backup/Restore (PBS) for HA VMHA = uptime; not backup replacement. Backup to salvage data (corruption/delete/ransomware)Mandatory for productionSeparate PBS, retention by tier, periodic restore testAdd PBS storage → create backup jobs by schedule → check task result → test restore (restore to temp VM to verify then delete).

VII. Pre-Production Checklist VII. Checklist trước vận hành

Mục kiểm traMức độLệnh xác thựcKết quả mong đợi
Cluster đã hình thànhBẮT BUỘCpvecm nodesLiệt kê đủ 2 nodes, ID rõ ràng
Phiên bản Proxmox đồng nhấtBẮT BUỘCpveversion -v | egrep 'pve-manager|pve-qemu-kvm'Các phiên bản khớp nhau
QDevice onlineBẮT BUỘC (2-node)pvecm qdevice statusQdevice Online, Total Votes = 3
Quorum OKBẮT BUỘCpvecm statusQuorate: Yes (Flags: Qdevice)
Corosync ringsNÊN CÓcorosync-cfgtool -sRing0 active, không flapping
Trạng thái link CorosyncBẮT BUỘCjournalctl -u corosync -n 200Không có timeout/link reset lặp lại, quorum ổn định
Cấu hình mạng MigrationBẮT BUỘCgrep 'migration' /etc/pve/datacenter.cfgCó migration network đúng CIDR (vd 172.16.200.0/24)
Kết nối mạng MigrationBẮT BUỘCping -I src-mig-ip dst-mig-ipKhông packet loss, latency ổn định
Shared storage hiện diệnBẮT BUỘCpvesm statusStorage dùng chung hiển thị OK trên cả 2 node
Shared storage đã mountBẮT BUỘCdf -h | egrep 'NAS|NFS|iSCSI'Mount OK trên cả 2 node
Kết nối IPMIBẮT BUỘC (HA production)ipmitool -I lanplus -H ip -U user -P 'pass' power statusTrả về power status thành công
Cấu hình FencingBẮT BUỘC (HA production)grep -n '^fencing' /etc/pve/datacenter.cfg ; test -f /etc/pve/ha/fence.cfg && echo OKfencing = hardware/both; có fence config
Watchdog sẵn sàngNÊN CÓls /dev/watchdog*Device tồn tại
HA Resources đã đăng kýBẮT BUỘCha-manager statusquorum OK; resources listed; state=started
Độ ưu tiên HA groupBẮT BUỘCcat /etc/pve/ha/groups.cfgNode ưu tiên có priority nhỏ hơn
Test Live migrateBẮT BUỘCqm migrate 111 pve02-93-204 --onlineTASK OK
Log HA sạchBẮT BUỘCjournalctl -u pve-ha-lrm -u pve-ha-crm -n 200 --no-pagerqmstart OK, không loop restart/relocate bất thường
Test Failover (maintenance)BẮT BUỘCha-manager crm-command node-maintenance enable NODEResource relocate và started trên node còn lại
Test Failover (node down)BẮT BUỘC (HA production)Shutdown/poweroff 1 node → checkVM/CT relocate và started (thời gian phụ thuộc fencing/boot)
Backup jobs configuredBẮT BUỘC (production)(GUI) Datacenter → Backup / PBS TasksCó lịch backup, task OK
Restore test performedBẮT BUỘC (production)(GUI) Restore 1 VM vào VM tạmVM boot OK, verify dữ liệu, xoá VM tạm
Check ItemLevelVerify CommandExpected Output
Cluster FormedMANDATORYpvecm nodesAll nodes listed, IDs visible
Versions AlignedMANDATORYpveversion -v | egrep 'pve-manager|pve-qemu-kvm'Versions match across nodes
QDevice OnlineMANDATORY (2-node)pvecm qdevice statusQdevice Online, Total Votes = 3
Quorum OKMANDATORYpvecm statusQuorate: Yes (Flags include Qdevice)
Corosync RingsRECOMMENDEDcorosync-cfgtool -sRing active, no flapping
Corosync HealthMANDATORYjournalctl -u corosync -n 200 --no-pagerNo repeated timeout/link reset, quorum stable
Migration Network ConfiguredMANDATORYgrep -n 'migration' /etc/pve/datacenter.cfgMigration network exists with correct CIDR
Migration ReachabilityMANDATORYping -I src-mig-ip dst-mig-ipNo packet loss, stable latency
Shared Storage PresentMANDATORYpvesm statusShared storage shows OK on both nodes
Shared Storage MountedMANDATORYdf -h | egrep 'NAS|NFS|iSCSI'Mount OK on both nodes
IPMI ConnectivityMANDATORY (HA)ipmitool -I lanplus -H ip -U user -P 'pass' power statusReturns successful power status
Fencing ConfiguredMANDATORY (HA)grep -n '^fencing' /etc/pve/datacenter.cfg ; test -f /etc/pve/ha/fence.cfg && echo OKfencing = hardware/both; fence config exists
Watchdog ReadyRECOMMENDEDls /dev/watchdog*Device exists
HA Resources RegisteredMANDATORYha-manager statusquorum OK; resources listed; state=started
HA Group Priority SanityMANDATORYcat /etc/pve/ha/groups.cfgPriority node has lower number
Live Migrate TestMANDATORYqm migrate 111 pve02-93-204 --onlineTask completes OK
HA Logs CleanMANDATORYjournalctl -u pve-ha-lrm -u pve-ha-crm -n 200 --no-pagerqmstart OK, no abnormal restart/relocate loops
Failover Test (Maint)MANDATORYha-manager crm-command node-maintenance enable NODEResource relocate and started on remaining node
Failover Test (Down)MANDATORY (HA)Shutdown/poweroff 1 node → checkVM/CT relocate and started (time depends on fencing/boot)
Backup Jobs ConfiguredMANDATORY (production)(GUI) Datacenter → Backup / PBS TasksBackup scheduled, task OK
Restore Test PerformedMANDATORY (production)(GUI) Restore 1 VM to temp VMVM boot OK, verify data, delete temp VM

VIII. HAPPENED ISSUES & FIXES VIII. CÁC LỖI THƯỜNG GẶP

1. Lỗi: Online migrate failure – VirtIO-net MTU

Nguyên nhân: Do lệch phiên bản Proxmox/QEMU giữa 2 node (Node đích phiên bản cũ hơn node nguồn hoặc không tương thích tính năng VirtIO).

Hướng xử lý: Upgrade phiên bản 2 node same nhau (ưu tiên upgrade node thấp lên).

Hành động:

# a. Kiểm tra version trên cả 2 node 93.203 và 93.204:
root@pve02-93-204:~# pveversion -v
root@pve01-93-203:~# pveversion -v

# b. Kiểm tra source lists cả 2 node phải khớp nhau:
root@pve01-93-203:~# cat /etc/apt/sources.list
root@pve02-93-204:~# cat /etc/apt/sources.list

# c. Kiểm tra trong mục "Repositories" cả 2 node phải có:
# deb http://download.proxmox.com/debian/pve bookworm pve-no-subscription

# d. Upgrade node nào có phiên bản thấp hơn:
root@pve02-93-204:~# apt update
root@pve02-93-204:~# apt full-upgrade -y
root@pve02-93-204:~# reboot

# e. Kiểm tra lại version của 2 node:
root@pve01-93-203:~# pveversion -v | egrep 'pve-manager|qemu-server'
root@pve02-93-204:~# pveversion -v | egrep 'pve-manager|qemu-server'

2. Migrate thành công nhưng VM tự về lại node cũ

Nguyên nhân: VM-111 thuộc HA Group (HA-01) nên placement do HA quản lý. Khi migrate thủ công, HA thấy node ưu tiên (Priority 1) đang online nên tự động kéo VM về.

Hướng xử lý: Đổi priority trong HA-01 để pve02 ưu tiên cao hơn hoặc 2 node bằng nhau, hoặc bật nofailback=1.

Issue Screenshot Fig VIII.2: Migrate Failback Issue

3. HA thất bại với cụm 2 Node

Nguyên nhân: Mất Quorum (1/2 votes = 50%). Khi 1 node chết, cluster không đủ đa số phiếu (cần >50%) nên HA đóng băng để chống Split-brain.

Hướng xử lý: Giả lập thêm 1 node thứ 3 (QDevice External Vote).

Hành động:

# a. Tạo 1 server Linux và cài đặt QNetd:
root@server:~# apt update && apt install -y corosync-qnetd
root@server:~# systemctl enable --now corosync-qnetd
root@server:~# systemctl status corosync-qnetd

# b. Trên 1 node bất kỳ của cluster, gán QDevice:
root@pve01-93-203:~# pvecm qdevice setup 10.10.93.249

# c. Sau khi hoàn tất, chạy lệnh kiểm tra:
root@pve01-93-203:~# pvecm status
# Output mẫu:
# Quorate:          Yes
# Votequorum information
# ----------------------
# Expected votes:   3
# Total votes:      3
# Flags:            Quorate Qdevice

1. Error: Online migrate failure – VirtIO-net MTU

Cause: Proxmox/QEMU version mismatch between source and target nodes.

Fix: Upgrade both nodes to the same version (focus on upgrading the lower version one).

Action:

# a. Check versions:
root@node1:~# pveversion -v
root@node2:~# pveversion -v

# b. Check sources.list consistency:
cat /etc/apt/sources.list

# c. Ensure repositories are valid (e.g. no-subscription)

# d. Upgrade:
apt update && apt full-upgrade -y
reboot

# e. Re-verify versions match for pve-manager/qemu-server.

2. Migrate successful but VM moves back to source

Cause: VM is in an HA Group with a higher priority on the source node. HA detects the preferred node is up and performs failback.

Fix: Equalize priority in HA Group or enable nofailback=1.

Issue Screenshot Fig VIII.2: Migrate Failback Issue

3. HA Fails on 2-Node Cluster

Cause: Quorum loss. A 2-node cluster has 2 votes. If 1 node fails, only 1 vote remains (50%), which is not a majority (>50%). HA freezes to prevent split-brain.

Fix: Add a QDevice (3rd vote arbiter).

Action:

# a. Install QNetd on external server:
apt update && apt install -y corosync-qnetd
systemctl enable --now corosync-qnetd

# b. Setup QDevice from Proxmox node:
pvecm qdevice setup <QDEVICE-IP>

# c. Verify Quorum:
pvecm status
# Look for 'Quorate: Yes' and 'Flags: Qdevice'

© 2025 DoanhPT – Advanced Proxmox Guide

Leave a Reply

Your email address will not be published. Required fields are marked *

QR Code

Chủ web
xin được nuôi 🍜

Support Me Touch here ^_^
Contact