VMware Cloud Community
shaunroth
Contributor
Contributor

DCLI +password parameter

I am unable to get DCLI commands to work using the +password parameter

As per documentation: https://vdc-download.vmware.com/vmwb-repository/dcr-public/78c8f1d2-c40b-48de-ae7d-173da817bc0e/ad45...

DCLI Options

You can run each DCLI command with connection or formatting options preceded by a + sign.For many of the options, you can instead use variables. See Using DCLI with Variables.dcli

[+vmc-server] 

[+nsx-server NSX_T_SERVER_ADDRESS] 

[+server SERVER_IP] 

[+interactive] 

[+prompt PROMPT] 

[+skip-server-verification] 

[+cacert-file CACERT_FILE] 

[+username USERNAME] 

[+password PASSWORD]

VMWare_DCLI._1png.png

When I use the +password parameter, the command is not supposed to ask me for the password. I need to be able to SSH into the vcenter server and issue commands and collect the output as part of a automated process. I'm unable to do so because the DCLI does not recognize the +password parameter.

Tags (3)
Reply
0 Kudos
4 Replies
Lalegre
Virtuoso
Virtuoso

Hey,

If you see on page 16 it shows you the way to store the credentials so you will only need to input them for the first time: https://vdc-download.vmware.com/vmwb-repository/dcr-public/78c8f1d2-c40b-48de-ae7d-173da817bc0e/ad45... I think this is the correct approach to follow and also to make it more secure.

However if you do not want to do this maybe you can try the same but adding double quote (") or single quote (') between the user and password.I say this because I can see that your user has the @ on it and that is treated as an special character in Linux.

Reply
0 Kudos
shaunroth
Contributor
Contributor

Hi Lalegre,

You make a great point about the @ sign. I went ahead and tested this and with putting the username in double quotes and then single quotes. I get the same behavior. It does not recognize the +password parameter still.

Adding the credentials also manually ask for password field

VMWare_DCLI_2.png

Reply
0 Kudos
Lalegre
Virtuoso
Virtuoso

Hey!

But wait I mean your screenshot shows you are trying to run only the credstore command which is okay if it asks for the password. Then after you put that password for the first time you should not get the prompt to add the password again.

Reply
0 Kudos
shaunroth
Contributor
Contributor

Hi Lalegre,

That's not the case. I still get prompted for the password. This solution is clearly not working as documented.

Reply
0 Kudos