VMware Cloud Community
gsanjana
Contributor
Contributor
Jump to solution

How to Find Disk File Path using a VcVirtualMachine file in VRealize orchestrator

I have a VcVirtualMachine type object called 'vm'(virtual machine). I want the Disk File Path of the Hard Disks in that vm.I am able to fetch the number of hard disks and its name but not the disk file path (ends with .vmdk extension). Please provide a javascript snippet on how I  can use this 'vm' to fetch those details.
Reply
0 Kudos
1 Solution

Accepted Solutions
iiliev
VMware Employee
VMware Employee
Jump to solution

Check if this script dumps the info you need (the input parameter is the variable 'vm'):

for each (var device in vm.config.hardware.device) {

  if (device instanceof VcVirtualDisk) {

    System.log(device.backing.fileName);

  }

}

---------------------------------------------------------------------------------------------------------

Was it helpful? Let us know by completing this short survey here.

View solution in original post

Reply
0 Kudos
2 Replies
iiliev
VMware Employee
VMware Employee
Jump to solution

Check if this script dumps the info you need (the input parameter is the variable 'vm'):

for each (var device in vm.config.hardware.device) {

  if (device instanceof VcVirtualDisk) {

    System.log(device.backing.fileName);

  }

}

---------------------------------------------------------------------------------------------------------

Was it helpful? Let us know by completing this short survey here.

Reply
0 Kudos
gsanjana
Contributor
Contributor
Jump to solution

This worked. Thank you so much.
Reply
0 Kudos