how to use govc for scheduled tasks (credentials, session lifetime etc)? #3448
Unanswered
ralfgro
asked this question in
Community Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm at the beginning of understanding govc and it looks like a valid alternative to powercli. I'm able to login with AD credentials to my vCenter with something like "GOVC_PASSWORD=$pw govc session.login" in my govc login shell script. After that I'm not asked for credentials anymore, even after logout of the linux I created the session. I know I can use session.logout to make sure session is terminated.
My issue is the other way around. My main used case would be to use govc in a script as alternative to powercli for scheduled tasks like shutting down all VMs/hosts at a location at date xyz. Needless to say that I don't want to put a password in any file for that.
Even with extraordinary efforts in googling I did not find many examples for this use case (0 to be precise). What is the best approach for this? I see some general examples in https://github.com/vmware/govmomi/blob/main/govc/USAGE.md for session.login but I think I'm missing the context or understanding. What is the lifetime of such a session, why would I need to clone a ticket?
Beta Was this translation helpful? Give feedback.
All reactions