Initiale Infrastruktur-Dokumentation pve1 und pve2.
Enthält Host-Doku, MQTT/HA, Git-Setup, Power-Monitoring und GPU-Idle (pve2). Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
# Git & Repositories
|
||||
|
||||
Gitea: **https://git.jeanavril.com** · User: **jean**
|
||||
|
||||
## Repositories
|
||||
|
||||
| Repo | URL | Clone-Pfad auf Hosts |
|
||||
|------|-----|----------------------|
|
||||
| docu | https://git.jeanavril.com/jean/docu.git | `/root/docu-repo` |
|
||||
| server-power | https://git.jeanavril.com/jean/server-power.git | `/root/code/pve-power-mqtt` |
|
||||
|
||||
## Authentifizierung (HTTPS)
|
||||
|
||||
SSH zu Gitea ist über Reverse-Proxy **nicht** eingerichtet → **HTTPS + Token**.
|
||||
|
||||
### Token (Gitea → Settings → Applications)
|
||||
|
||||
User `jean`, Token für Automation auf den Proxmox-Hosts.
|
||||
|
||||
Gespeichert in: **`/root/.git-credentials-jeanavril`**
|
||||
|
||||
```
|
||||
https://jean:<TOKEN>@git.jeanavril.com
|
||||
```
|
||||
|
||||
(chmod 600)
|
||||
|
||||
### Git-Credential pro Repo (lokal)
|
||||
|
||||
In jedem Repo unter `.git/config`:
|
||||
|
||||
```
|
||||
credential.helper=store --file /root/.git-credentials-jeanavril
|
||||
```
|
||||
|
||||
Setzen:
|
||||
|
||||
```bash
|
||||
cd /root/docu-repo # oder /root/code/pve-power-mqtt
|
||||
git config --local credential.helper 'store --file /root/.git-credentials-jeanavril'
|
||||
```
|
||||
|
||||
## Erstes Setup auf neuem Host
|
||||
|
||||
```bash
|
||||
# Doku
|
||||
git clone https://git.jeanavril.com/jean/docu.git /root/docu-repo
|
||||
cd /root/docu-repo
|
||||
git config --local credential.helper 'store --file /root/.git-credentials-jeanavril'
|
||||
# Token-Datei anlegen (Inhalt von anderem Host kopieren)
|
||||
|
||||
# Power-Agent
|
||||
git clone https://git.jeanavril.com/jean/server-power.git /root/code/pve-power-mqtt
|
||||
cd /root/code/pve-power-mqtt
|
||||
git config --local credential.helper 'store --file /root/.git-credentials-jeanavril'
|
||||
```
|
||||
|
||||
## Go installiert
|
||||
|
||||
Pfad: `/usr/local/go/bin/go` — in `~/.bashrc`:
|
||||
|
||||
```bash
|
||||
export PATH="/usr/local/go/bin:$PATH"
|
||||
```
|
||||
|
||||
## Workflow
|
||||
|
||||
```bash
|
||||
cd /root/docu-repo && git pull
|
||||
# editieren
|
||||
git add -A
|
||||
git commit -m "Kurze Beschreibung"
|
||||
git push
|
||||
```
|
||||
@@ -0,0 +1,44 @@
|
||||
# Infrastruktur & Netzwerk
|
||||
|
||||
## Proxmox-Hosts
|
||||
|
||||
| Host | IP vmbr0 | Gateway | SSH |
|
||||
|------|----------|---------|-----|
|
||||
| pve1 | 192.168.10.3/24 | 192.168.10.1 | `ssh root@192.168.10.3` |
|
||||
| pve2 | 192.168.10.4/24 | 192.168.10.1 | `ssh root@192.168.10.4` |
|
||||
|
||||
Management-Netz: **192.168.10.0/24** (VLAN 10)
|
||||
|
||||
## DNS (intern)
|
||||
|
||||
| Name | IP | Dienst |
|
||||
|------|-----|--------|
|
||||
| homeassistant.iot | 192.168.40.254 | Home Assistant + Mosquitto MQTT |
|
||||
| git.jeanavril.com | (Gitea) | Git-Repositories |
|
||||
|
||||
Schema: VLAN-ID oft = drittes Oktett (`192.168.40.0/24` = VLAN 40)
|
||||
|
||||
## pve1 — Bridges
|
||||
|
||||
| Bridge | Anbindung | Zweck |
|
||||
|--------|-----------|-------|
|
||||
| vmbr0 | nic0, VLAN-aware | WAN / Management |
|
||||
| vmbr1 | keine phys. Ports | LAN-Seite OPNsense-Fallback |
|
||||
|
||||
## pve2 — Bridges
|
||||
|
||||
| Bridge | Zweck |
|
||||
|--------|-------|
|
||||
| vmbr0 | VLAN-aware, VMs/CTs Management |
|
||||
| vmbr1 | Intern (OPNsense LAN, CT-Netze) |
|
||||
|
||||
Details CT/VM-Netze: siehe Host-Doku unter `pve1/` bzw. `pve2/`.
|
||||
|
||||
## Rollen
|
||||
|
||||
- **pve2:** Produktiv, OPNsense VM 104, Home Assistant VM 106, Docker/Frigate CT 101, GPU-Host
|
||||
- **pve1:** Fallback-Router (OPNsense-Klon VM 104, gestoppt), CT 100 files
|
||||
|
||||
## Failover-Hinweis
|
||||
|
||||
OPNsense-Fallback auf pve1 (VM 104) und Original auf pve2 **dürfen nicht parallel** laufen — gleiche IPs/Konfiguration. Siehe [pve1/04_fallback_aktivierung.md](../pve1/04_fallback_aktivierung.md).
|
||||
@@ -0,0 +1,94 @@
|
||||
# MQTT & Home Assistant
|
||||
|
||||
## Broker
|
||||
|
||||
| Parameter | Wert |
|
||||
|-----------|------|
|
||||
| Hostname | `homeassistant.iot` |
|
||||
| IP | 192.168.40.254 |
|
||||
| Port | 1883 (TLS: nicht verwendet) |
|
||||
| User | `server` |
|
||||
| Passwort | `F0x84rAOW#q@LX` |
|
||||
| Protokoll | MQTT v3.1.1, QoS 0, retained states |
|
||||
|
||||
Broker läuft auf dem **Home Assistant**-System (VM 106 auf pve2).
|
||||
|
||||
## Power-Sensoren (pve-power-mqtt)
|
||||
|
||||
Agent-Repo: https://git.jeanavril.com/jean/server-power.git
|
||||
|
||||
### Topics (Beispiel pve2)
|
||||
|
||||
```
|
||||
homeassistant/sensor/pve2/cpu_power/state
|
||||
homeassistant/sensor/pve2/gpu0_power/state
|
||||
homeassistant/sensor/pve2/gpu1_power/state
|
||||
homeassistant/sensor/pve2/estimated_total/state
|
||||
```
|
||||
|
||||
Discovery (retained):
|
||||
|
||||
```
|
||||
homeassistant/sensor/pve2_cpu_power/config
|
||||
homeassistant/sensor/pve2_gpu0_power/config
|
||||
...
|
||||
```
|
||||
|
||||
### HA-Geräte
|
||||
|
||||
| Gerät | Host | Sensoren |
|
||||
|-------|------|----------|
|
||||
| pve1 Power | pve1 | CPU, estimated_total |
|
||||
| pve2 Power | pve2 | CPU, GPU0, GPU1, estimated_total |
|
||||
|
||||
`estimated_total` = CPU (RAPL) + GPU-Summe — **kein** Wandverbrauch.
|
||||
|
||||
### Env auf den Hosts
|
||||
|
||||
Datei: `/etc/pve-power-mqtt.env` (chmod 600)
|
||||
|
||||
**pve2:**
|
||||
|
||||
```ini
|
||||
POWER_MQTT_BROKER=tcp://homeassistant.iot:1883
|
||||
POWER_MQTT_USER=server
|
||||
POWER_MQTT_PASSWORD="F0x84rAOW#q@LX"
|
||||
POWER_MQTT_HOSTNAME=pve2
|
||||
POWER_MQTT_DISCOVERY=true
|
||||
```
|
||||
|
||||
**pve1:**
|
||||
|
||||
```ini
|
||||
POWER_MQTT_BROKER=tcp://homeassistant.iot:1883
|
||||
POWER_MQTT_USER=server
|
||||
POWER_MQTT_PASSWORD="F0x84rAOW#q@LX"
|
||||
POWER_MQTT_HOSTNAME=
|
||||
POWER_MQTT_CLIENT_ID=
|
||||
POWER_MQTT_DISCOVERY=true
|
||||
```
|
||||
|
||||
Leere `HOSTNAME` / `CLIENT_ID` → automatisch `pve1` bzw. `pve-power-mqtt-pve1`.
|
||||
|
||||
### MQTT-Client-IDs (wichtig)
|
||||
|
||||
Jeder Host braucht eine **eindeutige** Client-ID, sonst „session taken over“ im Mosquitto-Log:
|
||||
|
||||
| Host | Client-ID |
|
||||
|------|-----------|
|
||||
| pve1 | `pve-power-mqtt-pve1` |
|
||||
| pve2 | `pve-power-mqtt-pve2` |
|
||||
|
||||
### Bekannte Mosquitto-Log-Meldungen
|
||||
|
||||
| Meldung | Bedeutung |
|
||||
|---------|-----------|
|
||||
| `session taken over` | Gleiche Client-ID von neuem Connect — prüfen ob Duplikat |
|
||||
| `exceeded timeout` | Keepalive verpasst — Agent reconnectet |
|
||||
| `pingresp not received` | Netz/Latenz VLAN 10↔40 — Keepalive im Agent auf 120 s |
|
||||
|
||||
### HA nach Agent-Update
|
||||
|
||||
**Einstellungen → Geräte & Dienste → MQTT → Neu laden**
|
||||
|
||||
Alte Discovery-Einträge mit `expire_after` oder `availability_topic` ggf. Entity löschen und neu discovern.
|
||||
Reference in New Issue
Block a user