背景
我手里有一台运行 Proxmox VE 7.4 的服务器,基于 Debian 11(bullseye),想升级到最新的 PVE 9(Debian 13 Trixie)。升级过程选择 官方源 + 原地升级,不重装系统,同时保留所有虚拟机和配置。
升级路径概览
PVE 不支持跨版本直接升级,所以必须按官方推荐路径:
PVE 7.4 (Debian 11) → PVE 8 (Debian 12) → PVE 9 (Debian 13)升级前准备
1. 备份
- 备份所有重要 VM/CT
- 备份系统配置:
tar czvf /root/pve-config-backup.tar.gz /etc/pve /etc/network/interfaces2. 检查系统状态
pve7to8 --full确保无 FAIL。第一次检查时我遇到:
- 缺少 NTP 服务
- 有运行中的 VM
- 部分 apt 源配置为
stable而不是bullseye
从 PVE 7.4 → PVE 8
1. 修复 WARN
- 安装 NTP
apt install chrony
systemctl enable --now chrony- 停止所有 VM
qm shutdown <VMID>- 确保 apt 源为 bullseye,去掉失效的 backports
2. 切换到 Debian 12 + PVE 8 官方源
cat >/etc/apt/sources.list <<'EOF'
deb https://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
deb https://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware
deb https://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
EOF
echo "deb http://download.proxmox.com/debian/pve bookworm pve-no-subscription" >/etc/apt/sources.list.d/pve-no-sub.list3. 升级
apt update
apt full-upgrade
reboot4. 安装 UEFI 引导支持
apt install grub-efi-amd64
efibootmgr -v确认 proxmox 启动项在第一位。
从 PVE 8.4 → PVE 9
1. 检查
pve8to9 --full我遇到:
- FAIL:自定义角色使用了废弃的
VM.Monitor权限 WARN:
- 存储
scale不在线 /etc/sysctl.conf路径已废弃- 缺少 CPU 微码(intel-microcode)
- 存储
2. 修复 FAIL(PVE 8 无法添加新权限)
PVE 8 先移除 VM.Monitor:
for R in Administrator PVEAdmin PVEVMAdmin admins; do
CUR=$(pveum role show "$R" | awk -F': ' '/Privileges:/{print $2}')
NEW=$(echo "$CUR" | sed -e 's/\<VM.Monitor\>//g' -e 's/,,/,/g' -e 's/^,//' -e 's/,$//')
pveum role modify "$R" -privs "$NEW"
done3. 修复 WARN
- 临时禁用离线存储:
pvesm set scale --disable 1- 迁移 sysctl 配置:
mkdir -p /etc/sysctl.d
mv /etc/sysctl.conf /etc/sysctl.d/99-custom.conf
sysctl --system- 安装 CPU 微码:
apt install intel-microcode4. 切换到 Debian 13 + PVE 9 官方源
cat >/etc/apt/sources.list <<'EOF'
deb https://deb.debian.org/debian trixie main contrib non-free non-free-firmware
deb https://deb.debian.org/debian trixie-updates main contrib non-free non-free-firmware
deb https://security.debian.org/debian-security trixie-security main contrib non-free non-free-firmware
EOF
echo "deb http://download.proxmox.com/debian/pve trixie pve-no-subscription" >/etc/apt/sources.list.d/pve-no-sub.list5. 升级
apt update
apt full-upgrade
reboot升级完成后的收尾
1. 补回 PVE 9 新的 Guest Agent 权限
for R in Administrator PVEAdmin PVEVMAdmin admins; do
CUR=$(pveum role show "$R" | awk -F': ' '/Privileges:/{print $2}')
pveum role modify "$R" -privs "${CUR},VM.GuestAgent.Unrestricted"
done2. 启用之前禁用的存储
pvesm set scale --disable 03. 验证
pveversion
efibootmgr -v
timedatectl status
pvesm status升级踩坑记录
- 半升级状态的 apt 源 会导致依赖冲突,建议直接切到下一版本的完整源
- PVE 8 阶段无法添加 PVE 9 新权限,需要先移除旧权限,升级后补回
/etc/sysctl.conf在 PVE 9 被弃用,要迁移到/etc/sysctl.d/- CPU 微码安装建议提前完成
总结
升级虽然分两步(7.4→8→9),但整体顺利。核心经验:
- 提前用
pve7to8 --full/pve8to9 --full检查 - 源一次改全,不混用
- 逐步升级,每步后都验证
- 关键权限调整分阶段处理
最终结果:系统运行在 Proxmox VE 9.0(Debian 13 Trixie,内核 6.8),功能稳定,EFI 引导、时间同步、存储正常。