Tech BlogNovember 18, 2026Eunji Han1 views

OpenStack Hypervisor Real-time Resource Monitoring: A Complete Implementation Guide for Prometheus & Grafana

This article covers methods for real-time visualization of the complex resource status of OpenStack private clouds using Prometheus and Grafana. Practical expertise, from custom Exporter development to dashboard construction, based on actual operating environments, is shared.

#OpenStack Monitoring#Prometheus OpenStack#Grafana OpenStack Dashboard#Hypervisor Monitoring#vCPU Utilization#Private Cloud Resource Management#OpenStack Exporter#Nova Monitoring
OpenStack Hypervisor Real-time Resource Monitoring: A Complete Implementation Guide for Prometheus & Grafana
Eunji Han

November 18, 2026

With the advancement of cloud technology, many enterprises are adopting OpenStack-based private clouds to build flexible and scalable infrastructures. OpenStack, while a powerful IaaS (Infrastructure as a Service) solution, demands considerable expertise for its operation and management due to its complex distributed architecture. Particularly in large-scale OpenStack clusters comprising hundreds or thousands of virtual machines (VMs) and compute nodes, real-time monitoring and optimization of core resources such as hypervisor vCPU, memory, and storage are essential for stable service operations. However, OpenStack does not natively provide the scrape endpoints required by Prometheus, necessitating the development of custom Exporters for real-time monitoring. This post shares detailed practical experience and know-how on effectively visualizing and managing hypervisor resource status using Prometheus and Grafana in a live OpenStack cluster environment.

Key Data

To efficiently operate a large-scale OpenStack private cloud, it is crucial to accurately understand the current resource utilization status of the cluster. The table below illustrates the key resource status of the currently operational OpenStack cluster. This cluster consists of a total of 10 compute nodes, serving a significant volume of virtual resources.

MetricTotal ResourcesUsed ResourcesUsage Rate
Number of Compute Nodes10--
Total vCPUs48023949.8%
Total Memory1,784GB895GB50.1%
Total Number of VMs-639-

These figures indicate that approximately 50% of the cluster's resources are in use, providing a critical baseline for analyzing future expansion capacity and the efficiency of current resource allocation. In environments where the number of VMs exceeds 600, real-time monitoring of individual node resource status and service health becomes even more vital.

Trend Analysis

Necessity of OpenStack Monitoring and Existing Challenges

OpenStack has established itself as a robust alternative for internal cloud deployments within enterprises; however, its complexity continues to pose challenges for operation and monitoring. Especially in large-scale OpenStack environments, consisting of hundreds of VMs and multiple compute nodes, efficient resource management and ensuring service stability are critical success factors. Real-time understanding of core hypervisor resource utilization, such as vCPU, memory, and disk I/O, is necessary to pre-emptively detect overloads, prevent performance degradation, and establish appropriate capacity plans.

While OpenStack offers basic resource status visibility through the Horizon dashboard, it often lacks real-time capabilities and provides limited or no historical data. Furthermore, it does not natively provide standardized metric endpoints for integration with modern monitoring systems like Prometheus. Consequently, operations teams have had to resort to inefficient methods, such as manually checking the status of each node or collecting data via complex scripts. To overcome these limitations and achieve visibility into distributed OpenStack clusters, it is essential to implement professional monitoring stacks like Prometheus and Grafana, alongside developing custom Exporters that extract necessary metrics using OpenStack APIs and transform them into a Prometheus-compatible format.

Custom OpenStack Exporter Development and Implementation

The crucial step for collecting OpenStack hypervisor resource status into Prometheus is the development of a custom Exporter. This Exporter invokes OpenStack's Nova API and Neutron API to extract necessary metrics, transforms them into a text-based format scannable by Prometheus, and provides an HTTP endpoint. Typically, it is developed using the Python language and the openstacksdk library.

The following is a list of key metrics that the custom Exporter should collect:

  • openstack_hypervisor_vcpus_total: Total number of vCPUs
  • openstack_hypervisor_vcpus_used: Number of used vCPUs
  • openstack_hypervisor_memory_mb_total: Total memory (MB)
  • openstack_hypervisor_memory_mb_used: Used memory (MB)
  • openstack_hypervisor_running_vms: Number of running VMs
  • openstack_instances_total: Number of VMs by state (e.g., active, error)
  • openstack_nova_services_state: State of Nova services (e.g., nova-compute) (UP: 1, DOWN: 0)
  • openstack_neutron_agents_alive: Liveness state of Neutron agents (e.g., neutron-dhcp-agent) (alive: 1, dead: 0)

The core logic of the Exporter for collecting these metrics can be implemented as follows. OpenStack authentication credentials (OS_AUTH_URL, OS_USERNAME, OS_PASSWORD, OS_PROJECT_NAME, OS_USER_DOMAIN_NAME, OS_PROJECT_DOMAIN_NAME) are retrieved from environment variables or configuration files to connect to the OpenStack API. The hypervisors and servers APIs of the Nova service and the agents API of the Neutron service are periodically invoked to collect data. The collected data is exposed as metrics with appropriate labels (e.g., hypervisor_hostname, state, service_name) via the Prometheus client library.

from prometheus_client import start_http_server, Gauge
import openstack
import os
import time
# OpenStack 연결 설정
# clouds.yaml 또는 환경 변수를 통해 인증 정보를 로드합니다.
# 예: os.environ['OS_AUTH_URL'], os.environ['OS_USERNAME'] 등
conn = openstack.connect(cloud='openstack') 
# Prometheus Gauge 메트릭 정의
g_vcpus_total = Gauge('openstack_hypervisor_vcpus_total', 'Total vCPUs in OpenStack hypervisors', ['hypervisor_hostname'])
g_vcpus_used = Gauge('openstack_hypervisor_vcpus_used', 'Used vCPUs in OpenStack hypervisors', ['hypervisor_hostname'])
g_memory_total = Gauge('openstack_hypervisor_memory_mb_total', 'Total memory (MB) in OpenStack hypervisors', ['hypervisor_hostname'])
g_memory_used = Gauge('openstack_hypervisor_memory_mb_used', 'Used memory (MB) in OpenStack hypervisors', ['hypervisor_hostname'])
g_running_vms = Gauge('openstack_hypervisor_running_vms', 'Number of running VMs on hypervisors', ['hypervisor_hostname'])
g_instances_total = Gauge('openstack_instances_total', 'Total instances by state', ['state'])
g_nova_service_state = Gauge('openstack_nova_services_state', 'Nova service state (1=UP, 0=DOWN)', ['service_name', 'host'])
g_neutron_agent_alive = Gauge('openstack_neutron_agents_alive', 'Neutron agent alive state (1=Alive, 0=Dead)', ['agent_type', 'host'])
def collect_metrics():
    # 하이퍼바이저 자원 정보 수집
    hypervisors = conn.list_hypervisors(details=True)
    for hv in hypervisors:
        # AZ 정보는 hv.hypervisor_hostname으로 대체될 수 있습니다. 실제 환경에 따라 레이블 조정 필요
        g_vcpus_total.labels(hv.hypervisor_hostname).set(hv.vcpus)
        g_vcpus_used.labels(hv.hypervisor_hostname).set(hv.vcpus_used)
        g_memory_total.labels(hv.hypervisor_hostname).set(hv.memory_mb)
        g_memory_used.labels(hv.hypervisor_hostname).set(hv.memory_mb_used)
        g_running_vms.labels(hv.hypervisor_hostname).set(hv.running_vms)
    # 인스턴스 상태별 수집
    instance_states = {}
    for server in conn.list_servers(details=True):
        state = server.status
        instance_states[state] = instance_states.get(state, 0) + 1
    for state, count in instance_states.items():
        g_instances_total.labels(state).set(count)
    # Nova 서비스 상태 수집
    nova_services = conn.list_services(service='nova')
    for svc in nova_services:
        state = 1 if svc.state == 'up' else 0
        g_nova_service_state.labels(svc.binary, svc.host).set(state)
    # Neutron 에이전트 상태 수집
    neutron_agents = conn.list_agents()
    for agent in neutron_agents:
        state = 1 if agent.alive else 0
        g_neutron_agent_alive.labels(agent.agent_type, agent.host).set(state)
if __name__ == '__main__':
    start_http_server(9100) # 9100번 포트에서 메트릭 노출
    print("OpenStack Exporter started on port 9100")
    while True:
        collect_metrics()
        time.sleep(60) # 60초마다 메트릭 업데이트

The code above is a simplified example; in an actual operating environment, additional features such as exception handling, logging, configuration management, and authentication token renewal logic would be required. The Exporter is deployed on an OpenStack controller node or a separate monitoring server and configured to run periodically.

Metric Collection with Prometheus and PromQL Queries

Once the custom OpenStack Exporter begins exposing metrics, the Prometheus server must be configured to scrape that endpoint. The Exporter's address and port are added to the scrape_configs section in the Prometheus configuration file (prometheus.yml).

# prometheus.yml
scrape_configs:
  - job_name: 'openstack-exporter'
    static_configs:
      - targets: ['<openstack-exporter-host>:9100'] # Exporter가 실행되는 호스트 IP 및 포트

Once Prometheus successfully begins collecting metrics, the powerful query language PromQL can be utilized to analyze various states of the OpenStack cluster. The following are examples of PromQL queries that can be useful in practice.

  • Overall vCPU Utilization: Calculates the vCPU utilization for the entire cluster, which can be used for capacity planning.
    sum(openstack_hypervisor_vcpus_used) / sum(openstack_hypervisor_vcpus_total) * 100
    

    In a live operational cluster, approximately 49.8% utilization was observed. This indicates that roughly half of the vCPUs are in use.

  • Node-specific Memory Utilization: Identifies the memory utilization of each compute node to determine if a specific node is overloaded.
    openstack_hypervisor_memory_mb_used / openstack_hypervisor_memory_mb_total * 100 BY (hypervisor_hostname)
    
  • VM State Distribution: Checks the distribution of VMs within the current cluster by state (e.g., active, error, paused).
    sum by (state) (openstack_instances_total)
    
  • Nova Service Downtime Detection: Monitors the state of Nova services (e.g., nova-compute) to immediately detect service interruptions.
    openstack_nova_services_state{service_name="nova-compute"} == 0
    

    This query detects instances where the nova-compute service is down (0). By integrating this with Prometheus Alertmanager, immediate notifications can be received in the event of a failure.

Grafana Dashboard Construction and Visualization Strategy

Metrics collected via Prometheus are intuitively visualized through Grafana dashboards. An effective Grafana dashboard for OpenStack monitoring should be structured to allow operators to grasp the cluster's status at a glance and drill down into details as needed.

Recommended dashboard components are as follows:

  • OpenStack Overview Panel:
    • Overall Resource Status: Displays key metrics such as total vCPUs, used vCPUs, total memory, used memory, and total number of VMs for the entire cluster in large numerical panels.
    • Resource Distribution by AZ: Visualizes vCPU and memory usage by Availability Zone (AZ), such as DMZ and INTERNAL, using pie charts or bar charts to facilitate easy identification of resource imbalances.
    • VM State Distribution: Shows the number of VMs by state (e.g., active, error, paused) using a pie chart to identify the proportion of abnormal VMs.
    • Nova/Neutron Service Status: Displays the current status (UP/DOWN or Alive/Dead) of key OpenStack services and agents to monitor service availability.
  • Node-specific Detail Panels: Visualizes vCPU utilization, memory utilization, number of running VMs, disk I/O, etc., for each compute node through graphs, enabling detailed analysis of performance bottlenecks or overloads on specific nodes. It is efficient to leverage Grafana's variable feature to configure the dashboard such that selecting a specific node displays its detailed information.
  • Time-series Trend Panels: Displays historical data of key metrics such as vCPU utilization, memory utilization, and VM creation/deletion trends in time-series graphs to analyze long-term trends and utilize them for capacity forecasting and planning. This provides crucial insights for predicting future resource requirements and proactively responding.

It is particularly important to clearly indicate distinctions of actual operating environments, such as DMZ/INTERNAL AZs, through Grafana dashboard filtering functions or separate panel configurations. This enables the establishment of optimal operational strategies that consider the resource characteristics of each AZ.

This monitoring framework contributes not merely to data visualization but also to early detection and response to potential risks within the OpenStack cluster. For instance, if a Nova service downtime is detected via the openstack_nova_services_state metric, it can be integrated with Seekurity SIEM/SOAR to trigger automated alerts and response playbooks. Seekurity SIEM analyzes integrated OpenStack operational logs and metric data collected via Exporters to identify potential threats, while Seekurity SOAR automates immediate actions against these threats, maximizing security operation efficiency.

Industry-Specific Impact

In various industrial sectors utilizing OpenStack-based private clouds, such real-time resource monitoring systems play a critical role.

  • Financial Industry: The financial industry demands high availability and stability. Real-time OpenStack monitoring contributes to early detection of performance degradation in critical infrastructure such as trading systems and customer databases, and to swift response in case of failure, minimizing financial service disruptions. Furthermore, systematic resource management and audit logging are essential for compliance with regulations such as ISMS-P and electronic financial supervision rules, and monitoring data serves as crucial evidence to meet these requirements.
  • Public Sector and Public Institutions: In the public sector, there is an increasing trend of building large-scale civil petition systems or data platforms with OpenStack. Ensuring transparency and efficiency in resource utilization is necessary for stable public service provision, and continuous validation of system integrity is required in regulatory environments such as the National Intelligence Service's security suitability review or Cloud Security Certification (CSAP). Real-time monitoring supports these requirements.
  • IT and Internet Services: IT companies that operate their own service infrastructure on OpenStack manage diverse workloads, from development/test environments to production environments. Monitoring enhances the efficiency of development and deployment pipelines, ensures service scalability, and provides essential data for establishing auto-scaling strategies in response to traffic changes.
  • Manufacturing Industry: As OpenStack is utilized in the digital transformation of manufacturing processes, such as smart factories and IoT platforms, the stable operation of high-performance computing resources for processing and analyzing production equipment data has become crucial. Resource monitoring contributes to reducing downtime of critical manufacturing process systems and maximizing data processing efficiency, thereby enhancing productivity.

Thus, while the utilization of monitoring data may vary depending on industry-specific characteristics, it commonly serves as an essential foundation for service availability, performance, security, and compliance.

Expert Implications

OpenStack hypervisor resource monitoring transcends mere technical implementation; it represents a crucial point in elevating the maturity of cloud operations.

  • Technical Perspective: Custom Exporter development is predicated on a deep understanding of OpenStack APIs. This implies that prior consideration of which data is most critical for operations and the most efficient collection methods is necessary, beyond merely retrieving data. It is crucial to leverage the powerful features of Prometheus and Grafana to utilize collected data not only for immediate situational awareness but also for long-term trend analysis and prediction. Specifically, resource utilization metrics can be employed to pre-emptively detect resource bottlenecks on specific nodes and optimize VM deployment strategies. Furthermore, Nova/Neutron service status monitoring plays a decisive role in ensuring the availability of fundamental cluster services.
  • Business Perspective: Transparency in cloud resource utilization directly translates to cost efficiency. By analyzing vCPU and memory utilization data, unnecessarily allocated or inefficiently utilized resources can be identified and optimized, leading to reduced operational costs. Moreover, real-time monitoring contributes to minimizing service downtime and proactively resolving potential performance issues, thereby enhancing customer satisfaction. Ultimately, this is a critical factor directly related to Business Continuity. Decision-makers must recognize that the implementation of such monitoring systems is not merely a technical investment but a strategic one for securing service stability and increasing operational efficiency.
  • Security Perspective: Resource monitoring also provides a crucial foundation for security vulnerability management and threat detection. An abnormal increase in resource usage could be an indicator of a Denial-of-Service (DoS) attack or malware infection. Security solutions like Seekurity SIEM/SOAR can integrate and analyze not only the operational logs of the OpenStack cluster but also resource utilization metrics collected via Prometheus. This enables the establishment of an intelligent threat detection and automated response system based on anomalous infrastructure resource behavior, beyond typical security events.

Response Strategies

Response strategies for the successful implementation and operation of an OpenStack hypervisor monitoring system can be categorized into short-term and long-term perspectives.

  • Short-term Response Plan (Initial Implementation and Stabilization):
    • Prioritize Custom Exporter Development: Develop and deploy an Exporter to collect core hypervisor resources (vCPU, memory, number of VMs) and key service (Nova, Neutron) statuses via Nova API. Begin with a minimum set of essential metrics to ensure stability.
    • Configure Prometheus Scrape: Set up Prometheus to periodically scrape the deployed Exporter and verify the successful collection of metrics.
    • Establish Core Grafana Dashboards: Prioritize building dashboards, centered around the OpenStack Overview panel, to provide an at-a-glance view of the entire cluster's core resource status and service health. Clearly visualize AZ-specific distribution and VM state distribution to aid immediate decision-making by the operations team.
    • Configure Alerts: Utilize Prometheus Alertmanager to send immediate notifications to responsible personnel upon critical events such as vCPU/memory utilization threshold breaches or Nova service downtime.
  • Long-term Response Plan (Expansion and Advancement):
    • Expand Exporter Functionality: Extend the monitoring scope by adding more diverse OpenStack service metrics (e.g., storage (Ceph), network (Neutron)) and detailed metrics from OpenStack controller nodes (e.g., API response time, DB connection status) to the Exporter.
    • Refine Dashboards: Enhance Grafana dashboards, including node-specific detail panels and time-series trend analysis panels, to provide operators with deeper insights. Include detailed analysis panels for specific AZs.
    • Automated Capacity Management: Analyze resource usage patterns based on collected metric data and utilize Machine Learning techniques to forecast future resource requirements. Consider implementing a system that automates resource allocation by integrating this with OpenStack's auto-scaling capabilities.
    • Integrate Security Monitoring: Consolidate collected OpenStack monitoring data, OpenStack's own logs, and logs from other security devices into Seekurity SIEM/SOAR to enhance anomaly detection and threat analysis capabilities based on infrastructure resource changes. Specifically, by integrating with FRIIM CNAPP/CSPM/CWPP, a comprehensive cloud security framework can be established through continuous management of cloud infrastructure security vulnerabilities, detection of configuration errors, and strengthening of workload runtime security.
    • Strengthen Required Capabilities: It is crucial to cultivate personnel with expertise in OpenStack, Prometheus, and Grafana or seek support from external specialists. Continuous technical training and knowledge sharing will enhance the operations team's capabilities. Exploring the use of AI-based security analysis tools like KYRA AI Guardrail to detect abnormal resource usage patterns and automate security operations is also an option.

Conclusion

The establishment of a real-time resource monitoring system for stable and efficient service operation in an OpenStack-based private cloud environment is of paramount importance. While OpenStack itself notably does not directly provide Prometheus scrape endpoints, we have presented a solution involving the development of a custom Exporter to effectively collect core metrics such as hypervisor vCPU, memory, VM count, and service status via Nova and Neutron APIs.

The systematic storage and querying of these collected metrics through Prometheus, coupled with their intuitive visualization via Grafana dashboards, is an accelerating trend. This enables operations teams to gain profound insights, including an at-a-glance understanding of the cluster's overall status, detection of performance bottlenecks on specific nodes, and analysis of resource distribution by AZ. Furthermore, it is noteworthy that integration with Prometheus Alertmanager allows for rapid response to critical events, and connecting metric data to integrated security platforms such as Seekurity SIEM/SOAR facilitates the establishment of threat detection and automated response systems based on infrastructure resources.

Ultimately, such monitoring systems are evolving to serve as a core foundation not only for fault response but also for optimizing resource utilization, improving the accuracy of capacity planning, ensuring service availability, and adhering to compliance. In the continuously evolving cloud environment, it is imperative to persistently monitor the improvement and advancement of monitoring systems for successful private cloud operations.

Stay Updated

Get the latest security insights delivered to your inbox.

Tags

#OpenStack Monitoring#Prometheus OpenStack#Grafana OpenStack Dashboard#Hypervisor Monitoring#vCPU Utilization#Private Cloud Resource Management#OpenStack Exporter#Nova Monitoring