This forum is extremely buried so I'm not sure how active it is, but I've been scouring the vCLI reference guide trying to figure out a way to run vicfg-backup.pl with domain credentials. From my understanding I can use a session file or a config file to simply the login process. I have figured out the config file but not the session file, but I'm only able to use accounts local to the esx server. I'm assuming I need to first connect to the vCenter server then from there connect to an ESX server but I'm not sure. Whatever works is cool with me.
Any help would be appreciated.
-Gunnar
No session file does not store the credential. It only contains the session cookie and the session does timeout after awhile.
Okay I figured out the session file as well, heck that was easier than the config file and at least that gives you a way of storing a password without it being in clear text. Still would like to find a way to use domain credentials though.
Well I just learned that session files expire. I'm trying to back up my servers on as a scheduled task, my script looks like this:
"C:\Program Files (x86)\VMware\VMware vSphere CLI\bin\vicfg-cfgbackup.pl" --sessionfile C:\esx\esx01.session --save
server\Backups\ESX\ESX01-Backup
It worked great initially but on the second pass an hour later it failed with this error:
Error: The session is not authenticated.
I need a way to run this every day but don't like that the config file stores the password in clear text.
-Gunnar
You can use domain credentials if the vCLI is connecting through vCenter. Unfortunately, the vicfg-cfgbackup does not
support vCenter connection. Your other alternative is to run vCLI from vMA which you don't need to authenticate again.
Is there any way to have a session file remember it's credentials? I like that those files don't have the password in clear text, as oppposed to the .config file.
No session file does not store the credential. It only contains the session cookie and the session does timeout after awhile.
%$&@!!!!
Well thanks for in the info.
-Gunnar
what happens after the session file expires? A new one needs to be created again?