VMware {code} Community
lpollo
Contributor
Contributor

How do I find all files that are backing a VirtualDisk?

Hi everybody,

Given a ManagedObjectReference to a VirtualMachine, I'm trying to determine the entire set of files that make up the VM. I'm able to retrieve most information from the following VirtualMachine properties: config.files.vmPathName, layout.configFile and layout.disk.

However, in the case where I'm using a "flat file" to back the virtual disk, the layout.disk property only returns the path to the "main" virtual disk file, e.g. "My_VM.vmdk", not the associated flat file (e.g. "My_VM-flat.vmdk"). I wonder if that's expected behavior.

Mostly I'd just like to figure out a way to get that information from the API. I've even tried navigating the VM's virtual hardware tree to find the VirtualDiskFlatVer2BackingInfo behind the VirtualDisk, but that also does not contain the information I want.

Any tips would be greatly appreciated.

Thanks!

Luis

Reply
0 Kudos
0 Replies