0

I have to get DiskType information using python pyvmomi library, I am able to get the same through C# VMware sdk via "Get-VM | Get-HardDisk -DiskType "Flat" | Select Parent,Name,DiskType,ScsiCanonicalName,DeviceName,Diskmode | fl" command, which will output all the disk in vSphere/eSX with Flat disktype. In the respective command, I have searched for "Flat" disktype which can also be "RawPhysical, RawVirtual, or Unknown". I have gone through VMware MOB properties as well but wasn't able to search for DiskType property.

Thanks

justjais
  • 344
  • 3
  • 13
  • Does this link help: https://github.com/vmware/pyvmomi-community-samples/blob/master/samples/virtual_machine_device_info.py ? – Tiger-222 Aug 24 '16 at 09:03
  • No, it doesn't help as it will not tell me disktype of my virtual disk. If I run above C# query in VMware powercli after connecting to my vSphere/eSX it will give output as: (Parent : test, Name : Hard disk 1, DiskType : Flat/RawPhysical/RawVirtual/Unknown, ScsiCanonicalName : xyz DeviceName : xyz Diskmode : xyz), and the shared link will not give respective info. – justjais Aug 24 '16 at 09:22
  • @justjais any update on this issue, have you got the disk type through MOB? – kunal taitkar May 25 '21 at 09:46

1 Answers1

0

Just iterate over vim.vm.config.hardware.device and check if there's a device that has the property backing of type RawDiskMappingVer1BackingInfo, see the docs for details on that object.

omni
  • 4,104
  • 8
  • 48
  • 67