Optimizing Virtual Machine Disk Space: A Guide to Using Azure InsightsMetrics for Seamless Streaming

Yhorby Matias
3 min readApr 13, 2024

--

Picture this: It’s a quiet evening at home. You’re settled on your favorite couch, wrapped in a soft blanket, your eyes glued to the latest gripping series on your streaming service. Next to you, your smartphone is in hand, occasionally used to scroll through social media during show breaks. All is well until suddenly, your stream buffers — a spinning wheel of doom that halts the unfolding drama.

This interruption isn’t just a minor inconvenience in your relaxation — it’s a reminder of a similar, far more critical kind of maintenance: monitoring the free space on your Azure virtual machines. Let’s explore how Azure InsightsMetrics can help you keep everything running smoothly, much like ensuring your streaming experience remains uninterrupted.

The Setup: Your Digital Streaming Service

Your streaming service, much like Azure, needs a well-organized system to deliver content smoothly. Azure InsightsMetrics is like the algorithm that decides what show loads next based on your preferences, but instead, it monitors your virtual environments to ensure they have enough free space to operate efficiently.

The Query: Managing Your Show’s Queue

Think of the following query as managing your show’s queue, making sure there’s always enough downloaded content (free space) for uninterrupted viewing:

InsightsMetrics
| summarize arg_max(TimeGenerated, *) by Tags, Computer
| where TimeGenerated > ago(7h)
| where Name == "FreeSpacePercentage"

Breaking It Down:

1. Selecting the Series (Data): `InsightsMetrics` pulls up all the data about your VMs, similar to selecting a series to watch.

2. Latest Episode (Data Point): The `summarize arg_max(TimeGenerated, *) by Tags, Computer` part fetches the latest information, akin to making sure you’re watching the most recent episode of your favorite series.

3. Time Check: The `where TimeGenerated > ago(7h)` ensures that you’re only looking at the data (episodes) from the last 7 hours, keeping the monitoring current and relevant.

4. Specific Genre (Metric): Filtering by `Name == “FreeSpacePercentage”` focuses on a specific type of data — how much free space is left, much like ensuring you have the next episode ready to play.

Why It Matters

Just as a smoothly streaming show makes for a pleasant evening, keeping an eye on “FreeSpacePercentage” ensures your digital environments don’t run into performance issues. Regular checks prevent scenarios where critical applications halt — no one likes a show-stopping midway due to a technical glitch!

Taking Action

When the free space gets too low, it’s like seeing your show buffer. It’s a signal to take action — maybe clean up old files or expand your storage, ensuring your digital operations continue as smoothly as your binge-watching session.

— -

By the end of your show, not only are you satisfied with a night well spent, but you also rest easy knowing your virtual machines aren’t headed for a cliffhanger due to low disk space. Just like that, Azure InsightsMetrics helps maintain the digital balance, making every evening a good one, both in entertainment and efficient VM management.

--

--

Yhorby Matias

Azure Solutions Architect || Azure DevOps || Azure Administrator || GCP || AWS || 🧙‍♂️ available for contracts