PVE7 GPU卡直通

参考软件手册“10.9 PCI(e) Passthrough”
参考https://blog.csdn.net/nasooo/article/details/118105494
此方法不适用于作为显卡使用,只适用于作为运算卡使用

# 开启iommu
# 以下是grub的方式,systemd-boot的方式不一样

# 修改/etc/default/grub
# 在变量GRUB_CMDLINE_LINUX_DEFAULT中增加intel_iommu=on

update-grub

# 加载kernel modules
cat <<EOF >>/etc/modules
vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd
EOF
update-initramfs -u -k all

# 重启
reboot

创建虚拟机后,增加GPU卡
在这里插入图片描述
在这里插入图片描述

附国内源

apt install apt-transport-https ca-certificates

  • Debian源:/etc/apt.sources.list

deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
#deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
#deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
#deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free
#deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free

  • PVE源:/etc/apt/sources.list.d/pve-enterprise.list

deb https://mirrors.tuna.tsinghua.edu.cn/proxmox/debian bullseye pve-no-subscription

  • LXC源:/usr/share/perl5/PVE/APLInfo.pm
sed -i 's|http://download.proxmox.com|https://mirrors.tuna.tsinghua.edu.cn/proxmox|g' /usr/share/perl5/PVE/APLInfo.pm
# sed -i "s#http://download.proxmox.com/images#https://mirrors.ustc.edu.cn/proxmox/images#g" /usr/share/perl5/PVE/APLInfo.pm
systemctl restart pvedaemon.service

VM迁移

  • 在GUI上对需要迁移的VM进行“备份”,备份目录一般在/var/lib/vz/dump中,类似vzdump-qemu-101-2020_11_14-19_31_53.vma.zst
  • 把备份文件拷贝到需要导入的PVE服务器中
  • 执行命令:qmrestore file id,注意id不要和已有的冲突

增加硬盘

  • 硬盘做好分区、格式化
  • 在节点->硬盘->LVM-Thin中,选择“Create Thinpool”
  • 在数据中心->存储中,选择添加LVM-Thin

如果是需要扩展系统自带的LVM-Thin(data):

  • 硬盘做好分区、格式化
  • 使用pvcreate创建PV
  • 使用vgextend把PV加入到已有的VG(pve)中
  • 使用lvextend扩展逻辑卷大小
  • 使用xfs_growfs或者resize2fs是增加的容量生效
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值