Lab / Homelab

PVE 8 至 PVE 9 升级步骤

整理 Proxmox VE 8 升级到 PVE 9 的检查、软件源切换、Ceph 源、配置文件选择、重启复查和集群升级建议。

升级前提:先确认 VM/CT 都有可用备份。升级系统不要依赖 Web GUI 里的虚拟终端,建议使用本地控制台或 SSH + tmux / screen

这是一份个人升级笔记。正式执行前请先对照 Proxmox 官方升级文档和当前节点实际环境。

准备阶段

  1. 建议先在测试机或虚拟机演练。
  2. 备份所有 VM / CT。
  3. 记录当前存储、网桥、直通设备、第三方源。
  4. 使用升级检查工具:
pve8to9 --full

反复运行,直到关键问题都处理掉。检查脚本只提示问题,不会自动修复。

升级到 PVE 8 最新小版本

apt update
apt dist-upgrade
pveversion

至少应更新到 PVE 8.4.x 再继续。

切换 Debian 源到 Trixie

sed -i 's/bookworm/trixie/g' /etc/apt/sources.list
sed -i 's/bookworm/trixie/g' /etc/apt/sources.list.d/pve-enterprise.list

检查是否还有旧源:

grep -R bookworm /etc/apt/sources.list /etc/apt/sources.list.d

有残留时先注释或改成 trixie

添加 PVE 9 软件源

企业源:

cat > /etc/apt/sources.list.d/pve-enterprise.sources << EOF
Types: deb
URIs: https://enterprise.proxmox.com/debian/pve
Suites: trixie
Components: pve-enterprise
Signed-By: /usr/share/keyrings/proxmox-archive-keyring.gpg
EOF

无订阅源:

cat > /etc/apt/sources.list.d/proxmox.sources << EOF
Types: deb
URIs: http://download.proxmox.com/debian/pve
Suites: trixie
Components: pve-no-subscription
Signed-By: /usr/share/keyrings/proxmox-archive-keyring.gpg
EOF

企业源和无订阅源不要混着启用。无订阅环境一般禁用 enterprise 源。

Ceph 源

如果使用 Ceph,需要先确认 Ceph 升级路径。PVE 9 对应 Ceph Squid v19。

企业源:

cat > /etc/apt/sources.list.d/ceph.sources << EOF
Types: deb
URIs: https://enterprise.proxmox.com/debian/ceph-squid
Suites: trixie
Components: enterprise
Signed-By: /usr/share/keyrings/proxmox-archive-keyring.gpg
EOF

无订阅源:

cat > /etc/apt/sources.list.d/ceph.sources << EOF
Types: deb
URIs: http://download.proxmox.com/debian/ceph-squid
Suites: trixie
Components: no-subscription
Signed-By: /usr/share/keyrings/proxmox-archive-keyring.gpg
EOF

执行升级

apt update
apt policy
apt dist-upgrade

升级过程中可能询问是否替换配置文件:

配置文件 建议
sshd_config 一般可选“是”,但如果改过 SSH 配置需先对比
lvm.conf 没改动可选“是”
grub 有 IOMMU / VFIO / 核显直通参数时谨慎,通常保留当前版本
chrony.conf 没改动可选“是”
issue 无关紧要,可保留当前

重启与复查

reboot

重启后:

pveversion -v
pve8to9 --full
systemctl --failed
journalctl -p err -b

检查:

  • Web UI 能正常打开。
  • VM / CT 能启动。
  • 网络桥接、VLAN、存储挂载正常。
  • 直通设备、Guest Agent、备份任务正常。
  • 浏览器强制刷新 Web UI:Ctrl+Shift+R / Cmd+Alt+R

集群升级建议

  • 每次只升级一个节点。
  • 关键 VM/CT 先迁移到其他节点。
  • 避免在新旧版本节点之间混用 GUI 操作。
  • 完全升级后再处理 HA 规则变化。

可选清理

将旧 .list 源转换为 deb822 .sources

apt modernize-sources

LVM autoactivation 问题可运行:

/usr/share/pve-manager/migrations/pve-lvm-disable-autoactivation