Oh nooo esxcfg is gone!!!! Well welcome in esxcli but nothing is like it seems (not at all at least)

by alefesta

This morning Vmware released Esxi5 and immediately the vWorld  start to talk, try,discusse,post and everything else you could imagine related to vSphere.
One of the tweet I saw from  @XXX was about the fact that esxcfg was gone with vpshere5, the post was this:

“I’m quite disappointed esxcfg- comdlets are gone in #vSphere5 but i hear @alanrenouf has a great table to help the transition”

I simply jumped on my seat wondering if this was true or not, so went through the official documentation and found this:

“vSphere 5.0 introduces a new command-line interface (CLI). A challenge long faced by vSphere administrators has been the need to work with many different command-line tools, each with a unique syntax.
In addition, different commands were needed to manage a host locally versus remotely. vSphere 5.0 marks the beginning of efforts by VMware to standardize on a single CLI for both local and remote administration, as well as to help reduce the overall number of CLI tools.”

At least from what I read this only means that VMware decided to offer a single standard to the administrative cmd-lets, but not means necessarily removed (yet) the “old” tools. For another point of view on this look at this article by Duncan ”Thank You Lord he exist and post blog” Epping on Esxcli in vSphere5.
Now to answer, even if indirectly to the mr. XXX post, esxcfg is still alive and you may use it from local shell as from ssh session as well. Of course now you have to consider that the use of esxcfg- is deprecated and wherever is possible you should use esxcli.
Digging in the esxi 5 under the “/sbin” directory you may find all the old esxcfg commands that are:

esxcfg-advcfg
esxcfg-ipsec
esxcfg-resgrp
esxcfg-vswitch
esxcfg-dumppart
esxcfg-module
esxcfg-route
esxcfg-fcoe
esxcfg-mpath
esxcfg-scsidevs
esxcfg-hwiscsi
esxcfg-nas
esxcfg-swiscsi
esxcfg-info
esxcfg-nics
esxcfg-vmknic
esxcfg-init
esxcfg-rescan
esxcfg-volume

but in the same place you’ll find to the new esxcli as well, now I am not going to go through an extensive explanation of the escli new commands, I’m sure there will be plenty of bloggers/technicians that will cover the argument in a way I would never been able to but, just to make some examples:
Let see the old way to obtain information like ip address or nic infos (assuming you are working on a local shell or on a remote shell like ssh):

If I work with esxcfg I should write something like that :

esxcfg-vmknic –l

that would give me something like:

Interface  Port Group/DVPort   IP Family IP Address   Netmask         Broadcast       MAC Address       MTU     TSO MSS   Enabled Type
vmk0       Management Network  IPv4      8.0.0.201    255.255.255.0   8.0.0.255       00:0c:29:e6:ca:62 1500    65535     true    STATIC

Or if I need to be specific about the HW of the nic:

esxcfg-nics –l

and would have an output similar to this:

Name    PCI           Driver      Link Speed     Duplex MAC Address       MTU    Description
vmnic0  0000:02:01.00 e1000       Up   1000Mbps  Full   00:0c:29:e6:ca:62 1500   Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)

Now with the new esxcli I simply have to write:

esxcli network ip interface ipv4 get

to obtain a result similar to this:

Name  IPv4 Address  IPv4 Netmask   IPv4 Broadcast  Address Type  DHCP DNS
—-  ————  ————-  ————–  ————  ——–
vmk0   8.0.0.201     255.255.255.0  8.0.0.255        STATIC            false

or

esxcli network ip interface list

and obtain something similar to this:

vmk0
Name: vmk0
MAC Address: 00:0c:29:e6:ca:62
Enabled: true
Portset: vSwitch0
Portgroup: Management Network
VDS Name: N/A
VDS Port: N/A
VDS Connection: -1
MTU: 1500
TSO MSS: 65535
Port ID: 16777219

quite simple and more powerful uh?

so eager to know more about esxcli? take a look at this great article from William Lam (again thanks to Duncan Epping for the link in his article).

for those who isntead like more the “official” documenation here’s the link (thanks to @GreggRobertson5 for the suggestion)