====== Linux.proxmox ======
===== Proxmox =====
https://tteck.github.io/Proxmox/ scripts utility proxmox \\
https://phucbone.github.io/ProxmoxCheatsheet/ \\
==== Proxmox monitoring ====
influx https://forum.proxmox.com/threads/integrating-influxdb2-data-with-temperature-and-disks-info.118615/ \\
cpu and drive temp https://forum.proxmox.com/threads/proxmox-cpu-temp-and-using-in-vms.140742/ \\
++++ add temp in summary table : nvme: 48.85℃ , drivetemp: 40℃ , coretemp: 48℃ |
{{ :linux:pvebackup.tgz |}}
# url https://www.reddit.com/r/homelab/comments/rhq56e/displaying_cpu_temperature_in_proxmox_summery_in/
# use json format from vinicius_vbf / javascript from presisco
# also see more professional variant https://github.com/alexleigh/pve-mods
# load drive temp module to temperature of drives
echo "drivetemp" > /etc/modules-load.d/drivetemp.conf
scp ~/pvebackup/Nodes.pm root@192.168.114.10:/usr/share/perl5/PVE/API2/Nodes.pm
scp ~/pvebackup/pvemanagerlib.js root@192.168.114.10:/usr/share/pve-manager/js/pvemanagerlib.js
#// My variant of JavaScript code for filter wifi adaptor
function test(value){
//const c0 = value.match(/Core 0.*?\+([\d\.]+)Â/)[1];
//const c1 = value.match(/Core 1.*?\+([\d\.]+)Â/)[1];
//const c2 = value.match(/Core 2.*?\+([\d\.]+)Â/)[1];
//const c3 = value.match(/Core 3.*?\+([\d\.]+)Â/)[1];
//return `Core 0: ${c0} ℃ | Core 1: ${c1} ℃ | Core 2: ${c2} ℃ | Core 3: ${c3} ℃`
const cpu_temp_arr=JSON.parse(value)
const sections=[]
for (const [dev, arr] of Object.entries(cpu_temp_arr)) {
const temp_arr=[]
if (dev === 'iwlwifi_1-virtual-0') continue;
for (const [name, temps] of Object.entries(arr)) {
if (name === 'Adapter') {
continue
}
for(const [name, temp] of Object.entries(temps)) {
if (name.includes("_input")){
temp_arr.push(temp)
}
}
}
sections.push(dev.split('-')[0]+": "+temp_arr.join("℃ | ")+"℃ ")
}
return sections.join(", ")
}
++++
==== Proxmox Docker ====
https://docs.scrypted.app/installation.html - install docker \\
==== Proxmox external monitoring ====
Monitoring health https://www.lectron.net/docs/craft/proxmox-monitoring-and-performance-optimization/proxmox-metrics-and-alerts-monitoring-and-alerting-system-health/ \\
Monitoring smart https://www.naturalborncoder.com/linux/2023/05/23/setting-up-smart-monitoring-in-proxmox/ \\
https://blog.klimov.su/post/rasshirennyj-monitoring-proxmox-s-pomoshyu-telegraf-i-influxdb \\
===== Proxmox - SR-IOV - hardware passthrough - qsv =====
:!: \\
- upgrade to 6.5.13-5 https://forum.proxmox.com/threads/kernel-upgrade-6-5-13-1-failed-to-install.144756/ \\
\\ \\
https://foxi.buduanwang.vip/virtualization/pve/2695.html/?ref=michaels-tinkerings \\
===== Proxmox LXC - Jellyfin =====
see install upper in gpu-virtualization-with-intel-12th-gen-igpu-uhd-730/ \\
samba on Jellyfin \\
sudo mkdir /mnt/nas
sudo apt-get install cifs-utils
sudo mount -t cifs -o user=video //192.168.114.134/video /mnt/nas
# Create the directory /mnt/nas
mkdir /mnt/nas
# Create the .smb file with the specified content
echo -e "username=video\npassword=SETPWD" > ~/.smb
# Add the mount entry to /etc/fstab, replacing 'chris' with the current user
echo "//192.168.114.134/video /mnt/nas cifs uid=0,credentials=$(eval echo ~)/.smb,iocharset=utf8,vers=3.0,noperm 0 0" | sudo tee -a /etc/fstab
===== Uefi problem =====
# MOK problem
I solved this problem.
Create a Live USB/CD of Ubuntu 17.10.
Boot this USB/CD in UEFI mode (the problem doesn't happen with this version).
Open terminal and use this command: sudo mokutil --reset.
Try to boot with the system you want to install.
If you get this another error "Failed to open \EFI\BOOT\mmx64.efi", change the file name of "grubx64.efi" to "mmx64.efi" (located on /efi/boot on USB/CD).
Boot again and you will see no errors (I hope so).
====== Виртуализация======
- Книга - http://onreader.mdl.ru/MasteringProxmox.2ed/content/index.html
- Cookbook - https://www.packtpub.com/mapt/book/virtualization_and_cloud/9781783980901
- LVM https://pve.proxmox.com/wiki/Storage:_LVM
====== создание template из preconfigured cloud imag ======
* создание template cloud image https://gist.github.com/meramsey/aa759614cb5e387d8b88a0adfe77cc1d
===== Команды =====
**5 useful Proxmox VE CLI tools**
Here are 5 useful Proxmox VE commands for your CLI:\\
- Get a quick overview on how fast your system is: \\ ''%%pveperf%%''
- List all your KVM machines: \\ ''%%qm list%%''
- See how much memory your machine 101 has: \\ ''%%qm config 101 | grep ^memory%%'' \\
- Verify the subscription status of your hardware node: \\ ''%%pvesubscription get%%'' \\
- Start a backup of machine 101: \\ ''%%vzdump 101 -compress lzo%%''
Want to learn more commands for your Proxmox VE CLI? Just head to https://pve.proxmox.com/wiki/Command_line_tools
===== Proxmox.solve Error =====
If got error **trying to acquire lock...**
TASK ERROR: can't lock file '/var/lock/qemu-server/lock-102.conf' - got timeout
rm /var/lock/qemu-server/lock-102.conf
===== Proxmox.migration =====
* https://pve.proxmox.com/wiki/Moving_disk_image_from_one_KVM_machine_to_another
* fast copy (fastest way) - https://unix.stackexchange.com/questions/48399/fast-way-to-copy-a-large-file-on-a-lan
# -------------------------
# P2P migration
# copy files with image HDD to PVE in tmp directory
$ /var/lib/vz_local-v3700/tmp
sftp,scp,rsync,nc
# SFTP ~80mbit
$sftp root@10.59.6.19:/var/lib/vz_local-v3700/tmp <<< $'put ./isoj-d.hdd.qcow2'
# SCP ~40mBytes
$scp ./isoj-d.hdd.qcow2 root@10.59.6.19:/var/lib/vz_local-v3700/tmp
# buffered SCP - ~80mBytes
$tar cf - ./isoj-d.hdd.qcow2 | mbuffer | ssh melnikov_ea@10.59.0.64 "tar xf -"
# NETCAT ~~ 40mBytes
#SRC ->
$tar cv ./ | nc -q 1 10.59.6.19 1234
#DST <-
$nc -q 1 -l -p 1234 | pv -pterb -s 500G | tar xv
#!!! Rsync ~~ 85-100 MBytes
$rsync -e 'ssh -c aes128-gcm@openssh.com' -avP ./ root@10.59.6.19:/var/lib/vz_local-v3700/tmp
# Accelerate Rsync
# create VM
qm create 120 --bootdisk scsi0
# import DISK
qm importdisk 120 someImage.img someStorage
# set disk to VM
qm set 120 --scsi0 someStorage:vm-120-disk-0
# or create VM from UI with right size and name
# replace disk image with source image
$ cd /var/lib/vz_local-v3700/images/102
$ mv ../../tmp/harddisk.hdd.qcow2 vm-102-disk-0.qcow2
====== Proxmox.AGP ======
^ Hostname ^ IP ^ URL ^ Hardware ^
| ispdn-prox01 | 10.59.6.xx | https://prox01.gorod.ru:8006/ | IBM x3850 X5 7143 |
| ispdn-prox02 | 10.59.6.xx | https://prox02.gorod.ru:8006/ | IBM x3850 X5 7143 |
| ispdn-prox03 | 10.59.6.xx | https://prox03.gorod.ru:8006/ | IBM x3850 X5 7143 |