其它主机先运行
pvecm node
pvecm delnode pveName
自已运行
systemctl stop pve-cluster.service systemctl stop corosync.service pmxcfs -l rm /etc/pve/corosync.conf rm -rf /etc/corosync/* killall pmxcfs systemctl start pve-cluster.service
其它主机先运行
pvecm node
pvecm delnode pveName
自已运行
systemctl stop pve-cluster.service systemctl stop corosync.service pmxcfs -l rm /etc/pve/corosync.conf rm -rf /etc/corosync/* killall pmxcfs systemctl start pve-cluster.service
Proxmox already contains the ACS override patches, so you can just add the pcie_acs_override=downstream
or if necessary pcie_acs_override=downstream,multifunction
kernel parameters to GRUB or systemd-boot (please check the PVE manual to find out which is used in your case). It usually "breaks" all IOMMU group and there allows you to ignore security isolation of the IOMMU groups. PCI(e) devices can do DMA (DIrect memory access, as in reading and writing any part of the VM memory) and talk to other PCI(e) devices in the same group. This is a security issue and your should not use it if you run untrusted software or allow untrusted users to access your VMs. Also, there are no guarantees that it will work. It just allows you to ignore ACS as your own risk.
查询直通分组信息:
for d in /sys/kernel/iommu_groups/*/devices/*; do n=${d#*/iommu_groups/*}; n=${n%%/*}; printf 'IOMMU group %s ' "$n"; lspci -nns "${d##*/}"; done
转自 https://github.com/andyljones/coolgpus
./pip install wheel
pip install coolgpus
sudo $(which coolgpus) --speed 99 99
If you hear your server take off, it works! Now interrupt it and re-run either with Sensible Defaults (TM),
sudo $(which coolgpus)
or you can pass your own fan curve with
sudo $(which coolgpus) --temp 17 84 --speed 15 99
This will make the fan speed increase linearly from 15% at <17C to 99% at >84C. You can also increase --hyst
if you want to smooth out oscillations, at the cost of the fans possibly going faster than they need to.
More generally, you can list any sequence of (increasing!) temperatures and speeds, and they'll be linearly interpolated:
sudo $(which coolgpus) --temp 20 55 80 --speed 5 30 99
Now the fan speed will be 5% at <20C, then increase linearly to 30% up to 55C, then again linearly to 99% up to 80C.
If your system uses systemd and you want to run this as a service, create a systemd unit file at /etc/systemd/system/coolgpus.service
as per this template:
[Unit]
Description=Headless GPU Fan Control
After=syslog.target
[Service]
ExecStart=/home/ajones/conda/bin/coolgpus --kill
Restart=on-failure
RestartSec=5s
ExecStop=/bin/kill -2 $MAINPID
KillMode=none
[Install]
WantedBy=multi-user.target
You just need to sub in your own install location (which you can find with which coolgpus
), and any flags you want. Then enable and start it with
sudo systemctl enable coolgpus
sudo systemctl start coolgpus
1、默认方式新建虚拟机,不要硬盘
2、qm importdisk 103 /var/lib/vz/template/iso/arpl.img local-lvm
man qm
3、转换后把生成的unused Disk从scsi控制器转成 sata
4、查询主机的硬盘控制器,可以通过lspci命令
一般来说,带SCSI /SATA字样的都是磁盘控制器
5、查看硬盘所属硬盘控制器
ls -la /sys/dev/block/|grep -v loop |grep -v dm
不知道pve所在的硬盘。可以使用命令lsblk查看,有pve-root的,便是pve所在的硬盘
6、硬盘直通方法(这是控制器直通的方法)
第一步:确认自己的主板CPU是否支持Vt-d功能
不支持就搞不了直通。intel要b75以上芯片组才支持。也就是说intel4代酷睿处理器以上,都支持。amd不明。
VT-D是io虚拟化。不是VT-X,
要开启vt-d才能io虚拟化。AMD平台是iommu,某些OEM主板上叫SRIOV。请注意。
第二步:开启iommu
#编辑grub,请不要盲目改。根据自己的环境,选择设置
vi /etc/default/grub
#在里面找到:
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
#然后修改为:
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on iommu=pt"
#如果是amd cpu请改为:
GRUB_CMDLINE_LINUX_DEFAULT="quiet amd_iommu=on iommu=pt"
#如果是需要显卡直通,建议在cmdline再加一句video=vesafb:off video=efifb:off video=simplefb:off,加了之后,pve重启进内核后停留在一个画面,这是正常情况
GRUB_CMDLINE_LINUX_DEFAULT="quiet amd_iommu=on iommu=pt video=vesafb:off video=efifb:off video=simplefb:off"
修改完成之后,直接更新grub
update-grub
注意,如果此方法还不能开启iommu,请修改
/etc/kernel/cmdline文件
并且使用proxmox-boot-tool refresh 更新启动项
Rebuild the UEFI with
update-initramfs -u -k all
pve-efiboot-tool refresh
第三步 加载相应的内核模块
echo vfio >> /etc/modules
echo vfio_iommu_type1 >> /etc/modules
echo vfio_pci >> /etc/modules
echo vfio_virqfd >> /etc/modules
使用update-initramfs -k all -u命令更新内核参数
重启主机
第四步 验证是否开启iommu
重启之后,在终端输入
dmesg | grep iommu
出现如下例子。则代表成功
[ 1.341100] pci 0000:00:00.0: Adding to iommu group 0
[ 1.341116] pci 0000:00:01.0: Adding to iommu group 1
[ 1.341126] pci 0000:00:02.0: Adding to iommu group 2
[ 1.341137] pci 0000:00:14.0: Adding to iommu group 3
[ 1.341146] pci 0000:00:17.0: Adding to iommu group 4
此时输入命令
find /sys/kernel/iommu_groups/ -type l
#出现很多直通组,就代表成功了。如果没有任何东西,就是没有开启
7、返回PVE的虚拟机,添加PCI设备, 在raw device上找刚才看到sata的id
查看硬盘控制器iommu分组
find /sys/kernel/iommu_groups/ -type l
Create a file like /etc/modprobe.d/vfio.conf setting the allow_unsafe_interrupts option for the vfio module.
options vfio_iommu_type1 allow_unsafe_interrupts=1
Otherwise you’ll get an error when trying to start a VM with a PCI device passed through: “failed to set iommu for container: Operation not permitted”
Apparently the IOMMU interrupt remapping is kinda broken on this platform.
RDM磁盘直通,不需要开启iommu。只能在PVE命令行中添加。
我们可以通过下面命令,列出当前的硬盘列表
ls -la /dev/disk/by-id/|grep -v dm|grep -v lvm|grep -v part
如下面的例子
- root@pve:~# ls -la /dev/disk/by-id/|grep -v dm|grep -v lvm|grep -v part
- total 0
- drwxr-xr-x 2 root root 540 Apr 28 16:39 .
- drwxr-xr-x 6 root root 120 Mar 3 15:52 ..
- lrwxrwxrwx 1 root root 13 Apr 28 16:39 nvme-eui.01000000010000005cd2e431fee65251 -> ../../nvme2n1
- lrwxrwxrwx 1 root root 13 Mar 3 15:52 nvme-eui.334843304aa010020025385800000004 -> ../../nvme1n1
- lrwxrwxrwx 1 root root 13 Apr 28 17:36 nvme-eui.334843304ab005400025385800000004 -> ../../nvme0n1
- lrwxrwxrwx 1 root root 13 Apr 28 16:39 nvme-INTEL_SSDPE2KX020T8_BTLJ039307142P0BGN -> ../../nvme2n1
- lrwxrwxrwx 1 root root 13 Mar 3 15:52 nvme-SAMSUNG_MZWLL800HEHP-00003_S3HCNX0JA01002 -> ../../nvme1n1
- lrwxrwxrwx 1 root root 13 Apr 28 17:36 nvme-SAMSUNG_MZWLL800HEHP-00003_S3HCNX0JB00540 -> ../../nvme0n1
- lrwxrwxrwx 1 root root 9 Mar 3 15:52 scsi-35000c500474cd7eb -> ../../sda
- lrwxrwxrwx 1 root root 9 Mar 3 15:52 wwn-0x5000c500474cd7eb -> ../../sda
nvme开头的是nvme硬盘,ata开头是走sata或者ata通道的设备。,scsi是scsi设备-阵列卡raid或者是直通卡上的硬盘。
我们可以通过qm set <vmid>
进行RDM直通
例如你有一个虚拟机,虚拟机的vmid是101,--scsiX,这里的X是整数,最多为如果你不清楚vmid这个是什么含义,你可以参考下面文章
你打算直通intel的一个nvme硬盘,那么你可以使用下面命令
- qm set 101 --scsi1 /dev/disk/by-id/nvme-INTEL_SSDPE2KX020T8_BTLJ039307142P0BGN
执行之后,你可以在面板中看到下面这个硬盘。
当然,你也可以使用ide或者sata形式直通硬盘,如下
qm set 101 --sata1 /dev/disk/by-id/nvme-INTEL_SSDPE2KX020T8_BTLJ039307142P0BGN
qm set 101 --ide1 /dev/disk/by-id/nvme-INTEL_SSDPE2KX020T8_BTLJ039307142P0BGN
建议为scsi设备,这样性能理论上是最优秀的。
需要注意的是,scsi会有序号,如scsi1,scsi0。在操作之前,应该要知道哪些scsi号是空的。对于pve来说,sata最多有6个设备。如果要使用sata类型直通,请勿超过sata5.
如果想要了解什么最多6个sata,请参考
https://www.intel.com/content/dam/www/public/us/en/documents/product-briefs/q35-chipset-brief.pdf
如果需要取消直通,可以使用命令qm set <vmid> --delete s
如上面的例子,你应该输入
qm set 101 --delete
出现update 即代表成功。可返回网页上查看。
- root@pve:~# qm set 101 --delete scsi1
- update VM 101: -delete scsi1
要删除Catalyst 2960X交换机上的所有LACP(Link Aggregation Control Protocol)配置,可以按照以下步骤进行操作:
连接到交换机:使用终端模拟器(如PuTTY)或通过控制台端口连接到Catalyst 2960X交换机。
进入特权模式:输入用户名和密码登录到交换机,并进入特权模式。默认情况下,用户名为"admin",密码为空(直接按Enter键)。
进入全局配置模式:输入以下命令以进入全局配置模式:
bashenable
configure terminal
删除LACP配置:输入以下命令以删除LACP配置:
gointerface range <interface-range>
no channel-group <group-number> mode active
其中,<interface-range>
是指包含要删除LACP配置的接口范围,例如 "GigabitEthernet1/0/1-24" 表示从接口1/0/1到1/0/24。<group-number>
是LACP组的组号,需要删除的LACP配置对应的组号。
如果要删除所有接口上的LACP配置,可以使用以下命令:
gointerface range <interface-range>
no channel-group
这将删除所有接口上的LACP配置。
保存配置更改:输入以下命令保存配置更改:
arduinoend write
这将保存配置更改并退出配置模式。
通过执行以上步骤,你将能够删除Catalyst 2960X交换机上的所有LACP配置。请确保在操作前备份交换机的配置,以防需要恢复配置。
216.239.38.120 是 Google 提供的一个特殊 DNS 服务器,用于强制开启 YouTube 受限模式(Restricted Mode) 。 如果你想在家里强制 YouTube 进入受限模式,可以在 路由器的 DNS 设置 中配置以下 DNS 服务器: D...