VMware Cloud Community
-ranga-
Contributor
Contributor
Jump to solution

automating vcsa root user password change with pyvmomi?

We are trying to automate changing the password of vCenter "root" local account, preferably with Python.

Is there any way to do it with pyvmomi ?

If not, is there a recommended way ?

0 Kudos
1 Solution

Accepted Solutions
lamw
Community Manager
Community Manager
Jump to solution

Yes, you can use the vCenter REST API for https://developer.vmware.com/apis/vsphere-automation/latest/appliance/appliance/local_accounts/ its not in pyvmomi but rather in the vSphere Automation SDK for Python or you can simply use any Python REST Client

View solution in original post

3 Replies
acpzehetal
Enthusiast
Enthusiast
Jump to solution

Actually the password change is made by VMware adapted tools or scripts. You can try to use the custom method mentionned in the following site:

https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere.vcenter.configuration.doc/GUID-5232...

and use this method in the Python SDK.

lamw
Community Manager
Community Manager
Jump to solution

Yes, you can use the vCenter REST API for https://developer.vmware.com/apis/vsphere-automation/latest/appliance/appliance/local_accounts/ its not in pyvmomi but rather in the vSphere Automation SDK for Python or you can simply use any Python REST Client

-ranga-
Contributor
Contributor
Jump to solution

Thanks, this helped.

We found our own forgotten experimental code that had successfully used the REST API .

We also some sample code here - local_accounts.py, it too seems to work.

0 Kudos