VMware vCLI Instructions
The vSphere Command-Line Interface (vSphere CLI) command set allows you to run common system administration commands against ESX/ESXi systems from any machine with network access to those systems. You can also run most vSphere CLI commands against a vCenter Server system and target any ESX/ESXi system that vCenter Server system manages. vSphere CLI includes the ESXCLI command set, vicfg- commands, and some other commands.
- Download and Install vCLI
- Right click on the vCLI icon and select Run as Administrator
- Navigate to c:\Program Files (x86)\VMware\VMware vSphere CLI\bin
- You will see the below vCLI commands (Note the .pl extension on the end)
- An example of running a command would be as per below with vifs.pl
- Type vifs.pl –help to see the associated switches for this command
- Try typing vifs.pl –server esxihostserver –listdc
- Another example of this command as per below screenprints shows how you can create a folder on a Datstore
- vifs.pl –server esxiserver –mkdir “[Datastore] test”
Running Commands on Windows.
In order to stop having to put in credentials everytime you run a command you can can the following
save_session.pl –server esxiserver01 –username usera –password passswordxyz –savesessionfile c:\temp\vclisessionfile
The next time you run a command you can type the following
esxcli –server MyESXiHost –sessionfile c:\temp\vclisessionfile storage core filesystem list