Tonton Jo - 2020
https://www.youtube.com/c/TontonJo
Join me on Youtube:You'll find there some usefull commands used for proxmox
1 - Proxmox
1.1 - Stop all services:
for i in pve-cluster pvedaemon vz qemu-server pveproxy pve-cluster; do systemctl stop $i ; done
2 - VM Management
2.1 - Disk passtrough
qm set VMID -scsi0 /dev/sdX
2.2 - Appliance Import
qm importdisk VMID pathtoappliance.ova local-lvm
3 - Disk Management
3.1 - Find a disc with ID:
ls /dev/disk/by-id/ -la
ls /dev/disk/by-id/ -la | grep "serial"
3.2 - list disk informations: Replace X
lsblk -o name,model,serial,uuid /dev/sdX
3.3 - find disk UUID or partition UUID
ls -l /dev/disk/by-uuid
ls -l /dev/disk/by-partuuid
3.4 - Wipe Disk
wipefs -af /dev/sdX
3.5 - Read actual partition status after change
hdparm -z /dev/sdX
echo 1 > /sys/block/sdX/device/rescan
4 - Zpool Management
4.1 - Remove import of removed pools at startup:
4.1.1 - Identify your pools:
systemctl | grep zfs
4.1.2 - Remove import of a pool at boot (remove old pools from load)
systemctl disable zfs-import@zpoolname.service
4.2 - Find ARC RAM usage for Zpool:
awk '/^size/ { print $1 " " $3 / 1048576 }' < /proc/spl/kstat/zfs/arcstats
4.3 - Find Compression ratio and used space:
zfs list -o name,avail,used,refer,lused,lrefer,mountpoint,compress,compressratio
4.4 - Replace Zpool Drive:
zpool replace pool /old/drive /new/drive
4.5 - Mark a pool as OK - Clear errors on pool and drives
zpool clear "poolname"
4.6 - Get Zpool version:
zpool --version
4.7 - Ugrade a zpool:
zpool upgrade "poolname"
5 - Monitoring
5.1 - Live disk IO
watch -n 1 "zpool iostat -v"
6 - Tools
Ioping - usefull to simulate drive activity and therefore locating it.
s-tui - Graphical interface to monitor system performances
stress - install it with s-tui to be able to stress your system - dont use in prod