feat: refactor 30+ skills to Anthropic progressive disclosure pattern
- All SKILL.md files now <500 lines (avg reduction 69%) - Detailed content extracted to references/ subdirectories - Frontmatter standardised: only name + description (Anthropic standard) - New skills: brand-guidelines, spec-coauthor, report-templates, skill-creator - Design skills: anti-slop guidelines, premium-proposals reference - Removed non-standard frontmatter fields (triggers, version, author, category) Plugins affected: infraestrutura, marketing, dev-tools, crm-ops, gestao, core-tools, negocio, perfex-dev, wordpress, design-media Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
125
infraestrutura/skills/pbs-config/references/pbs-avancado.md
Normal file
125
infraestrutura/skills/pbs-config/references/pbs-avancado.md
Normal file
@@ -0,0 +1,125 @@
|
||||
# PBS Avancado - Funcionalidades e Troubleshooting
|
||||
|
||||
## Monitoring e Maintenance
|
||||
|
||||
### Verificar Deduplicacao
|
||||
```bash
|
||||
# Ver estatisticas datastore
|
||||
proxmox-backup-manager datastore status main-store
|
||||
|
||||
# Ratio deduplicacao (tipico 1.3-2.5x)
|
||||
```
|
||||
|
||||
### Garbage Collection
|
||||
```bash
|
||||
# Liberar espaco de backups removidos (retention)
|
||||
proxmox-backup-manager garbage-collection start main-store
|
||||
|
||||
# Agendar GC semanal (Domingo 02:00)
|
||||
# Via Web UI: Datastore -> main-store -> Prune & GC
|
||||
```
|
||||
|
||||
### Verificar Disk Usage
|
||||
```bash
|
||||
df -h /mnt/pbs-datastore
|
||||
|
||||
# ZFS
|
||||
zfs list -o name,used,available,refer rpool/pbs-datastore
|
||||
```
|
||||
|
||||
### Alertas Email
|
||||
```bash
|
||||
# Configurar notificacoes
|
||||
# Via Web UI: Configuration -> Notifications
|
||||
# SMTP server: mail.descomplicar.pt
|
||||
# Alertas: disk usage >80%, backup failures
|
||||
```
|
||||
|
||||
## PBS Advanced Features
|
||||
|
||||
### Verification Jobs
|
||||
```bash
|
||||
# Verificar integridade backups
|
||||
proxmox-backup-manager verify-job create verify-main \
|
||||
--store main-store \
|
||||
--schedule "0 4 * * 0" # Domingo 04:00
|
||||
```
|
||||
|
||||
### Namespace Organization
|
||||
```bash
|
||||
# Organizar backups por tipo
|
||||
proxmox-backup-manager namespace create main-store/production
|
||||
proxmox-backup-manager namespace create main-store/testing
|
||||
proxmox-backup-manager namespace create main-store/archived
|
||||
```
|
||||
|
||||
### Tape Backup (futuro)
|
||||
- PBS suporta LTO tape
|
||||
- Para compliance de longo prazo
|
||||
- Cold storage
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Backup failing: "no space"
|
||||
```bash
|
||||
# Verificar disk usage
|
||||
df -h /mnt/pbs-datastore
|
||||
|
||||
# Run GC manual
|
||||
proxmox-backup-manager garbage-collection start main-store
|
||||
|
||||
# Ajustar retention (reduzir keeps)
|
||||
proxmox-backup-manager datastore update main-store --keep-daily 5
|
||||
```
|
||||
|
||||
### Remote sync not working
|
||||
```bash
|
||||
# Verificar conectividade
|
||||
ping <remote-pbs-ip>
|
||||
|
||||
# Testar autenticacao
|
||||
curl -k https://<remote-pbs-ip>:8007/api2/json/access/ticket \
|
||||
-d "username=pve-backup@pbs&password=<password>"
|
||||
|
||||
# Logs
|
||||
journalctl -u proxmox-backup -f
|
||||
```
|
||||
|
||||
### Dedup ratio baixo (<1.2x)
|
||||
```bash
|
||||
# Verificar se VMs tem dados compressiveis
|
||||
# VMs com random data (encrypted) nao deduplica bem
|
||||
|
||||
# Verificar chunk size (padrao 4MB adequado)
|
||||
proxmox-backup-manager datastore show main-store
|
||||
```
|
||||
|
||||
## Estrategia 3-2-1 Backup
|
||||
|
||||
**Implementacao para Cluster Descomplicar:**
|
||||
|
||||
**3 copias:**
|
||||
1. **Original:** VMs em Node A (producao)
|
||||
2. **Backup primario:** PBS Node B (16TB HDD)
|
||||
3. **Backup secundario:** PBS Node A remote sync (12TB HDD)
|
||||
|
||||
**2 medias diferentes:**
|
||||
1. NVMe (VMs producao)
|
||||
2. HDD Enterprise (PBS datastores)
|
||||
|
||||
**1 off-site:**
|
||||
- **Opcao A:** Hetzner Storage Box (rsync daily)
|
||||
- **Opcao B:** S3-compatible (Wasabi/Backblaze)
|
||||
- **Opcao C:** PBS em VPS externo
|
||||
|
||||
**RPO:** 1h (backups hourly se critical)
|
||||
**RTO:** 2-4h (restore + validacao)
|
||||
|
||||
## Metricas Esperadas
|
||||
|
||||
| Metrica | Valor tipico |
|
||||
|---------|-------------|
|
||||
| Dedup ratio | 1.5-2.5x |
|
||||
| Compression ratio | 1.3-1.8x |
|
||||
| Backup speed | 100-300 MB/s |
|
||||
| Restore RTO | 2-4h (para VM 100GB) |
|
||||
@@ -0,0 +1,235 @@
|
||||
# PBS Setup Completo - Referencia Detalhada
|
||||
|
||||
## Fase 1: PBS Installation
|
||||
|
||||
### 1.1 Verificar se PBS ja esta instalado
|
||||
```bash
|
||||
dpkg -l | grep proxmox-backup-server
|
||||
|
||||
# Se nao instalado:
|
||||
apt update
|
||||
apt install proxmox-backup-server
|
||||
```
|
||||
|
||||
### 1.2 Aceder PBS Web UI
|
||||
```
|
||||
https://SERVER_IP:8007
|
||||
|
||||
User: root
|
||||
Password: (root password do servidor)
|
||||
```
|
||||
|
||||
### 1.3 Configuracao Inicial
|
||||
- Hostname
|
||||
- DNS servers
|
||||
- Time zone (Europe/Lisbon)
|
||||
|
||||
## Fase 2: Datastore Creation
|
||||
|
||||
### 2.1 Preparar Storage
|
||||
|
||||
**Para ZFS (recomendado):**
|
||||
```bash
|
||||
# Ja criado em /proxmox-setup:
|
||||
# zfs create rpool/pbs-datastore
|
||||
|
||||
# Verificar
|
||||
zfs list | grep pbs-datastore
|
||||
|
||||
# Optimizar para backup workload
|
||||
zfs set compression=lz4 rpool/pbs-datastore
|
||||
zfs set dedup=off rpool/pbs-datastore # Dedup no PBS, nao no ZFS
|
||||
zfs set recordsize=1M rpool/pbs-datastore # Large files
|
||||
```
|
||||
|
||||
**Para ext4 (HDD 16TB):**
|
||||
```bash
|
||||
# Particionar HDD
|
||||
parted /dev/sda mklabel gpt
|
||||
parted /dev/sda mkpart primary ext4 0% 100%
|
||||
|
||||
# Formatar
|
||||
mkfs.ext4 /dev/sda1
|
||||
|
||||
# Montar
|
||||
mkdir -p /mnt/pbs-datastore
|
||||
echo "/dev/sda1 /mnt/pbs-datastore ext4 defaults 0 2" >> /etc/fstab
|
||||
mount -a
|
||||
```
|
||||
|
||||
### 2.2 Criar Datastore via CLI
|
||||
```bash
|
||||
proxmox-backup-manager datastore create main-store /mnt/pbs-datastore
|
||||
|
||||
# Verificar
|
||||
proxmox-backup-manager datastore list
|
||||
```
|
||||
|
||||
### 2.3 Configurar Retention Policy
|
||||
```bash
|
||||
# 7 daily, 4 weekly, 6 monthly (padrao)
|
||||
proxmox-backup-manager datastore update main-store \
|
||||
--keep-daily 7 \
|
||||
--keep-weekly 4 \
|
||||
--keep-monthly 6 \
|
||||
--keep-yearly 3
|
||||
```
|
||||
|
||||
**Explicacao Retention:**
|
||||
- `keep-daily 7`: Mantem 7 backups diarios
|
||||
- `keep-weekly 4`: Mantem 4 backups semanais (1 por semana)
|
||||
- `keep-monthly 6`: Mantem 6 backups mensais (1 por mes)
|
||||
- `keep-yearly 3`: Mantem 3 backups anuais
|
||||
|
||||
**Gestao automatica:** PBS elimina backups antigos baseado nestas regras.
|
||||
|
||||
## Fase 3: PBS Users e Permissions
|
||||
|
||||
### 3.1 Criar User para PVE Backups
|
||||
```bash
|
||||
# User dedicado para Proxmox enviar backups
|
||||
proxmox-backup-manager user create pve-backup@pbs \
|
||||
--email admin@descomplicar.pt
|
||||
|
||||
# Password
|
||||
proxmox-backup-manager user update pve-backup@pbs --password
|
||||
|
||||
# Atribuir permissoes no datastore
|
||||
proxmox-backup-manager acl update /datastore/main-store \
|
||||
--auth-id pve-backup@pbs \
|
||||
--role DatastoreBackup
|
||||
```
|
||||
|
||||
### 3.2 Criar API Token (para automacao)
|
||||
```bash
|
||||
# Token para scripts/Terraform
|
||||
proxmox-backup-manager user token create pve-backup@pbs automation-token \
|
||||
--output-format json
|
||||
|
||||
# Guardar token de forma segura
|
||||
# Formato: pve-backup@pbs!automation-token=<secret>
|
||||
```
|
||||
|
||||
## Fase 4: Configure PVE to Use PBS
|
||||
|
||||
### 4.1 Adicionar PBS Storage em Proxmox VE
|
||||
|
||||
Via Web UI (Datacenter -> Storage -> Add -> Proxmox Backup Server):
|
||||
- ID: `pbs-main`
|
||||
- Server: `SERVER_IP` (ou hostname se cluster)
|
||||
- Datastore: `main-store`
|
||||
- Username: `pve-backup@pbs`
|
||||
- Password: (password criado)
|
||||
- Fingerprint: (auto-detect)
|
||||
|
||||
Via CLI:
|
||||
```bash
|
||||
pvesm add pbs pbs-main \
|
||||
--server SERVER_IP \
|
||||
--datastore main-store \
|
||||
--username pve-backup@pbs \
|
||||
--password <password>
|
||||
```
|
||||
|
||||
### 4.2 Verificar Conectividade
|
||||
```bash
|
||||
pvesm status | grep pbs-main
|
||||
```
|
||||
|
||||
## Fase 5: Backup Jobs (PVE)
|
||||
|
||||
### 5.1 Criar Backup Job para VMs Criticas
|
||||
|
||||
Via Web UI (Datacenter -> Backup -> Add):
|
||||
- Storage: `pbs-main`
|
||||
- Schedule: Daily 01:00
|
||||
- Mode: Snapshot (live backup)
|
||||
- Compression: zstd
|
||||
- Notification: email admin@descomplicar.pt
|
||||
|
||||
Via CLI:
|
||||
```bash
|
||||
# Backup diario de todas VMs as 01:00
|
||||
vzdump --storage pbs-main --mode snapshot --compress zstd --all 1
|
||||
```
|
||||
|
||||
### 5.2 Agendar via cron (alternativa)
|
||||
```bash
|
||||
# /etc/cron.d/pve-backup-critical
|
||||
0 1 * * * root vzdump --storage pbs-main --vmid 100,101,102 --mode snapshot --compress zstd
|
||||
```
|
||||
|
||||
### 5.3 Backup Selectivo
|
||||
```bash
|
||||
# VMs criticas: diario
|
||||
# VMs secundarias: 3x semana (Seg, Qua, Sex)
|
||||
0 1 * * 1,3,5 root vzdump --storage pbs-main --vmid 200,201,202 --mode snapshot --compress zstd
|
||||
```
|
||||
|
||||
## Fase 6: Remote Sync (2-Node Cluster)
|
||||
|
||||
**Setup para cluster:** PBS em Node B (primary) + PBS em Node A (secondary)
|
||||
|
||||
### 6.1 Configurar Remote em PBS Secondary (Node A)
|
||||
|
||||
Via Web UI PBS Node A (Configuration -> Remote):
|
||||
- Name: `pbs-node-b`
|
||||
- Host: `<node-b-ip>` ou `cluster.descomplicar.pt`
|
||||
- Port: 8007
|
||||
- Auth ID: `pve-backup@pbs`
|
||||
- Password: (password)
|
||||
- Fingerprint: (auto-detect)
|
||||
|
||||
### 6.2 Criar Sync Job
|
||||
|
||||
Via Web UI PBS Node A (Configuration -> Sync Jobs -> Add):
|
||||
- Remote: `pbs-node-b`
|
||||
- Remote Datastore: `main-store`
|
||||
- Local Datastore: `secondary-store`
|
||||
- Schedule: Daily 03:00 (apos backups)
|
||||
- Remove vanished: Yes (sync deletes)
|
||||
|
||||
Via CLI em Node A:
|
||||
```bash
|
||||
proxmox-backup-manager sync-job create sync-from-node-b \
|
||||
--remote pbs-node-b \
|
||||
--remote-store main-store \
|
||||
--store secondary-store \
|
||||
--schedule "0 3 * * *" \
|
||||
--remove-vanished true
|
||||
```
|
||||
|
||||
### 6.3 Testar Sync Manual
|
||||
```bash
|
||||
proxmox-backup-manager sync-job run sync-from-node-b
|
||||
```
|
||||
|
||||
## Fase 7: Restore Procedures (Testing)
|
||||
|
||||
### 7.1 Restore VM Teste
|
||||
|
||||
Via Web UI PVE:
|
||||
- Storage -> pbs-main -> Backups
|
||||
- Seleccionar VM backup
|
||||
- Restore -> New VM ID (999)
|
||||
- Start apos restore
|
||||
|
||||
### 7.2 Restore via CLI
|
||||
```bash
|
||||
# Listar backups disponiveis
|
||||
pbs-client list --repository pve-backup@pbs@SERVER_IP:main-store
|
||||
|
||||
# Restore VM 100
|
||||
qmrestore pbs-main:backup/vm/100/YYYY-MM-DD... 999
|
||||
```
|
||||
|
||||
### 7.3 Validar Restore
|
||||
```bash
|
||||
qm start 999
|
||||
# Verificar VM boota correctamente
|
||||
# Teste servico critical
|
||||
# Shutdown e remover VM teste
|
||||
qm stop 999 && qm destroy 999
|
||||
```
|
||||
|
||||
**Critico:** Testar restore ANTES de considerar backup strategy operacional.
|
||||
Reference in New Issue
Block a user