Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
proxmox [20/03/2024 - 07:39] – admin | 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| | ||
Zeile 16: | Zeile 17: | ||
|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. | ||
Zeile 26: | Zeile 27: | ||
pveum user add [user@pam] | pveum user add [user@pam] | ||
+ | |||
+ | </ | ||
+ | |||
+ | User auflisten | ||
+ | |||
+ | < | ||
+ | root@pveroser: | ||
+ | ┌─────────────┬─────────┬─────────────────────┬────────┬────────┬───────────┬────────┬──────┬──────────┬────────────┬────────┐ | ||
+ | │ userid | ||
+ | ╞═════════════╪═════════╪═════════════════════╪════════╪════════╪═══════════╪════════╪══════╪══════════╪════════════╪════════╡ | ||
+ | │ alex@pam | ||
+ | ├─────────────┼─────────┼─────────────────────┼────────┼────────┼───────────┼────────┼──────┼──────────┼────────────┼────────┤ | ||
+ | │ root@pam | ||
+ | ├─────────────┼─────────┼─────────────────────┼────────┼────────┼───────────┼────────┼──────┼──────────┼────────────┼────────┤ | ||
+ | │ thommie@pam │ | ||
+ | └─────────────┴─────────┴─────────────────────┴────────┴────────┴───────────┴────────┴──────┴──────────┴────────────┴────────┘ | ||
</ | </ | ||
Zeile 36: | Zeile 53: | ||
</ | </ | ||
- | Rechte zuweisen: | + | Gruppen auflisten |
< | < | ||
- | pveum aclmod / -group admin -role Administrator | + | root@pveroser: |
+ | ┌─────────┬───────────────────────┬──────────────────────┐ | ||
+ | │ groupid │ comment | ||
+ | ╞═════════╪═══════════════════════╪══════════════════════╡ | ||
+ | │ admin │ System Administrators │ alex@pam, | ||
+ | └─────────┴───────────────────────┴──────────────────────┘ | ||
</ | </ | ||
- | Benutzer der Gruppe | + | Rechte |
< | < | ||
- | | + | |
</ | </ | ||
- | User auflisten | + | Benutzer der Gruppe zuweisen: |
< | < | ||
- | root@pveroser: | + | pveum user modify testuser@pam -group |
- | ┌─────────────┬─────────┬─────────────────────┬────────┬────────┬───────────┬────────┬──────┬──────────┬────────────┬────────┐ | + | |
- | │ userid | + | |
- | ╞═════════════╪═════════╪═════════════════════╪════════╪════════╪═══════════╪════════╪══════╪══════════╪════════════╪════════╡ | + | |
- | │ alex@pam | + | |
- | ├─────────────┼─────────┼─────────────────────┼────────┼────────┼───────────┼────────┼──────┼──────────┼────────────┼────────┤ | + | |
- | │ root@pam | + | |
- | ├─────────────┼─────────┼─────────────────────┼────────┼────────┼───────────┼────────┼──────┼──────────┼────────────┼────────┤ | + | |
- | │ thommie@pam │ | + | |
- | └─────────────┴─────────┴─────────────────────┴────────┴────────┴───────────┴────────┴──────┴──────────┴────────────┴────────┘ | + | |
</ | </ | ||
Zeile 80: | Zeile 93: | ||
</ | </ | ||
- | Gruppen auflisten | + | 2FA löschen |
- | < | + | über gleichberechtigten User, dann Löschen von " |
- | root@pveroser: | + | |
- | ┌─────────┬───────────────────────┬──────────────────────┐ | + | |
- | │ groupid │ comment | + | |
- | ╞═════════╪═══════════════════════╪══════════════════════╡ | + | |
- | │ admin │ System Administrators │ alex@pam,thommie@pam │ | + | |
- | └─────────┴───────────────────────┴──────────────────────┘ | + | |
- | </ | + | ====== Kommandozeile und Container/ |
- | + | ||
- | 2FA löschen: über gleichberechtigten User, dann Löschen von " | + | |
- | + | ||
- | ===== Command Line ===== | + | |
**qm** | **qm** | ||
Zeile 100: | Zeile 103: | ||
**pct** | **pct** | ||
- | Alle VMs (KVM und lxc) auf einmal runterfahren | + | ==== Alle VMs (KVM und lxc) auf einmal runterfahren |
< | < | ||
Zeile 107: | Zeile 110: | ||
</ | </ | ||
- | 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 ==== |
< | < | ||
Zeile 121: | Zeile 133: | ||
</ | </ | ||
- | Gemeinsames Guest Share (smb) | + | ==== Gemeinsames Guest Share (smb) ==== |
< | < | ||
Zeile 128: | Zeile 140: | ||
</ | </ | ||
- | Speicherverbrauch ermitteln | + | ==== Speicherverbrauch ermitteln |
< | < | ||
Zeile 135: | Zeile 147: | ||
</ | </ | ||
- | Container umbenennen | + | ==== Container umbenennen |
< | < | ||
Zeile 142: | Zeile 154: | ||
</ | </ | ||
- | Container betreten | + | ==== Container betreten |
< | < | ||
Zeile 149: | Zeile 161: | ||
</ | </ | ||
- | ===== Datei senden und empfangen ===== | + | ===== Container: |
Datei senden | Datei senden | ||
Zeile 165: | Zeile 177: | ||
</ | </ | ||
- | ===== Backups manuell ===== | + | Bei VMs geht das per scp |
+ | |||
+ | ====== Backups manuell | ||
< | < | ||
Zeile 172: | Zeile 186: | ||
</ | </ | ||
- | ===== 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 | ||
- | < | ||
+ | < | ||
pveam update | pveam update | ||
Zeile 199: | Zeile 220: | ||
</ | </ | ||
- | ===== PVE Firewall ===== | + | ====== PVE Firewall |
zentrale Konfiguration | zentrale Konfiguration | ||
Zeile 239: | Zeile 260: | ||
</ | </ | ||
- | ===== Meckermails von CERT-BUND wegen RPC ===== | + | ====== Meckermails von CERT-BUND wegen RPC ====== |
- | Portt 11 ist normalerweise offen, wird aber nicht gebraucht, Zitat Proxmox Staff | + | Der Port 111 ist normalerweise offen, wird aber nicht gebraucht, Zitat Proxmox Staff |
//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/ | //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/ | ||
Zeile 261: | Zeile 282: | ||
</ | </ | ||
- | ===== SMB Mount mit Containern ===== | + | ====== SMB Mount mit Containern |
Geht nur mit **privileged** | Geht nur mit **privileged** | ||
- | ===== LXC und KVM Netplan Beispielconfigs ===== | + | ====== Netzwerk: |
/ | / | ||
Zeile 317: | Zeile 338: | ||
</ | </ | ||
- | 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 | + | |
- | + | ||
- | sudo netplan apply | + | |
- | + | ||
- | ===== LXC speziell | + | |
[[https:// | [[https:// | ||
Zeile 337: | Zeile 352: | ||
pct start 110 –debug | pct start 110 –debug | ||
- | ===== Port 111 rpcbind ===== | + | ====== Port 111 rpcbind |
- | Siehe [[https:// | + | Siehe [[https:// |
'' | '' | ||
Zeile 347: | 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. | ||
zst dekomprimieren | zst dekomprimieren | ||
- | < | ||
+ | < | ||
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 | ||
Zeile 408: | Zeile 507: | ||
</ | </ | ||
- | Der Offset ist also ** | + | Der Offset ist also **4096 x 512 = 2097152.** |
- | < | + | |
< | < | ||
Zeile 431: | Zeile 529: | ||
</ | </ | ||
- | ===== KVM: qcow2 Device mounten ===== | + | ====== KVM VMs (qemu) ====== |
+ | |||
+ | ===== qcow2 Device mounten ===== | ||
< | < | ||
Zeile 477: | Zeile 577: | ||
</ | </ | ||
- | ===== LXC: raw Device mounten | + | ===== KVM: Platte vergrössern |
- | Welche loop devices werden aktuell benutzt | + | [[https://tech.surveypoint.com/tips/resize-kvm-guest-virtual-disk-partition/ |
- | + | ||
- | < | + | |
- | < | + | |
- | < | + | |
- | < | + | |
- | < | + | |
- | < | + | |
- | < | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | + | ||
- | </ | + | |
- | + | ||
- | Ablauf manuell | + | |
- | + | ||
- | < | + | |
- | losetup /dev/loop22 disk-drive-ide0.raw | + | |
- | partx -v --add / | + | |
- | mount / | + | |
- | + | ||
- | </ | + | |
- | + | ||
- | < | + | |
- | root@tokoeka / | + | |
- | root@tokoeka / | + | |
- | partition: none, disk: /dev/loop19, lower: 0, upper: 0 | + | |
- | /dev/loop19: partition table type ' | + | |
- | range recount: max partno=1, lower=0, upper=0 | + | |
- | / | + | |
- | root@tokoeka / | + | |
- | / | + | |
- | / | + | |
- | /dev/loop18 | + | |
- | + | ||
- | </ | + | |
- | + | ||
- | 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: | + | |
- | + | ||
- | </code> | + | |
- | Offen: offset? p1 ? | + | ====== |
- | ===== Daten-Konvertierungen ===== | + | ====== Daten-Konvertierungen |
[[https:// | [[https:// |