将 PVE 版本从 6.x 升级到 7

PVE 集群从 6.x 升级到 7 的过程,以及一些问题。

升级过程:

首先推荐看官方文档:
https://pve.proxmox.com/wiki/Upgrade_from_6.x_to_7.0

  1. 先升级到 6.4
    apt update
    apt dist-upgrade

  2. 升级到 7.0

升级前的检查

运行 pve6to7,检查是否有错误。先解决掉所有错误,然后继续。有一些警告是没关系的,可以忽略。

替换源版本

sed -i ‘s/buster/updates/bullseye-security/g;s/buster/bullseye/g’ /etc/apt/sources.list

echo “deb https://enterprise.proxmox.com/debian/pve bullseye pve-enterprise” > /etc/apt/sources.list.d/pve-enterprise.list

sed -i -e ‘s/buster/bullseye/g’ /etc/apt/sources.list.d/pve-install-repo.list

如何安装了 ceph(ceph only)
echo “deb http://download.proxmox.com/debian/ceph-octopus bullseye main” > /etc/apt/sources.list.d/ceph.list

注意1:查看 /etc/apt/sources.list.d 确认所有的源都更新到了 bullseye,有一些自己添加的源需要手动更新下。

注意2:如果提示缺少/etc/apt/sources.list.d/pve-install-repo.list 就新建一个,文件内容如下:

1
deb http://download.proxmox.wiki/debian/pve bullseye pve-no-subscription

安装

如果中途遇到问题,可以参考其他问题

apt update

apt dist-upgrade

等待下载&安装,时间会比较久。

下载完成后,有如下提示:

W: (pve-apt-hook) !! ATTENTION !!
W: (pve-apt-hook) You are attempting to upgrade from proxmox-ve ‘6.4-1’ to proxmox-ve ‘7.1-1’. Please make sure to read the Upgrade notes at
W: (pve-apt-hook) https://pve.proxmox.com/wiki/Upgrade_from_6.x_to_7.0
W: (pve-apt-hook) before proceeding with this operation.
W: (pve-apt-hook)
W: (pve-apt-hook) Press enter to continue, or C^c to abort.

点击 enter 继续,然后有一个文档,点击 q 退出文档然后继续安装。

Configuration file ‘/etc/issue’
==> Modified (by you or by a script) since installation.
==> Package distributor has shipped an updated version.
What would you like to do about it ? Your options are:
Y or I : install the package maintainer’s version
N or O : keep your currently-installed version
D : show the differences between the versions
Z : start a shell to examine the situation
The default action is to keep your current version.
*** issue (Y/I/N/O/D/Z) [default=N] ?

我在第一个节点选择了 D,为了了解更多安装过程的信息。后续的其他节点安装就选 Y 了。

Restart services during package upgrades without asking?

第一个节点选了 NO,第二次直接 YES

What do you want to do about modified configuration file sshd_config?

选择:install the package maintainer’s version

Processing triggers for initramfs-tools (0.140) …
update-initramfs: Generating /boot/initrd.img-5.13.19-3-pve
Running hook script ‘zz-proxmox-boot’..
Re-executing ‘/etc/kernel/postinst.d/zz-proxmox-boot’ in new private mount namespace..
No /etc/kernel/proxmox-boot-uuids found, skipping ESP sync.

至此已安装完成。这个信息可以忽略。

输入 pveversion 查看版本号。

1
pve-manager/7.1-10/6ddebafe (running kernel: 5.4.73-1-pve)

安装完成后

apt update
apt dist-upgrade

可能会遇到下面的问题,可以忽略,或者重启下。
E: Failed to fetch http://download.proxmox.wiki/debian/pve/dists/bullseye/pve-no-subscription/binary-amd64/Packages.gz File has unexpected size (188214 != 190716). Mirror sync in progress? [IP: 58.223.168.187 80]
Hashes of expected file:
- Filesize:190716 [weak]
- SHA512:57ec8937cb9b958aa3a3c23c518072b74ceea1df9ab9ac8c42b4c300a0c4832f192bb54901cef04c3fe839d163b3ba17ebc9ced2456eefb0d3993c5f217dc6a0
- SHA256:f6fdac013c528c77179344b497ea4ea5aa917851aa5b270e980997d7b3fa6ac5
- SHA1:10f562834cff76d6803f42a1a034b13d6888ec5c [weak]
- MD5Sum:d3d4339a975febd5b406bf03f846db67 [weak]
Release file created at: Mon, 27 Dec 2021 09:23:14 +0000
E: Some index files failed to download. They have been ignored, or old ones used instead.

忽略即可,重启后消失。

之前的一个在 A节点 无法管理 B 节点磁盘的bug 也随着这次升级解决了。

在安装时可能遇到的其他问题:

提示删除 ‘proxmox-ve’

Upgrade wants to remove package ‘proxmox-ve’

首先检查是否使用了镜像,如果使用了镜像,要先将镜像恢复到 官方源。

debian官方源:deb.debian.org

如果没有使用镜像,则可能是因为 linux-image-amd64 引起的冲突。直接删除这个包:

apt remove linux-image-amd64

升级后可能遇到的问题:

LXC 容器中的 docker 不能使用

因为 cgroup 的版本发生变化,docker 在 20.10.7 之后的版本才能使用 cgroup v2,升级docker 到最新版即可。

另外一种办法设置 systemd.unified_cgroup_hierarchy=0
参考:链接