Azure VM Data disk

Shanmugam s 5 Reputation points
2024-10-22T17:07:29.8933333+00:00

Hi

One of my colleagues' team has a requirement as below.

Consider a scenario where they have many Lazure Linux VMs. One VM can have 'n' no.of data disks. They want to find how many GB/memory used and how many GB are remaining for that particular data disk in portal. In metrics they could see only average for all of the disks (not for a single disk).

Please suggest the possibilities. Thanks in advance.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,986 questions
{count} votes

1 answer

Sort by: Most helpful
  1. deherman-MSFT 37,416 Reputation points Microsoft Employee
    2024-10-22T18:47:29.5966667+00:00

    @Shanmugam s

    If you have VM Insights enabled in Azure Monitor, you should have the necessary data collected to view the individual disks. Please note, in Linux these will be on a per partition basis. By default, you can already view the Logical Disk Space Used %. Navigate to VM under Insights in Monitor portal. Click Performance, Top N List, Select Logical Disk Space Used %.

    User's image

    If you wanted to get the actual amount of space left you can utilize the FreeSpaceMB metric in your Query and convert to GB.

    Example Query from previous post:

    InsightsMetrics  
    | where Origin == "vm.azm.ms"  
    | where Namespace == "LogicalDisk"  
    | where Name == "FreeSpaceMB"  
    | extend Disk = tostring(todynamic(Tags).['vm.azm.ms/mountId']) // Extract the disks  
    | summarize arg_max(TimeGenerated,*) by Computer, Disk // Get the most recent sample of the performance counter  
    | project TimeGenerated, Computer, Disk, FreeSpaceGB = round(Val /1024,2) // Tidy the results up
    

    User's image

    Hope this helps! Let me know if you still have questions or need further assistance.


    If you still have questions, please let us know in the "comments" and we would be happy to help you. Comment is the fastest way of notifying the experts.

    If the answer has been helpful, we appreciate hearing from you and would love to help others who may have the same question. Accepting answers helps increase visibility of this question for other members of the Microsoft Q&A community.

    Thank you for helping to improve Microsoft Q&A!

    User's image


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.