Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
proxmox [05/03/2024 - 10:52] – Externe Bearbeitung 127.0.0.1 | proxmox [25/04/2025 - 10:25] (aktuell) – thommie_netzwissen.de | ||
---|---|---|---|
Zeile 7: | Zeile 7: | ||
* Hetzner Netzwerk Doku: [[https:// | * Hetzner Netzwerk Doku: [[https:// | ||
* Netzwerk mit zwei Routing Tabellen/ | * Netzwerk mit zwei Routing Tabellen/ | ||
+ | * Helper Scripts: [[https:// | ||
- | ===== Verzeichnisstruktur ===== | + | ====== Verzeichnisstruktur |
- | ^Was ^Wo ^Anmerkung | | + | ^Was^Wo^Anmerkung| |
- | |kvm VM images |/ | + | |kvm VM images|/ |
- | |kvm VM configs |/ | + | |kvm VM configs|/ |
- | |LXC images |/ | + | |LXC images|/ |
- | |LXC configs |/ | + | |LXC configs|/ |
- | ===== PVE Server Backup ===== | + | ====== PVE Server Backup |
- | https:// | + | [[https:// |
- | ===== User Management ===== | + | ====== User Management |
User in PVE erstellen (entspricht dem shell User). Erst dann ist die Administration per Web GUI möglich. | User in PVE erstellen (entspricht dem shell User). Erst dann ist die Administration per Web GUI möglich. | ||
+ | < | ||
+ | |||
+ | pveum user add [user@pam] | ||
- | < | ||
</ | </ | ||
- | |||
- | Gruppe erstellen: | ||
- | |||
- | < | ||
- | </ | ||
- | |||
- | Rechte zuweisen: | ||
- | |||
- | < | ||
- | </ | ||
- | |||
- | Benutzer der Gruppe zuweisen: | ||
- | |||
- | < | ||
- | </ | ||
User auflisten | User auflisten | ||
Zeile 55: | Zeile 43: | ||
│ thommie@pam │ | │ thommie@pam │ | ||
└─────────────┴─────────┴─────────────────────┴────────┴────────┴───────────┴────────┴──────┴──────────┴────────────┴────────┘ | └─────────────┴─────────┴─────────────────────┴────────┴────────┴───────────┴────────┴──────┴──────────┴────────────┴────────┘ | ||
- | </ | ||
- | User disable | ||
- | |||
- | < | ||
- | pveum user modify root@pam -enable 0 | ||
</ | </ | ||
- | Andere Felder modifizieren | + | Gruppe erstellen: |
< | < | ||
- | pveum user modify | + | pveum groupadd |
</ | </ | ||
Zeile 78: | Zeile 62: | ||
│ admin │ System Administrators │ alex@pam, | │ admin │ System Administrators │ alex@pam, | ||
└─────────┴───────────────────────┴──────────────────────┘ | └─────────┴───────────────────────┴──────────────────────┘ | ||
+ | |||
</ | </ | ||
- | 2FA löschen: über gleichberechtigten User, dann Löschen von " | + | Rechte zuweisen: |
- | ===== Command Line ===== | + | < |
+ | pveum aclmod / -group admin -role Administrator | ||
+ | |||
+ | </ | ||
+ | |||
+ | Benutzer der Gruppe zuweisen: | ||
+ | |||
+ | < | ||
+ | pveum user modify testuser@pam -group admin | ||
+ | |||
+ | </ | ||
+ | |||
+ | User disable | ||
+ | |||
+ | < | ||
+ | pveum user modify root@pam -enable 0 | ||
+ | |||
+ | </ | ||
+ | |||
+ | Andere Felder modifizieren | ||
+ | |||
+ | < | ||
+ | pveum user modify admin@pam -email admin@netzwissen.de | ||
+ | |||
+ | </ | ||
+ | |||
+ | 2FA löschen | ||
+ | |||
+ | über gleichberechtigten User, dann Löschen von " | ||
+ | |||
+ | ====== Kommandozeile und Container/ | ||
**qm** | **qm** | ||
Zeile 88: | Zeile 103: | ||
**pct** | **pct** | ||
- | Alle VMs (KVM und lxc) auf einmal runterfahren | + | ==== Alle VMs (KVM und lxc) auf einmal runterfahren |
< | < | ||
pvenode stopall | pvenode stopall | ||
+ | |||
</ | </ | ||
- | VM löschen | + | oder |
< | < | ||
+ | pvesh create / | ||
+ | |||
+ | </ | ||
+ | |||
+ | Doku: [[https:// | ||
+ | |||
+ | ==== VM löschen ==== | ||
+ | < | ||
+ | |||
qm destroy 105 | qm destroy 105 | ||
+ | |||
</ | </ | ||
- | Mounten eines Containers auf dem Host | + | ==== Mounten eines Containers auf dem Host ==== |
< | < | ||
pct mount 108 mounted CT 108 in '/ | pct mount 108 mounted CT 108 in '/ | ||
+ | |||
</ | </ | ||
- | + | ==== Gemeinsames Guest Share (smb) ==== | |
- | Gemeinsames Guest Share (smb) | + | |
< | < | ||
mount.cifs \\\\10.10.10.1\\guests /mnt/guests | mount.cifs \\\\10.10.10.1\\guests /mnt/guests | ||
+ | |||
</ | </ | ||
- | Speicherverbrauch ermitteln | + | ==== Speicherverbrauch ermitteln |
< | < | ||
du -a /home | sort -n -r | head -n 5 find / -type f -size +100M | du -a /home | sort -n -r | head -n 5 find / -type f -size +100M | ||
+ | |||
</ | </ | ||
- | Container umbenennen | + | ==== Container umbenennen |
< | < | ||
+ | |||
pct set < | pct set < | ||
+ | |||
</ | </ | ||
- | Container betreten | + | ==== Container betreten |
< | < | ||
pct enter < | pct enter < | ||
+ | |||
</ | </ | ||
- | ===== Datei senden und empfangen ===== | + | ===== Container: |
Datei senden | Datei senden | ||
Zeile 137: | Zeile 167: | ||
< | < | ||
pct push < | pct push < | ||
+ | |||
</ | </ | ||
Zeile 143: | Zeile 174: | ||
< | < | ||
pct pull < | pct pull < | ||
+ | |||
</ | </ | ||
- | ===== Backups manuell ===== | + | Bei VMs geht das per scp |
+ | |||
+ | ====== Backups manuell ====== | ||
+ | |||
+ | < | ||
+ | vzdump 102 118 122 --compress zstd --mode stop --prune-backups ' | ||
- | < | ||
</ | </ | ||
- | ===== Alle VMs auf einmal runter fahren | + | ====== PVE Server ====== |
+ | |||
+ | ===== Auto-Start der VMs temporär abschalten | ||
< | < | ||
- | pvesh create / | + | systemctl disable pve-guests.service. |
</ | </ | ||
- | Doku: https:// | + | Wieder einschalten |
- | ===== PVE Templates ===== | + | < |
+ | | ||
+ | |||
+ | </ | ||
+ | |||
+ | ====== PVE Templates | ||
Erreichbare Templates auflisten | Erreichbare Templates auflisten | ||
Zeile 166: | Zeile 210: | ||
pveam available | pveam available | ||
+ | |||
</ | </ | ||
Zeile 172: | Zeile 217: | ||
< | < | ||
pveam download local debian-10.0-standard_10.0-1_amd64.tar.gz | pveam download local debian-10.0-standard_10.0-1_amd64.tar.gz | ||
+ | |||
</ | </ | ||
- | ===== PVE Firewall ===== | + | ====== PVE Firewall |
zentrale Konfiguration | zentrale Konfiguration | ||
Zeile 189: | Zeile 235: | ||
| | ||
+ | |||
</ | </ | ||
- | **Wenn die Firewall den Host blockiert: | + | **Wenn die Firewall den Host blockiert: |
< | < | ||
Zeile 213: | Zeile 260: | ||
</ | </ | ||
+ | ====== Meckermails von CERT-BUND wegen RPC ====== | ||
- | ===== SMB Mount mit Containern ===== | + | Der Port 111 ist normalerweise offen, wird aber nicht gebraucht, Zitat Proxmox Staff |
- | Geht nur mit **privileged** container. Unter /Your LXC Option/Feature muss die "CIFS capability" | + | //regarding port 111 - it should work to just remove `rpcbind, nfs-common` if you don't need it \\ We might consider doing so in a future version, but since it's expected to deploy PMG behind a firewall (or configure iptables/ |
- | ===== LXC und KVM Netplan Beispielconfigs ===== | + | Service abschalten mit |
+ | |||
+ | < | ||
+ | root@kakariki ~ # systemctl stop rpcbind | ||
+ | Warning: Stopping rpcbind.service, | ||
+ | rpcbind.socket | ||
+ | root@kakariki ~ # systemctl stop rpcbind.socket | ||
+ | root@kakariki ~ # systemctl stop rpcbind | ||
+ | root@kakariki ~ # systemctl disable rpcbind | ||
+ | Synchronizing state of rpcbind.service with SysV service script with / | ||
+ | Executing: / | ||
+ | Removed "/ | ||
+ | Removed "/ | ||
+ | |||
+ | </ | ||
+ | |||
+ | ====== SMB Mount mit Containern ====== | ||
+ | |||
+ | Geht nur mit **privileged** | ||
+ | |||
+ | ====== Netzwerk: | ||
/ | / | ||
Zeile 245: | Zeile 313: | ||
via: 136.243.85.129 | via: 136.243.85.129 | ||
metric: | metric: | ||
+ | |||
</ | </ | ||
Zeile 256: | Zeile 325: | ||
eth0: | eth0: | ||
dhcp4: | dhcp4: | ||
- | addresses: | + | addresses: |
- 10.10.10.16/ | - 10.10.10.16/ | ||
gateway4: | gateway4: | ||
Zeile 266: | Zeile 335: | ||
on-link: | on-link: | ||
/ | / | ||
+ | |||
</ | </ | ||
- | Testen: | + | Config testen mit "sudo netplan generate" |
- | sudo netplan | + | Testen mit automatischem zurücksetzen auf den vorherigen Stand: "sudo netplan |
- | Testen mit automatischem zurücksetzen auf den vorherigen Stand | + | Netplan anwenden "sudo netplan apply" |
- | sudo netplan try -timeout 180 | + | ====== LXC Container ====== |
- | Anwenden | + | [[https:// |
- | + | ||
- | sudo netplan apply | + | |
- | + | ||
- | ===== LXC speziell ===== | + | |
- | + | ||
- | https:// | + | |
Debug Modus beim Start | Debug Modus beim Start | ||
- | pct start 110 --debug | + | pct start 110 –debug |
- | ===== Port 111 rpcbind ===== | + | ====== Port 111 rpcbind |
- | Siehe [[https:// | + | Siehe [[https:// |
'' | '' | ||
Zeile 298: | Zeile 362: | ||
'' | '' | ||
- | ===== Datenwiederherstellung | + | ==== LXC: raw Device mounten |
+ | |||
+ | Welche loop devices werden aktuell benutzt | ||
+ | < | ||
+ | |||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | |||
+ | </ | ||
+ | |||
+ | Ablauf manuell | ||
+ | |||
+ | < | ||
+ | losetup /dev/loop22 disk-drive-ide0.raw | ||
+ | partx -v --add / | ||
+ | mount / | ||
+ | |||
+ | </ | ||
+ | |||
+ | < | ||
+ | root@tokoeka / | ||
+ | root@tokoeka / | ||
+ | partition: none, disk: / | ||
+ | / | ||
+ | range recount: max partno=1, lower=0, upper=0 | ||
+ | / | ||
+ | root@tokoeka / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | |||
+ | </ | ||
+ | |||
+ | Auflisten aller Loop-Devices | ||
+ | < | ||
+ | |||
+ | losetup -l | ||
+ | |||
+ | </ | ||
+ | |||
+ | Devices abhängen, mit -D alle zugehörigen abhängen | ||
+ | |||
+ | < | ||
+ | losetup -d | ||
+ | |||
+ | losetup -D | ||
+ | |||
+ | </ | ||
+ | |||
+ | Parsen der Partitionstabelle und anlegen von loop Einträgen nach Bedarf | ||
+ | |||
+ | < | ||
+ | partx -v --add / | ||
+ | |||
+ | </ | ||
+ | |||
+ | Partitionstabelle zeigen | ||
+ | |||
+ | < | ||
+ | root@tokoeka /mnt # partx -s / | ||
+ | NR START | ||
+ | | ||
+ | |||
+ | </ | ||
+ | |||
+ | pct set | ||
+ | |||
+ | < | ||
+ | pct set 116 -mp1 volume=data: | ||
+ | |||
+ | </ | ||
+ | |||
+ | ===== Datensicherung: | ||
Dumpfiles werden im Format *.lzo oder *.tar.zst komprimiert abgelegt. Sie enthalten die VM Daten im raw Format. | Dumpfiles werden im Format *.lzo oder *.tar.zst komprimiert abgelegt. Sie enthalten die VM Daten im raw Format. | ||
Zeile 306: | Zeile 454: | ||
< | < | ||
zstd -d vzdump-lxc-113-2022_05_14-01_30_57.tar.zst | zstd -d vzdump-lxc-113-2022_05_14-01_30_57.tar.zst | ||
+ | |||
</ | </ | ||
- | danach mit tar xf ...tar auspacken. | + | danach mit tar xf …tar auspacken. |
< | < | ||
- | |||
lzop -x [*.lzo Datei] | lzop -x [*.lzo Datei] | ||
Zeile 359: | Zeile 507: | ||
</ | </ | ||
- | Der Offset ist also **<font inherit/ | + | Der Offset ist also **4096 x 512 = 2097152.** |
< | < | ||
Zeile 381: | Zeile 529: | ||
</ | </ | ||
- | ===== KVM: qcow2 Device mounten ===== | + | ====== KVM VMs (qemu) ====== |
+ | |||
+ | ===== qcow2 Device mounten ===== | ||
< | < | ||
Zeile 387: | Zeile 537: | ||
qemu-nbd --connect=/ | qemu-nbd --connect=/ | ||
+ | |||
</ | </ | ||
Zeile 412: | Zeile 563: | ||
< | < | ||
mount /dev/nbd0p1 / | mount /dev/nbd0p1 / | ||
+ | |||
</ | </ | ||
Zeile 422: | Zeile 574: | ||
rmmod nbd | rmmod nbd | ||
- | </ | ||
- | |||
- | ===== LXC: raw Device mounten ===== | ||
- | |||
- | Welche loop devices werden aktuell benutzt | ||
- | |||
- | < | ||
- | < | ||
- | < | ||
- | < | ||
- | < | ||
- | < | ||
- | < | ||
- | / | ||
- | / | ||
- | / | ||
- | / | ||
- | / | ||
- | / | ||
- | / | ||
- | / | ||
</ | </ | ||
- | Ablauf manuell | + | ===== KVM: Platte vergrössern ===== |
- | < | + | [[https://tech.surveypoint.com/ |
- | losetup | + | |
- | partx -v --add /dev/loop22 | + | |
- | mount /dev/loop22p1 | + | |
- | </ | + | ====== |
- | < | + | ====== Daten-Konvertierungen ====== |
- | root@tokoeka / | + | |
- | root@tokoeka / | + | |
- | partition: none, disk: / | + | |
- | / | + | |
- | range recount: max partno=1, lower=0, upper=0 | + | |
- | / | + | |
- | root@tokoeka / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | </code> | + | [[https:// |
- | Auflisten aller Loop-Devices | + | Split disks in eine Datei umwandeln |
< | < | ||
- | losetup | + | vmware-vdiskmanager -r leapsrv.vmdk -t 0 / |
</ | </ | ||
- | Devices abhängen, mit -D alle zugehörigen abhängen | + | Wandeln von vmdk nach qcow2 |
< | < | ||
- | losetup | + | qemu-img convert |
- | + | ||
- | losetup | + | |
</ | </ | ||
- | Parsen der Partitionstabelle und anlegen | + | Andersrum |
< | < | ||
- | partx -v --add /dev/loop20 | + | qemu-img convert |
</ | </ | ||
- | Partitionstabelle zeigen | + | ====== SPICE ====== |
+ | Doku: [[https:// | ||
< | < | ||
- | root@tokoeka /mnt # partx -s /dev/loop22 | ||
- | NR START | ||
- | | ||
- | </ | ||
- | |||
- | pct set | ||
- | |||
- | < | ||
- | pct set 116 -mp1 volume=data: | ||
- | |||
- | </ | ||
- | |||
- | Offen: offset? p1 ? | ||
- | |||
- | |||
- | ===== Daten-Konvertierungen ===== | ||
- | |||
- | https:// | ||
- | |||
- | Split disks in eine Datei umwandeln | ||
- | |||
- | < | ||
- | vmware-vdiskmanager -r leapsrv.vmdk -t 0 / | ||
- | </ | ||
- | |||
- | Wandeln von vmdk nach qcow2 | ||
- | |||
- | < | ||
- | qemu-img convert -f vmdk -O qcow2 leapsrv_combined.vmdk leapsrv_combined.vmdk.qcow2 | ||
- | </ | ||
- | |||
- | Andersrum von qcow2 (kvm) nach raw (lxc): | ||
- | |||
- | < | ||
- | </ | ||
- | |||
- | ====== SPICE ====== | ||
- | |||
- | Doku: https:// | ||
- | Hilfs-Skript in / | ||
- | |||
- | < | ||
Usage: ./spice.sh [-u < | Usage: ./spice.sh [-u < | ||
Zeile 546: | Zeile 621: | ||
node: Proxmox cluster node name | node: Proxmox cluster node name | ||
proxy: DNS or IP (use < | proxy: DNS or IP (use < | ||
+ | |||
</ | </ | ||
- | |||
Client: virt-viewer, | Client: virt-viewer, | ||
- | + | ||
====== ZFS Installation ====== | ====== ZFS Installation ====== | ||
Zeile 557: | Zeile 632: | ||
apt install linux-headers-amd64 zfsutils-linux zfs-dkms zfs-zed | apt install linux-headers-amd64 zfsutils-linux zfs-dkms zfs-zed | ||
- | [https:// | + | [[: |
===== Partitionieren ===== | ===== Partitionieren ===== | ||
Zeile 565: | Zeile 640: | ||
(Achtung: gdisk konvertiert MBR nach GPT) | (Achtung: gdisk konvertiert MBR nach GPT) | ||
- | / | + | / |
- | / | + | |
- | DISK1=/ | + | DISK1=/ |
- | DISK2=/ | + | |
Dannach zpool anlegen. " | Dannach zpool anlegen. " | ||
- | |||
< | < | ||
+ | |||
zpool create [-dfn] [-m mountpoint] [-o property=value]… [-o feature@feature=value] | zpool create [-dfn] [-m mountpoint] [-o property=value]… [-o feature@feature=value] | ||
[-o compatibility=off|legacy|file[, | [-o compatibility=off|legacy|file[, | ||
- | </ | ||
+ | </ | ||
< | < | ||
+ | |||
zpool create \ | zpool create \ | ||
-o ashift=12 \ | -o ashift=12 \ | ||
Zeile 605: | Zeile 679: | ||
/ | / | ||
/ | / | ||
+ | |||
</ | </ | ||
Zeile 623: | Zeile 698: | ||
root@kakariki /etc/pve # pvenode acme cert order | root@kakariki /etc/pve # pvenode acme cert order | ||
+ | |||
</ | </ | ||
- | Loading ACME account details | + | Loading ACME account details Placing ACME order Order URL: <[[https:// |
- | Placing ACME order | + | |
- | Order URL: < | + | |
- | Getting authorization details from '< | + | Getting authorization details from '<[[https:// |
- | The validation for kakariki.netzwissen.de is pending! | + | |
- | Setting up webserver | + | |
- | Triggering validation | + | |
- | Sleeping for 5 seconds | + | |
- | Status is ' | + | |
All domains validated! | All domains validated! | ||
- | Creating CSR | + | Creating CSR Checking order status Order is ready, finalizing order valid! |
- | Checking order status | + | |
- | Order is ready, finalizing order | + | |
- | valid! | + | |
- | Downloading certificate | + | Downloading certificate Setting pveproxy certificate and key Restarting pveproxy Task OK |
- | Setting pveproxy certificate and key | + | |
- | Restarting pveproxy | + | |
- | Task OK | + | |
### ACME DNS validation Hetzner DNS API | ### ACME DNS validation Hetzner DNS API | ||
export HETZNER_Token="< | export HETZNER_Token="< | ||
- | |||
< | < | ||
+ | |||
./acme.sh --issue --dns dns_hetzner -d example.com -d *.example.com | ./acme.sh --issue --dns dns_hetzner -d example.com -d *.example.com | ||
+ | |||
</ | </ | ||
+ | |||
+ | |||
+ | |||