Skip to content

Diagnostic Overview & Troubleshooting

Diagnostic guides and step-by-step runbooks for PiVirt hypervisor nodes, networking layers, and Talos Linux Kubernetes clusters. Each guide addresses a specific operational symptom with root cause analysis, diagnostic commands, and verified resolutions.

Symptom Guide
VM running but no DHCP / IP address VM Gets No DHCP / IP Address
QEMU fails with “Failed to get write lock” QEMU Disk Write Lock
Talos reboots in kexec loop, never installs Talos Kexec / Reboot Loop
Kubernetes node NotReady or missing Node NotReady or Missing
Metadata server returns 404 / VM not found Metadata Server 404
OVS bridge missing TAP ports OVS Bridge / TAP Port Issues
Terminal window
# Check cluster status
pvcli cluster get prod-cluster -o yaml
# Check node status
pvcli cluster node list
# Check component health
pvcli cluster health
# View cluster events
pvcli cluster events --tail 50
Terminal window
# View pivirtd logs
journalctl -u pivirtd -f
# View agent logs
journalctl -u pivirt-agent -f
# View iscsiman logs
journalctl -u iscsiman -f
# View deployer logs
journalctl -u deployer -f
Terminal window
# Enable debug logging for pivirtd
pivirtd --config /etc/pivirtd/config.yaml --log-level debug
# Enable debug logging for agent
pivirt-agent --config /etc/pivirt-agent/config.yaml --log-level debug

These guides were created during the July 2026 Talos re-provisioning and cover the specific failure modes encountered:

  • QEMU Disk Write Lock — Stale QEMU processes holding disk locks, corrupted disk images
  • Talos Kexec / Reboot Loop — Missing KSPP kernel params, no network during install, stale NVRAM, wrong disk bus type
  • Metadata Server 404 — Missing DNAT rule, VM IP not in metadata store, missing talos-config, metadata server not listening
  • Node NotReady or Missing — Stale kubeconfig tokens, old node objects, CNI not initialized, kubelet bootstrap timeout

Symptoms:

  • VM status remains Pending or Creating
  • Error message in pvcli vm get <vm> -o yaml

Resolution:

Terminal window
# Check pivirtd logs
journalctl -u pivirtd -f
# Verify KVM is available
kvm-ok
ls -la /dev/kvm
# Check storage pool
pvcli storage pool list
# Check network bridge
brctl show

Symptoms:

  • VM cannot reach network
  • DHCP not assigning IP

Resolution:

Terminal window
# Check bridge configuration
brctl show virbr0
ip link show virbr0
# Check VM network interface
pvcli vm get web-01 -o json | jq '.spec.nics'
# Check iptables/nftables
nft list ruleset | grep virbr0
# Restart networking
systemctl restart networking

Symptoms:

  • Volume creation fails
  • VM disk errors

Resolution:

Terminal window
# Check storage pool
pvcli storage pool list
pvcli storage pool get default -o yaml
# Check disk space
df -h /var/lib/pivirtd
# Check LVM (if using LVM)
lvs
vgs
pvs
# Check iSCSI sessions
iscsiadm -m session -P3
# Check multipath
multipath -ll

Symptoms:

  • mTLS handshake failures
  • “certificate expired” or “unknown authority” errors

Resolution:

Terminal window
# Verify certificate chain
openssl verify -CAfile /etc/pivirt/certs/ca-chain.pem /etc/pivirt/certs/agent-server.crt
# Check OCSP status
openssl ocsp \
-issuer /etc/pivirt/certs/PiCA.pem \
-cert /etc/pivirt/certs/agent-server.crt \
-url http://pitrust.pivirt.internal:8080/ocsp \
-CAfile /etc/pivirt/certs/PiRootR1.pem
# In Kubernetes, check ManagedCertificate CRD status
kubectl get managedcertificate -n pivirt-system
kubectl describe managedcertificate pivirt-agent-tls -n pivirt-system

Symptoms:

  • etcd cluster unhealthy
  • Cannot create/update resources

Resolution:

Terminal window
# Check etcd status
etcdctl endpoint health --endpoints=https://etcd-0:2379,https://etcd-1:2379,https://etcd-2:2379
# Check etcd members
etcdctl member list --endpoints=https://etcd-0:2379
# Restore from backup
pvcli cluster backup restore --name backup-2024-01-15
Terminal window
# Check VM CPU usage
pvcli vm get web-01 -o json | jq '.status.cpu'
# Check host CPU usage
top
htop
# Check CPU pinning
pgrep -af qemu-system
taskset -pc <pid>
# Enable CPU pinning in VM spec
# spec.cpu.pinning: true
Terminal window
# Check VM memory usage
pvcli vm get web-01 -o json | jq '.status.memory'
# Check host memory usage
free -h
# Enable hugepages
echo 1024 > /proc/sys/vm/nr_hugepages
# Enable memory ballooning
# spec.memory.balloon: true
Terminal window
# Check disk I/O
iostat -x 1
# Check storage pool type
pvcli storage pool get default -o yaml
# Enable caching
# spec.disks[].cache: "writeback"
# Use virtio-blk instead of virtio-scsi
# spec.disks[].bus: "virtio"
Terminal window
# Check endpoint
pvcli config view | grep endpoint
# Test connectivity
nc -zv pivirtd-prod.pilab.hu 9001
# Check TLS
openssl s_client -connect pivirtd-prod.pilab.hu:9001 -CAfile ~/.config/pvcli/ca.crt
Terminal window
# Verify cert/key match
openssl x509 -noout -modulus -in ~/.config/pvcli/client.crt | openssl md5
openssl rsa -noout -modulus -in ~/.config/pvcli/client.key | openssl md5
# Check certificate expiry
openssl x509 -in ~/.config/pvcli/client.crt -text -noout | grep "Not After"
# Check RBAC policy
cat /etc/pivirt-agent/rbac.yaml
Terminal window
# Collect cluster diagnostics
pvcli cluster diagnostics --output /tmp/pivirt-diagnostics.tar.gz
# Collect component logs
pvcli cluster logs --component pivirtd --tail 1000 > /tmp/pivirtd.log
pvcli cluster logs --component agent --tail 1000 > /tmp/agent.log
# Collect system information
pvcli cluster info --output /tmp/pivirt-info.json