Custom Report for Host Capacity Growth

Hi experts, Morpheus support teams,

I have a use case that requires generating a report that tracks physical host usage growth that is managed on Morpheus to plan for server purchases or upgrades for the system each year. Therefore, this report must provide RAM, CPU and Storage usage in a certain period of time such as a quarter or 1 year. In addition, the report information also needs to show the chart inside from the above data as the image below. (I know we can use Google Charts to do the graphs)

After reading about the Custom Report document and accessing my database, I found the cumpute_server table that can provide the necessary data fields about CPU, RAM, and Storage usage, but there is only the time field last_updated is not enough to track capacity growth over certain time periods (1 month or 1 year). I believe this requirement is possible, right?

It would be very grateful to see your help! Thank you!

One approach could be a job automation to snapshot the data in compute_server and add to a custom table say weekly. That table could give you a time series by server, so you could base your custom report on that data.

1 Like

It’s such a great information, thank you so much. I would be grateful if there was a Github sample of this.

I don’t know of an example to share I’m sorry. But how it could work at a high level though…? I am happy to share more on my thought process:

  • Create a task, say in Python, that reads user credentials for the database stored in Cypher. The user there has database grants to read from a Morpheus table (compute_server) and write to a custom table (created already)
  • That task is run as a scheduled job, daily, weekly or whatever is needed.
  • The query executed by the above task takes all the data from compute_server table and inserts it to the custom table, probably behind a new primary key.
  • Your report query, can access the custom table (read only) since it is inside the Morpheus DB. You can query and aggregate for the report there, or you can aggregate the data needed when you snapshot compute_server

I hope that can help you progress your requirement.

Thank @Ollie_Phillips for your instruction, It’s clearly enough to implement the use case. I will test these processes soon and if there are any issues, I’ll send it to you! More than a thank you, Cheers!