Try to reset the password using the below KB and set it to 0 in administration afterwards.
Login to your VCSA and navigate to Administration to find the password expiry details and change it to 0 days to never expire.
Thanks for you information, I know where to reset it or change expire rule.
But I am using the code(script) to upload file to VCSA with root account, so before I do upload action, I should check if the root account has expired or not? If it is expired, my code should popup message like "root account is expired, please reset or change it ". So my question is that if there is an API to get expire information or validate if root is expired?
i'm not sure about any API to check something like that. As far as I know, pyvmomi can be used to create users.
Please try to login to VCSA with your current root account, it tells whether it is expired or not.
"chage -l root" command will give you information related to password expiration