Viewing historical resource consumption data helps cloud users and operators to easily identify bottlenecks or the over-provision of resources, allowing resource owners to estimate and analyse performance. CloudStack already allows for retrieval of metrics data for various resources (eg. Zones, Hosts) and for Instances and their Volumes, but does not display the data in a simple graph.
This improvement expands the available historical metrics data to include user Instances, system VMs and Volumes. Furthermore, a Metrics tab has been added for each of these resources where users can see the data in multiple, interactive graphs. With this improvement, cloud users and operators can gain valuable insights into the performance of CPU, memory, disk IO and network historical statistics.
Inside the feature
To facilitate the storage of historical statistics for various resources, changes have been implemented in the CloudStack management server and database. Specifically, new database tables have been added to store this data, and regular clean-up processes have been established to prevent the database from becoming overly bloated. It should be noted that the availability of metrics for a particular resource depends on the existing hypervisor metrics support within CloudStack, as the management server collects this data from the underlying hypervisor.
To retrieve statistical data from the server, the following APIs have been introduced:
|Historical statistics for user instances
|Historical statistics for system VMs
|Historical statistics for instance volumes
To enable the retention of resource statistics and specify their duration, use the corresponding global configurations. The following global configurations can be used to enable and store historical statistics:
|The maximum time (in minutes) for keeping VM stats records in the database. The VM stats cleanup process will be disabled if this is set to 0 or less than 0. The default value is 720.
|When set to ‘false’ stats for system VMs will be collected otherwise stats collection will be done only for user VMs. The default value is ‘false’.
|When set to ‘true’ stats for VM disks will be stored in the database otherwise disk stats will not be stored. The default value is ‘false’.
|The maximum time (in minutes) for keeping Volume stats records in the database. The Volume stats cleanup process will be disabled if this is set to 0 or less than 0. The default value is 720.
By default, Volume or Disk statistics are not enabled. To enable both, change the following global setting:
|Interval (in seconds) to report VM disk statistics. VM disk statistics will be disabled if this is set to 0 or less than 0.
The release of CloudStack 4.18 includes this improvement. Resource owners are now able to view historical statistics for their resources in graph form, which aids in troubleshooting and analysing performance. While this is a significant advancement, there is always scope for improvement, whether it involves enhancing the hypervisor plugin or expanding the visualisation framework to cover other resources and entities.
Abhishek Kumar is a software engineer by profession. His personal interests and hobbies are technology, politics and sports. Abhishek is experienced in development and management of a variety of desktop and mobile applications. He has a particular interest in mobile application development, designing and developing highly interactive and intuitive mobile, desktop applications GUI.
Abhishek became part of ShapeBlue in 2019 and is currently an active Apache CloudStack Committer.
You can learn more about Abhishek and his background by reading his Meet The Team blog.