Fall back to slower lookups when SearchIndex is unavailable
rjbell4 opened this issue · 4 comments
I'm received permissions errors trying to access the folders containing my VMs with rvc. Might this be because all the VMs are in folders? I can use the official vSphere client without any permissions error. Below is a filtered log.
$ /var/lib/gems/1.8/bin/rvc -k 'UserName'@myhost.sub.sub.domain.com
password:
0 WXYZ (datacenter)
1 Datacenters/
/myhost.sub.sub.domain.com> cd WXYZ/vm
/myhost.sub.sub.domain.com/WXYZ/vm> ls
0 FOO X Qux/
1 BAR/
2 vm/
3 Z4 Zzz ZZz/
4 ACK/
5 Gack Awk/
/myhost.sub.sub.domain.com/WXYZ/vm> cd BAR
NoPermission: Permission to perform this operation was denied.
/myhost.sub.sub.domain.com/WXYZ/vm> cd vm
NoPermission: Permission to perform this operation was denied.
/myhost.sub.sub.domain.com/WXYZ/vm> cd Z4\ Zzz\ ZZz/
NoPermission: Permission to perform this operation was denied.
/myhost.sub.sub.domain.com/WXYZ/vm> q
Try using the 'debug' command to toggle SOAP logging, which will show
exactly what API call failed. My guess is that your user doesn't have
permission to use the SearchIndex.
It would appear that that is correct. Here's the XML snippet for the request:
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body><FindChild xmlns="urn:vim25"><_this type="SearchIndex">SearchIndex</_this><entity type="Folder">group-v3</entity><name>BAR</name></FindChild></env:Body></env:Envelope>
Is this a difference between how rvc and vSphere work? I can see a list in vSphere.
Should I be asking an admin to enable SearchIndex for me? (I have no idea how the permissions work)
You should only need System.View privileges on the entity passed
to FindChild. I vaguely remember seeing this issue internally but I
don't remember why the permission hadn't been granted.
This was apparently resolved by giving me "read permissions on myhost.sub.sub.domain.com [the virtual console server]".
It's unfortunately, though, that this doesn't seem to be an issue for the vSphere client, but it does keep rvc from working.