Technical Blog

What to monitor in an on-prem OpenStack cloud

The standard templates are fine for monitoring normal servers, but a cloud needs more than that.

What's so special about a cloud?#

Slide: What is so special about monitoring the cloud? Many services, very interconnected: a VM that needs network access (no router, or worse no dhcp-agent?), or a VM with slow disk operations (is it Ceph, the network, or the VM?); many tiers; federated and hybrid clouds
Why a cloud is harder to monitor than a bunch of servers.

A cloud is a lot of services that all depend on each other, so knowing that a server is up tells you very little about whether the cloud works.

Take a VM that needs network access. Its QEMU/KVM process has to be healthy and getting the CPU and memory it was promised. OVS or OVN (or Linux bridge) has to be working on the host. Its network needs a DHCP agent. If a network loses its DHCP agent nothing happens right away, but each VM on it loses its IP when its lease runs out and it can't renew. That's really bad, and it's confusing too, because it shows up hours after the agent actually failed. The VM also needs the metadata service so cloud-init can set it up. And if it needs a router, the router has to be scheduled properly. An HA router should be active in exactly one place, and it's possible for one to end up active on two nodes at once.

Any of that can be broken while every server in your monitoring shows green.

Or take the most common ticket of all, "my VM is slow". Is it Ceph? Is it the network, on the compute node or on the routers? Or is it the VM itself, a QEMU process starved for CPU on an overcommitted host? You can only answer that if each layer is monitored well enough to rule it in or out.

Multi-region and hybrid clouds make all of this harder. How do you monitor compute hosts in another data center that your monitoring server can't reach? How do you get AWS, GCP and your own OpenStack into one place?

What to monitor#

Slide: What should you monitor? Backend services (RabbitMQ, MariaDB); OpenStack services (API response times and return values); network (Neutron routers, DHCP and metadata agents, quorum-based active/passive); Octavia (load balancer passive/active status); Designate (DNS); storage (NFS/Ceph)
What I watch in an OpenStack cloud.

This is where I'd start, with some examples of the checks I mean.

Backend services#

Everything in OpenStack talks through RabbitMQ and keeps its state in MariaDB (often Galera), so start there. When RabbitMQ is struggling, you see random timeouts in every service.

rabbitmq-diagnostics -q check_running
rabbitmqctl cluster_status
# queues piling up, or with nobody consuming them
rabbitmqctl list_queues -q --no-table-headers name messages consumers | awk '$2 > 1000 || $3 == 0'

mysql -e "SHOW GLOBAL STATUS WHERE Variable_name IN ('wsrep_cluster_size','wsrep_local_state_comment','wsrep_ready')"

OpenStack services#

For Nova, Neutron, Cinder, Glance, Keystone and the rest, a running process and an open port aren't enough. Check that each API endpoint answers, how long it takes, and that it returns the right thing. If Keystone takes eight seconds to answer, it's technically up, but for everyone waiting on it that's an outage. Watch the service and agent states too:

openstack compute service list
openstack volume service list
openstack network agent list

If everything there is up, it only tells you the control plane is working. The VMs can still be broken.

Network#

Neutron needs a bit more attention than the other services, because its failures are usually quiet. Each HA router should be active on exactly one L3 agent. If it's active on none of them, or on two, traffic through that router breaks and nothing obvious tells you. Each network that uses DHCP should be hosted by at least one live DHCP agent, ideally two, so alert when a network has none left. And watch the metadata agents too. When they're down, new VMs boot without their SSH keys or user data, unless they use a config drive.

openstack network agent list --router <router> --long    # HA State: one active, the rest standby
openstack network agent list --network <network>         # DHCP agents hosting this network
openstack network agent list --agent-type metadata

OVN has no DHCP or L3 agents, so with OVN you'd watch the OVN databases, ovn-controller on each node, and the metadata agent instead.

Octavia, Designate and storage#

If you run Octavia in active/standby, check that each load balancer really has one MASTER and one BACKUP amphora (openstack loadbalancer amphora list). For Designate, check that records actually make it to the nameservers. Running dig for a test record every few minutes is enough.

For Ceph or NFS, watch performance as well as health. A Ceph cluster can say HEALTH_OK while its OSD latency is ten times higher than normal, and your users will feel that as slow VMs.

ceph health detail
ceph osd perf          # per-OSD commit/apply latency, the first thing I check for "slow VM"
ceph osd pool stats

Then there are the hypervisors themselves. Watch CPU steal and overcommit, memory pressure, and each QEMU process.

What's still hard#

Hybrid clouds are still hard. If you have some things in AWS and some on-prem, plus Ironic and Kubernetes, that's a lot of different technology to keep track of. You're usually better off with one standard tool and your own checks on top of it than with a separate product for each piece.

Multi-region is hard too. If your monitoring server can't reach a data center, that whole region is invisible to it. Proxies help a lot here, and I cover them in the Zabbix post.

The hardest part is connecting cloud performance to application performance. When a user says their website is slow, how do you tie that back to something in your infrastructure?

And there's always some legacy stuff around, like Xen, old bare metal or Proxmox. You have to keep monitoring it, but don't design your monitoring around it.