Is it possible to get the virtual machine details where azure netapp volume mounted?

Vijayakumar Gopika 20 Reputation points
2025-01-09T10:51:45.42+00:00

Is it possible to Get the virtual machine details where azure netapp volumes mounted?

Azure NetApp Files
Azure NetApp Files
An Azure service that provides enterprise-grade file shares powered by NetApp.
97 questions
{count} votes

Accepted answer
  1. anashetty 1,645 Reputation points Microsoft Vendor
    2025-01-09T18:13:37.2666667+00:00

    Hi Vijayakumar Gopika,

    Thanks for getting back with detailed explanation. Yes, you can get the details of NetApp volumes mounted on virtual machines (VMs) in Azure using Azure CLI or Azure APIs.

    • First List all the VMs in your subscription:
    az vm list --query "[].{Name:name, ResourceGroup:resourceGroup}" -o table
    
    • Use below command on the VMs to check the mounted NetApp volumes: You need to see that the Azure VM Agent is installed and running on the VMs for the run-command feature to work.
    az vm run command invoke \
      --command-id RunShellScript \
      --name <VM_NAME> \
      --resource-group <RESOURCE_GROUP> \
      --scripts "df -h | grep -i netapp"
    

    Please refer this document Execute a specific run command on a vm

    You can also write a script that loops through all VMs retrieved and executes the az vm run command invoke for each VM to collect the mounted volume details.Using Azure Rest API:

    If you have any further queries, please do let us know. If the answer is helpful, please click "Accept Answer" and "Upvote it."User's image


0 additional answers

Sort by: Most helpful

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.