I’m trying to create a button/dialog that will allow a user to select an ISO image from a vSphere datastore and mount it to the VM in question.
If the the root abject is a vm, I’d like to be able to filter a list of all eligible ISO files on datastores mountable to the VM, by traversing the datastores visible to the vm’s host and gathering a list of files ending in .iso. I could then further filter this by using tags from the datastores to separate access for multi-tenant environments.
Rather than using some brittle external dependency, I’d prefer to locate the ISO file from the information that is available in the vmdb. I notice that once a datastore has been smart state analysed one can drill down into the files via the “All Files” box under “Content” from the datastores web ui view. But how do I find this information in the vmdb? In my lab, I’ve tried traversing everything likely looking under $evm.vmdb(:storage).first but nothing resembling this list of files is evident.
Any clues?