Files
documentation/procedures/pve-post-install-optimization.md
F.R.I.D.A.Y. 8df3127ff2 Add PVE post-install optimization procedure
Covers:
- LVM thin pool removal and root expansion
- Proxmox storage.cfg cleanup (local-lvm removal)
- Adding disk images and containers to local storage
- Disabling enterprise AND ceph repos
- No-subscription repo setup
- Subscription nag screen removal
- DNS resolution fix for PXE-installed nodes
- Full verification checklist

Author: F.R.I.D.A.Y.
Date: 2026-05-31
2026-05-31 22:00:19 -04:00

212 lines
5.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Procedure: Proxmox VE Post-Install Optimization
**Scope:** Single-node PVE 9.2 (Debian Trixie) post-install cleanup — storage repartitioning, repository configuration, subscription-nag removal, and DNS fix.
**Author:** F.R.I.D.A.Y.
**Date:** 2026-05-31
**Prerequisites:** PVE 9.2 installed, node reachable via SSH as root, node has internet (or will after DNS fix).
---
## 1. Storage Repartitioning (Remove local-lvm, Expand Root)
**Goal:** Delete the default thin pool and give all disk space to the root volume for LXC/VM root disks.
### 1.1 Remove the LVM Thin Pool and LV
```bash
# Check current layout
lvs
vgs
pvs
# Remove the Proxmox data thin pool LV
lvremove pve/data
# Confirm with "y" when prompted
```
### 1.2 Expand pve/root to Fill Free Space
```bash
# Extend the root logical volume to 100% of free VG space
lvextend -l +100%FREE pve/root
# Resize the ext4 filesystem online (no reboot needed)
resize2fs /dev/mapper/pve-root
# Verify
lvs
df -h /
```
Expected: `pve-root` is now ~930G945G depending on disk size.
### 1.3 Remove local-lvm from Proxmox Storage Config
**Critical:** Deleting the LV does NOT remove the storage definition. The web UI will still show `local-lvm` as missing/unavailable until you do this:
```bash
cfg="/etc/pve/storage.cfg"
# Backup
cp "$cfg" "$cfg.bak"
# Remove the lvmthin: local-lvm block (including all indented lines)
sed -i '/^lvmthin: local-lvm/,/^[^[:space:]]/ { /^lvmthin: local-lvm/d; /^[[:space:]]/d }' "$cfg"
# Trim leading blank lines
sed -i '/./,$!d' "$cfg"
# Restart services
cat "$cfg"
systemctl restart pvestatd pveproxy
```
### 1.4 Add Missing Content Types to local Storage
**Critical:** After removing `local-lvm`, the remaining `dir: local` storage may only have `content iso,vztmpl,backup,import`. You **must** add `images,rootdir` or you cannot create VMs/LXCs — there will be no default storage for disk images and containers.
```bash
cfg="/etc/pve/storage.cfg"
# Ensure local storage has ALL content types
cat > "$cfg" <<'STORAGE_EOF'
dir: local
path /var/lib/vz
content rootdir,images,iso,vztmpl,backup,import
STORAGE_EOF
# Restart to pick up changes
systemctl restart pvestatd pveproxy
```
Verify in web UI: **Datacenter > Storage > local** should show all content types enabled.
---
## 2. Repository Configuration
**Goal:** Disable enterprise/ceph repos (require subscription) and enable the no-subscription repo.
### 2.1 Disable Enterprise Repos
```bash
for f in /etc/apt/sources.list.d/pve-enterprise.list \
/etc/apt/sources.list.d/ceph.list; do
if [ -f "$f" ]; then
mv "$f" "$f.disabled"
echo "Disabled: $f"
fi
done
```
> **Important:** Both `pve-enterprise.list` **AND** `ceph.list` must be disabled. The PVE installer enables both by default.
### 2.2 Add No-Subscription Repo
```bash
cat > /etc/apt/sources.list.d/pve-no-subscription.list <<'REPO_EOF'
deb http://download.proxmox.com/debian/pve trixie pve-no-subscription
REPO_EOF
```
> Note: `trixie` = Debian 13. Adjust if on a different Debian base.
### 2.3 Update Package Lists
```bash
apt update
```
If DNS resolution fails (see Section 4), fix DNS first then re-run `apt update`.
---
## 3. Remove Subscription Nag Screen
**Goal:** Kill the "No valid subscription" warning popup in the web UI.
```bash
js="/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js"
# Backup
cp "$js" "$js.bak"
# Patch: replace the status check with literal false
sed -i "s/data.status !== 'Active'/false/g" "$js"
# Restart web UI
systemctl restart pveproxy
```
Verify: Log into the web UI — no subscription warning should appear.
---
## 4. Fix DNS Resolution
**Problem:** PVE 9.2 PXE installs often get `nameserver 127.0.0.1` in `/etc/resolv.conf`, but no local DNS server is running.
```bash
cat > /etc/resolv.conf <<'DNS_EOF'
search ai.home
nameserver 192.168.7.7
nameserver 192.168.0.1
nameserver 8.8.8.8
DNS_EOF
```
> Adjust nameservers to match your network. `192.168.7.7` is the Technitium DNS in the Iron Legion fleet.
After fixing DNS, re-run:
```bash
apt update
```
---
## 5. Verification Checklist
Run these on each node to confirm everything is clean:
```bash
echo "=== Storage ==="
df -h /
lvs
echo ""
echo "=== Repos ==="
cat /etc/apt/sources.list.d/*.list 2>/dev/null | grep -v disabled || echo "no active list files"
echo ""
echo "=== Nag Patch ==="
grep -c "false" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
echo ""
echo "=== DNS ==="
cat /etc/resolv.conf
echo ""
echo "=== Apt Test ==="
apt update
```
Expected results:
- `pve-root` is ~930G+ and only `root` + `swap` LVs exist
- No `local-lvm` in `/etc/pve/storage.cfg`
- `local` storage has `content rootdir,images,iso,vztmpl,backup,import`
- No `.list` files with `enterprise` or `ceph` in the name (only `pve-no-subscription.list`)
- `proxmoxlib.js` contains `false` in the subscription check line
- `apt update` completes without "Temporary failure resolving" errors
---
## 6. Known Issues & Fixes
| Issue | Cause | Fix |
|-------|-------|-----|
| local-lvm still shows in UI | LV removed but storage.cfg still has definition | Run Section 1.3 |
| Cannot create VM/LXC | `local` storage missing `images,rootdir` | Run Section 1.4 |
| apt update fails with DNS errors | resolv.conf points to 127.0.0.1 | Run Section 4 |
| Enterprise repo still active | Only pve-enterprise disabled, ceph.list left behind | Run Section 2.1 (disable BOTH) |
| Subscription nag still appears | pveproxy not restarted after patch | Run Section 3 + restart pveproxy |
---
*Last updated: 2026-05-31*