Monitoring MicroVMs
Monitoring a microVM means watching two layers at once: the host (CPU, memory, disk, network) and the guest (the services running inside the VM). Start with simple host tools, then add metrics export for alerting.
Quick Host Checks
# resource usage of the QEMU process
htop -p $(pgrep -f 'qemu-system-x86_64.*microvm')
# memory of the VM process
grep -E 'VmRSS|VmSize' /proc/$(pgrep -f microvm)/status
# disk throughput of the VM image
iostat -x 2 | grep -E 'nvme|sda'
From inside the guest the same story applies: htop, free -m, df -h, and ss -s show the load your services actually feel.
Metrics with node_exporter
Install node_exporter on the host so Prometheus can scrape VM-level metrics:
sudo dnf install -y node_exporter
sudo systemctl enable --now node_exporter
# prometheus.yml scrape config
# - job_name: vm-host
# static_configs:
# - targets: ['192.168.56.10:9100']
Sensible alerts: host memory above 90%, the QEMU process OOM-killed (check dmesg), and disk usage above 85% on the partition holding the VM image.
Guest Health Checks
Expose a small health endpoint from a service inside the VM and probe it from the host on a schedule:
curl -fsS http://192.168.56.20/healthz
systemd-run --unit=vm-check -- curl -fsS --max-time 3 http://192.168.56.20/healthz
Summary
Monitor the host with htop, iostat, and node_exporter feeding Prometheus, and monitor the guest with its own system tools plus periodic health-endpoint probes. Alert on memory pressure, OOM kills, disk usage, and failed health checks so problems are caught before the VM goes down.