I'm trying to run some sample scripts from the Pyvmomi Community Samples on a vcenter server appliance: https://github.com/vmware/pyvmomi-community-samples
Caught vmodl fault : Permission to perform this operation was denied.
With another simple script:
from pyVim.connect import SmartConnect, Disconnect
import ssl
s = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
s.verify_mode = ssl.CERT_NONE
c = SmartConnect(host="IP", user="USER", pwd='PWD', sslContext=s)
datacenter = c.content.rootFolder.childEntity[0]
vms = datacenter.vmFolder.childEntity
for i in vms:
print(i.name)
Disconnect(c)
If I use my domain user account, with which I can login to the vcenter:
Cannot complete login due to an incorrect user name or password.
I used DOMAIN\USERNAME as user.
or as root:
Permission to perform this operation was denied.
I added some permissions in vcenter server, but apparently it is not enough :(.