vCenter

 View Only
  • 1.  automating vcsa root user password change with pyvmomi?

    Posted Sep 14, 2023 06:55 AM

    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 ?



  • 2.  RE: automating vcsa root user password change with pyvmomi?

    Posted Sep 14, 2023 08:43 AM

    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-523261AF-B36C-4C42-AD0C-8AD8D6AAEFE5.html

    and use this method in the Python SDK.



  • 3.  RE: automating vcsa root user password change with pyvmomi?
    Best Answer

    Broadcom Employee
    Posted Sep 14, 2023 02:30 PM

    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



  • 4.  RE: automating vcsa root user password change with pyvmomi?

    Posted Sep 14, 2023 06:29 PM

    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.