VMware Cloud Community
CesarTabares
Enthusiast
Enthusiast

Command line interfaces

Can someone explain to me what the different command line interfaces are, and which ones are the most likely I will have to learn in the future? Seems that there are four or five ways to manage things in a company vSphere environment, PowerCLI and the Web Client being the only ones I have played around with so far.

vCLI, ESXi Shell, ESXCLI and so on are names I have seen, but I am not sure about the differences. I'm just a bit confused

Some of them connect to one single host, others can be used on different hosts at the same time?

vCLI is more wide in use than ESXi Shell, but both include ESXCLI commands?

Reply
0 Kudos
7 Replies
vHaridas
Expert
Expert

Web client and PowerCLI are the preferred and easy methods to manage vSphere environment.

Also ESXCLI is also useful for troubleshooting, so get familiar with esxcli command name space.

ESXTOP command is also useful for troubleshooting.

Please consider awarding points for "Correct" or "Helpful" replies. Thanks....!!! https://vprhlabs.blogspot.in/
CesarTabares
Enthusiast
Enthusiast

Looks like vCLI consists of multiple old, deprecated and new commands to manage many things, not only hosts and virtual machines.

It includes ESXCLI apparently and other commands for management. It's very confusing, what to use when...

From where should I run the vCLI commands? The vCenter server?

Can it be used to rename VM files, or change VM properties and other basic VM related tasks?

I am just trying to get to know where to do what when I cannot use the Web Client or PowerCLI

But I read PoweCLI can be used to run ESXCLI commands as well, but I only see a Get-ESXCli, so I don't understand what I can use it for

Reply
0 Kudos
vHaridas
Expert
Expert

You need to use vCLI commands and esxcli commands only for troubleshooting purpose when something is really not working in web client and PowerCLI.

PowerCLI is the best command line tool to automate everything in vSphere management.

While executing vCLI and esxcli from windows you need to provide esxi or vCenter name/ip and username / password and provide action which you want to take.

e.g.

esxcli --server <server> - -username “snow-white” - -password “dwarf$” network ip interface list

vicfg-mpath.pl - -server <server> - -username “snow-white” - -password “dwarf$” --list

To run esxcli using PowerCLI, you need to first connect to vCenter or esxi Host using PowerCLI then run below command to get esxcli command name space.

>connect-viserver your-vc-server

>$esxcli = get-VMHost esxHostname | get-esxcli

Then you can you can run all esxcli commands with $esxcli variable.

e.g.

>$esxcli.network.nic.list()

See this post for more information -

Howto use ESXCLI in PowerCLI | Virten.net

Get more familiar with web client and PowerCLI, and esxcli, vCLI are more useful for troubleshooting.

Thanks,

Haridas

Virtual Admin

Please consider awarding points for "Correct" or "Helpful" replies. Thanks....!!! https://vprhlabs.blogspot.in/
CesarTabares
Enthusiast
Enthusiast

From where do I have to use vCLI and ESXCLI? Does it have to be installed on a dedicated server or something? I'm asking because on a host I saw ESXCLI commands available, but tried a few VICFG-xxxxx commands, but they were not found

Also I'd like to know if any of the commands can be used to change VM config files, hard disk file names and those sort of things, that are very VM specific tasks

Reply
0 Kudos
vHaridas
Expert
Expert

vicfg* commands are deprecated, get familiar with esxcli only.

vSphere Documentation Center

ESXi 5.0 Command Line Part 1 – Introduction to the new ESXCLI - VMware vSphere Blog - VMware Blogs

Note, these commands are meant for troubleshooting and provides very limited functionality which is needed for management at core level.

for Day to day Administration and management, you need only web client and PowerCLI.

Please consider awarding points for "Correct" or "Helpful" replies. Thanks....!!! https://vprhlabs.blogspot.in/
CesarTabares
Enthusiast
Enthusiast

OK, thanks, I'll focus on ESXCLI from now on (we run version 6 on our hosts), and PowerCLI and the Web client of course. Seems that other tools/commands are being phased out. Correct me if I'm wrong.

Any last tools, except for ESXCLI, I should know about for troubleshooting, that I would need locally on each host? I'm thinking about looking at datastore or VM configurations available on each host. The operating system is linux based I see, so maybe just general Linux knowledge?

Reply
0 Kudos
Dee006
Hot Shot
Hot Shot

VMWare has provided CLi based utility which makes life easier for Vmware admins.

esxcli:

low level of controls inside the hypervisor

vMA(VMware Management Assistance)

It is command like interface which help you to execute the esxcli command and other customized perl commands from remote execution from the appliance insist of ssh the host.

Powershell

If you like powershell to be you scripting base,then go ahead with Powercli.Which VMware provided community based management tool.

MOB(api based):

Managed Object id,If you are good in an scripting,You can control your datacenter provision/decommission and lot more using the MOID based scripting.