Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
proxmox [30/10/2024 - 13:12] – [Alle VMs auf einmal runter fahren] thommie4 | proxmox [16/05/2025 - 15:37] (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 einer Gruppe zuweisen: |
< | < | ||
- | root@pveroser: | + | pveum user modify testuser@pam -group |
- | ┌─────────────┬─────────┬─────────────────────┬────────┬────────┬───────────┬────────┬──────┬──────────┬────────────┬────────┐ | + | |
- | │ userid | + | |
- | ╞═════════════╪═════════╪═════════════════════╪════════╪════════╪═══════════╪════════╪══════╪══════════╪════════════╪════════╡ | + | |
- | │ alex@pam | + | |
- | ├─────────────┼─────────┼─────────────────────┼────────┼────────┼───────────┼────────┼──────┼──────────┼────────────┼────────┤ | + | |
- | │ root@pam | + | |
- | ├─────────────┼─────────┼─────────────────────┼────────┼────────┼───────────┼────────┼──────┼──────────┼────────────┼────────┤ | + | |
- | │ thommie@pam │ | + | |
- | └─────────────┴─────────┴─────────────────────┴────────┴────────┴───────────┴────────┴──────┴──────────┴────────────┴────────┘ | + | |
</ | </ | ||
Zeile 80: | Zeile 93: | ||
</ | </ | ||
- | Gruppen auflisten | + | 2FA Auth löschen: über einen gleichberechtigten User, dann Löschen von " |
- | < | + | ====== Kommandozeile und Container/ |
- | root@pveroser: | + | |
- | ┌─────────┬───────────────────────┬──────────────────────┐ | + | |
- | │ groupid │ comment | + | |
- | ╞═════════╪═══════════════════════╪══════════════════════╡ | + | |
- | │ admin │ System Administrators │ alex@pam, | + | |
- | └─────────┴───────────────────────┴──────────────────────┘ | + | |
- | + | ||
- | </ | + | |
- | + | ||
- | 2FA löschen: über gleichberechtigten User, dann Löschen von " | + | |
- | + | ||
- | ===== Command Line ===== | + | |
**qm** | **qm** | ||
Zeile 100: | Zeile 101: | ||
**pct** | **pct** | ||
- | Alle VMs (KVM und lxc) auf einmal runterfahren | + | ====== |
< | < | ||
Zeile 107: | Zeile 108: | ||
</ | </ | ||
- | VM löschen | + | oder |
< | < | ||
+ | pvesh create / | ||
+ | |||
+ | </ | ||
+ | |||
+ | Doku: [[https:// | ||
+ | |||
+ | ====== VM: löschen ====== | ||
+ | < | ||
+ | |||
qm destroy 105 | qm destroy 105 | ||
</ | </ | ||
- | Mounten eines Containers auf dem Host | + | ====== lxc: Mounten eines Containers auf dem Host ====== |
< | < | ||
Zeile 121: | Zeile 131: | ||
</ | </ | ||
- | Gemeinsames Guest Share (smb) | + | ====== |
< | < | ||
Zeile 128: | Zeile 138: | ||
</ | </ | ||
- | Speicherverbrauch ermitteln | + | ====== Host: Speicherverbrauch ermitteln |
< | < | ||
Zeile 135: | Zeile 145: | ||
</ | </ | ||
- | Container umbenennen | + | ====== lxc: Container umbenennen |
< | < | ||
Zeile 142: | Zeile 152: | ||
</ | </ | ||
- | Container betreten | + | ====== lxc: Container betreten |
< | < | ||
Zeile 149: | Zeile 159: | ||
</ | </ | ||
- | ===== Datei senden und empfangen ===== | + | ====== lxc: Datei senden und empfangen |
Datei senden | Datei senden | ||
Zeile 165: | Zeile 175: | ||
</ | </ | ||
- | ===== Backups manuell | + | QM: Bei VMs geht das per scp. Dazu braucht man die IP der VM |
+ | |||
+ | ====== VM: IP Adresse feststellen ====== | ||
< | < | ||
- | vzdump 102 118 122 --compress zstd --mode stop --prune-backups ' | + | qm agent 113 network-get-interface |
</ | </ | ||
- | ===== Alle VMs auf einmal runter fahren | + | ====== Backups manuell ====== |
< | < | ||
- | pvesh create / | + | vzdump 102 118 122 --compress zstd --mode stop --prune-backups ' |
</ | </ | ||
- | Doku: [[https:// | + | ====== Host: PVE Server ====== |
- | ===== Auto Start der VMs temporär abschalten ===== | + | ===== Auto-Start der VMs temporär abschalten ===== |
< | < | ||
systemctl disable pve-guests.service. | systemctl disable pve-guests.service. | ||
+ | |||
</ | </ | ||
Zeile 191: | Zeile 204: | ||
< | < | ||
| | ||
- | </ | ||
+ | </ | ||
- | ===== PVE Templates ===== | + | ====== PVE Templates |
Erreichbare Templates auflisten | Erreichbare Templates auflisten | ||
- | < | ||
+ | < | ||
pveam update | pveam update | ||
Zeile 212: | Zeile 225: | ||
</ | </ | ||
- | ===== PVE Firewall ===== | + | ====== PVE Firewall |
zentrale Konfiguration | zentrale Konfiguration | ||
Zeile 229: | Zeile 242: | ||
</ | </ | ||
+ | |||
+ | ====== Host: Firewall blockiert ====== | ||
**Wenn die Firewall den Host blockiert: | **Wenn die Firewall den Host blockiert: | ||
Zeile 252: | Zeile 267: | ||
</ | </ | ||
- | ===== Meckermails von CERT-BUND wegen RPC ===== | + | ====== Meckermails von CERT-BUND wegen RPC Port ====== |
- | 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 274: | Zeile 289: | ||
</ | </ | ||
- | ===== SMB Mount mit Containern ===== | + | ====== SMB Mount mit Containern |
Geht nur mit **privileged** | Geht nur mit **privileged** | ||
- | ===== LXC und KVM Netplan | + | ====== Netzwerk: |
/ | / | ||
Zeile 330: | Zeile 345: | ||
</ | </ | ||
- | 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 350: | Zeile 359: | ||
pct start 110 –debug | pct start 110 –debug | ||
- | ===== Port 111 rpcbind ===== | + | ====== Port 111 rpcbind |
- | Siehe [[https:// | + | Siehe [[https:// |
'' | '' | ||
Zeile 360: | Zeile 369: | ||
'' | '' | ||
- | ===== Datenwiederherstellung | + | ====== LXC: raw Device mounten ====== |
+ | |||
+ | Welche loop devices werden aktuell benutzt | ||
+ | < | ||
+ | |||
+ | losetup -l | ||
+ | |||
+ | NAME | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | |||
+ | </ | ||
+ | |||
+ | 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 421: | Zeile 511: | ||
</ | </ | ||
- | Der Offset ist also ** | + | Der Offset ist also **4096 x 512 = 2097152.** |
- | < | + | |
< | < | ||
Zeile 444: | Zeile 533: | ||
</ | </ | ||
- | ===== KVM: qcow2 Device mounten ===== | + | ====== KVM VMs ====== |
+ | |||
+ | ===== qcow2 Device mounten ===== | ||
< | < | ||
Zeile 490: | Zeile 581: | ||
</ | </ | ||
- | ===== LXC: raw Device mounten | + | ====== KVM: Platte einer VM vergrössern ====== |
- | Welche loop devices werden aktuell benutzt | + | [[https:// |
- | < | + | ====== Daten-Konvertierungen |
- | < | + | |
- | < | + | |
- | < | + | |
- | < | + | |
- | < | + | |
- | < | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | + | ||
- | </ | + | |
- | + | ||
- | 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: | + | |
- | + | ||
- | </ | + | |
- | + | ||
- | Offen: offset? p1 ? | + | |
- | + | ||
- | ===== Daten-Konvertierungen ===== | + | |
[[https:// | [[https:// | ||
Zeile 675: | Zeile 684: | ||
</ | </ | ||
- | ===== zfs Datasets erstellen ===== | + | ====== zfs Datasets erstellen |
zfs create rpool/ | zfs create rpool/ | ||
Zeile 683: | Zeile 692: | ||
zpool destroy -f rpool | zpool destroy -f rpool | ||
- | ====== LE Zertifikate für PVE ====== | + | ====== |
< | < | ||
Zeile 692: | Zeile 701: | ||
root@kakariki /etc/pve # pvenode acme cert order | root@kakariki /etc/pve # pvenode acme cert order | ||
- | </code> | + | Loading ACME account details Placing ACME order Order URL: <https:// |
- | Loading ACME account details Placing ACME order Order URL: < | + | Getting authorization details from '< |
- | + | ||
- | Getting authorization details from '<[[https:// | + | |
All domains validated! | All domains validated! | ||
Zeile 704: | Zeile 711: | ||
Downloading certificate Setting pveproxy certificate and key Restarting pveproxy Task OK | Downloading certificate Setting pveproxy certificate and key Restarting pveproxy Task OK | ||
- | ### 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 | ||