Skip to content

pivirtd Daemon Reference

The PiVirt Daemon (pivirtd) is the hypervisor management service responsible for direct QEMU/KVM process supervision, TAP network interfaces, and disk image operations.

Use systemd to manage the pivirtd service.

Terminal window
# start the daemon
sudo systemctl start pivirtd
# stop the daemon
sudo systemctl stop pivirtd
# restart the daemon
sudo systemctl restart pivirtd
# check status
sudo systemctl status pivirtd
# enable on boot
sudo systemctl enable pivirtd
Terminal window
# check pivirtd health
grpcurl -plaintext localhost:9001 grpc.health.v1.Health/Check
# check specific service
grpcurl -plaintext -d '{"service": "pivirt.vm.v1.VMService"}' \
localhost:9001 grpc.health.v1.Health/Check
Terminal window
# check pivirtd health
curl http://localhost:9002/health
# check readiness
curl http://localhost:9002/ready
# check liveness
curl http://localhost:9002/live
Terminal window
curl -X POST http://localhost:9002/reload
Terminal window
# get debug info
curl http://localhost:9002/debug/vars
# get goroutine stack traces
curl http://localhost:9002/debug/pprof/goroutine?debug=1
# get heap profile
curl http://localhost:9002/debug/pprof/heap > heap.prof
Terminal window
# get all metrics
curl http://localhost:9002/metrics
# get specific metrics
curl http://localhost:9002/metrics | grep pivirtd_vm_count
Terminal window
# list all VMs
grpcurl -plaintext localhost:9001 \
pivirt.vm.v1.VMService/ListVMs
# list VMs in namespace
grpcurl -plaintext -d '{"namespace": "production"}' \
localhost:9001 \
pivirt.vm.v1.VMService/ListVMs
Terminal window
# get VM by ID
grpcurl -plaintext -d '{"id": "vm-abc123"}' \
localhost:9001 \
pivirt.vm.v1.VMService/GetVM
Terminal window
# start VM
grpcurl -plaintext -d '{"id": "vm-abc123"}' \
localhost:9001 \
pivirt.vm.v1.VMService/StartVM
# stop VM
grpcurl -plaintext -d '{"id": "vm-abc123"}' \
localhost:9001 \
pivirt.vm.v1.VMService/StopVM
Terminal window
# validate configuration
pivirtd --config /etc/pivirtd/config.yaml --validate
# show effective configuration
pivirtd --config /etc/pivirtd/config.yaml --show-config
Terminal window
# check KVM availability
kvm-ok
# check /dev/kvm
ls -la /dev/kvm
# check kernel modules
lsmod | grep kvm
Terminal window
# check running QEMU processes
ps aux | grep qemu-system
# list VMs through pivirtd
pvcli vm list
Terminal window
# enable debug logging
pivirtd --config /etc/pivirtd/config.yaml --log-level debug
# view debug logs
sudo journalctl -u pivirtd -f | grep DEBUG