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.
Service Management
Section titled “Service Management”Use systemd to manage the pivirtd service.
# start the daemonsudo systemctl start pivirtd
# stop the daemonsudo systemctl stop pivirtd
# restart the daemonsudo systemctl restart pivirtd
# check statussudo systemctl status pivirtd
# enable on bootsudo systemctl enable pivirtdHealth Endpoints
Section titled “Health Endpoints”gRPC Health Check
Section titled “gRPC Health Check”# check pivirtd healthgrpcurl -plaintext localhost:9001 grpc.health.v1.Health/Check
# check specific servicegrpcurl -plaintext -d '{"service": "pivirt.vm.v1.VMService"}' \ localhost:9001 grpc.health.v1.Health/CheckHTTP Health Check
Section titled “HTTP Health Check”# check pivirtd healthcurl http://localhost:9002/health
# check readinesscurl http://localhost:9002/ready
# check livenesscurl http://localhost:9002/liveManagement Endpoints
Section titled “Management Endpoints”Reload Configuration
Section titled “Reload Configuration”curl -X POST http://localhost:9002/reloadDebug Endpoints
Section titled “Debug Endpoints”# get debug infocurl http://localhost:9002/debug/vars
# get goroutine stack tracescurl http://localhost:9002/debug/pprof/goroutine?debug=1
# get heap profilecurl http://localhost:9002/debug/pprof/heap > heap.profMetrics
Section titled “Metrics”Prometheus Metrics
Section titled “Prometheus Metrics”# get all metricscurl http://localhost:9002/metrics
# get specific metricscurl http://localhost:9002/metrics | grep pivirtd_vm_countVM Management
Section titled “VM Management”List VMs
Section titled “List VMs”# list all VMsgrpcurl -plaintext localhost:9001 \ pivirt.vm.v1.VMService/ListVMs
# list VMs in namespacegrpcurl -plaintext -d '{"namespace": "production"}' \ localhost:9001 \ pivirt.vm.v1.VMService/ListVMsGet VM Details
Section titled “Get VM Details”# get VM by IDgrpcurl -plaintext -d '{"id": "vm-abc123"}' \ localhost:9001 \ pivirt.vm.v1.VMService/GetVMStart/Stop VM
Section titled “Start/Stop VM”# start VMgrpcurl -plaintext -d '{"id": "vm-abc123"}' \ localhost:9001 \ pivirt.vm.v1.VMService/StartVM
# stop VMgrpcurl -plaintext -d '{"id": "vm-abc123"}' \ localhost:9001 \ pivirt.vm.v1.VMService/StopVMConfiguration Validation
Section titled “Configuration Validation”# validate configurationpivirtd --config /etc/pivirtd/config.yaml --validate
# show effective configurationpivirtd --config /etc/pivirtd/config.yaml --show-configTroubleshooting
Section titled “Troubleshooting”Check KVM Access
Section titled “Check KVM Access”# check KVM availabilitykvm-ok
# check /dev/kvmls -la /dev/kvm
# check kernel moduleslsmod | grep kvmCheck QEMU/KVM
Section titled “Check QEMU/KVM”# check running QEMU processesps aux | grep qemu-system
# list VMs through pivirtdpvcli vm listDebug Logging
Section titled “Debug Logging”# enable debug loggingpivirtd --config /etc/pivirtd/config.yaml --log-level debug
# view debug logssudo journalctl -u pivirtd -f | grep DEBUG