Invoke-GetVMGuestLocalFilesystem displays no data

I had a customer report the following in VMware {Code} Slack:

Hello! I’m trying to automate the increment of disk size on VMs and to do that I need the information from “Invoke-GetVmGuestLocalFilesystem “. The problem is that some VMs don’t display the “mappings” attribute and I can’t find anywhere if there is a way to force the tools to populate it. My issue is not related to tools, virtual hardware or operating system version, since I’m able to gather this attribute from older OSes and this sample VM that I can’t get the information I need is completely up-to-date. I have enabled the tools debug logs on this particular VM and this points to something but I’m stuck here:
[2022-04-04T22:37:00.235Z] [   debug] [guestinfo] [776] GuestInfo_GetDiskInfo: GetVolumePathNamesForVolumeNameW(\\?\Volume{xxxx-0000-0000-0000-100000000000}\) returned empty path name.
[2022-04-04T22:37:00.235Z] [   debug] [guestinfo] [776] GetVolumeUUID: ‘\\?\Volume{xxxxx}’ is SCSI
[2022-04-04T22:37:00.235Z] [   debug] [guestinfo] [776] GetVolumeUUID: SerialNumberOffset(0) isn’t valid
[2022-04-04T22:37:01.282Z] [   debug] [guestinfo] [776] GuestInfo_GetDiskInfo: Volume (\\?\Volume{xxxxxx}\) is not eligible.

Invoke-GetVmGuestLocalFilesystem is part of the VMware SDK, a PowerCLI interface into this API call.

I was fortunate to get some help from one of our senior R&D engineers. This PowerShell command should tell you if the PowerCLI command is expected to work – if a serial number is returned, the Invoke command is expected to work. If this WMI command returns nothing, then the Invoke command will also not work.

PS c:\> get-wmiobject -class win32_diskdrive | select-object -property serialnumber

One possible cause for the WMI command returning nothing is that the UUID is disabled. The VMX file must have this property set to TRUE. This setting fixed the issue for the customer.

disk.EnableUUID = "TRUE"

Leave a Reply

Your email address will not be published. Required fields are marked *