I believe my problem was probably different than yours... (sorry for cluttering the thread). I traced this down to this scenario/issue:
I am using the vmware-cmd.pl remote access feature. When I issue the command on the local ESX server the getstate works just fine. If I do it remotely it fails with the aforementioned error. What it comes down to is this code in vmware-cmd.pl (well... actually the functions that are being called):
my $vm_cfg_path = generate_cfg_path($cmdarray[0]);
my $vm_view;
if (defined $vm_cfg_path) {
$vm_view = get_vm($vm_cfg_path);
}
As the function name suggests, generate_cfg_path generates the path to the configuration. In the remote case, the get_vm call does not actually append the actual configuration file name (the one with the .vmx). I haven't looked into why that happens, but the function returns just the original path and then things fail. If I pass in the already resloved name as "
Volume VM/12345/vmwconfig.vmx" then things work fine.
Looks like a name lookup issue in vm_view, and a lack of testing this tool in remote mode. Another workaround would be to take the tail of the original cmdarray[0] (after the last /) and append that to $vm_view if it is identical to $vm_cfg_path.
Thanks,
Sven