Getting to know ESXCLI commands and how to use

I will open this up by saying I come from a Windows background so my use for the command line has always been low. I can fumble my way around but since I no longer use it everyday my skills are somewhat rusty. My coworker and fellow blogger at the Wahlnetwork probably is laughing about my 20 years in IT and thinks the guy in the image below is me.

So on to the serious stuff, if you are needing learn more on the ESXCLI commands for your daily work, just for fun or maybe you are studying for the VCAP-DCA exam then hopefully I can point you in the right direction. First thing I would say is remove any fear that you might have about the big bad command line, its not that scary. The best way to learn and eventually mast this is to start forcing yourself to work in it on a daily basis. I’m going to assume that you know how to access the command line or ESXi shell already if not have a read of how to become a Shell Ninja to get you started.

How to find ESXCLI commands

The first thing your thinking is geez how to do I find the command that I need to use? Well you can look them up in the VMware documentation here or you can use the command line (CLI) to figure them out. First thing is you can simply type the following command in and ESXCLI will spit out what the possible variables are.

# esxcli

It will then show you help on the possible options that the command offers. I am working on ESXi 5.0U1 for this post and as of now these are the options for the command. It seems like VMware will continue to build more functions and roll in the old esx commands. But right now you can configure the following main areas with the ESXCLI command.

  • FCOE
  • Hardware
  • Network
  • Storage
  • VMs
  • iSCSI
  • Software
  • System

About Brian Suhr

Brian is a VCDX5-DCV and a Solutions Architect for a VMware partner and owner of this website. He is active in the VMware community and helps lead the Chicago VMUG group. Specializing in VDI and Cloud project designs. Awarded VMware vExpert status for 2014, 2013, 2012 & 2011. VCP3, VCP5, VCP5-Iaas, VCP-Cloud, VCAP-DTD, VCAP5-DCD, VCAP5-DCA, VCA-DT, VCP5-DT, Cisco UCS Design

Read More

Installing network card drivers in VMware ESXi after install with vihostupdate

This is not something that I’ve had to do very often. But  on a recent customer engagement I was working with the client on setting up some new hosts that were recently purchased. These hosts were purchased with Embedded ESXi on them and additional PCI NICs were added to the config. The additional NICs did not have drivers available in the base ESXi build. Shortly after bringing the first host online we noticed that only the onboard NICs showed up in the list.

A quick search on Google for the Intel part number for the NIC lead me to the family name for the adapter. Then a search over at VMware lead me to the download page for VMware that provided the .ISO file to load the drivers into ESXi for the family of adapters. The process took only a few minutes and since this is something that does not come up that often I thought a short write up might help someone.

There are a few ways that this could be done, since we happened to be running ESXi the options were to use the vMA or vCLI. Since this was a new install and a vMA was not setup yet I just quickly tossed vCLI on a server. Then a quick download of the driver .ISO from VMware and unzip the package into a folder on the server with vCLI installed on it. If you wanted to use the vMA you could mount the .ISO to the virtual CD-ROM of the VM and issue the command against it.

Since I was using vCLI all I needed to do was point the command to a local folder. Here is a sample of the command used to perform the patch.

vihostupdate –server HOSTNAME –install –bundle c:foldername_of_file.zip

To run this command your host must be in Maintenance mode and it will then take just a couple of minutes to execute. After the update completes a reboot of the host is needed and then the cards should be available for use.

About Brian Suhr

Brian is a VCDX5-DCV and a Solutions Architect for a VMware partner and owner of this website. He is active in the VMware community and helps lead the Chicago VMUG group. Specializing in VDI and Cloud project designs. Awarded VMware vExpert status for 2014, 2013, 2012 & 2011. VCP3, VCP5, VCP5-Iaas, VCP-Cloud, VCAP-DTD, VCAP5-DCD, VCAP5-DCA, VCA-DT, VCP5-DT, Cisco UCS Design

Read More

Some cool new features in vSphere Command Line Interface CLI 4.1

Now that vSphere 4.1 has been out for a couple of weeks you’ve probably had some time to play with it in a lab. I’m sure you have also spent some time reading the release notes getting up to speed on the large list of new features that were released. After spending time myself getting familiar with many of the new options I wanted to dig in and see what was new with the Command Line Interface in 4.1. Since this is going to play a big part in how you will be managing ESXi hosts once you move your environment over to the platform of the future.

I have grabbed a list of the new commands added to vCLI 4.1, these command will help narrow the gap that had existed between what you could run on the ESX console (COS) and what you could do via the vCLI with an ESXi host. Notice the part at the end where it lists some of the commands that cannot be executed against a vCenter server for a host in lock down mode.

  • vicfg-hostops – Allows you to examine, stop, and reboot hosts and to instruct hosts to enter and exit maintenance mode.
  • vicfg-authconfig – Allows you to add an ESX/ESXi host to an Active Directory domain, remove the host, and list Active Directory domain information.
  • vicfg-ipsec – Supports IPsec setup.

vSphere CLI 4.1 also includes the following new functionality:

  • The following options have been added to esxcli:
    • esxcli swiscsi session – Manage iSCSI sessions.
    • esxcli swiscsi nic – Manage iSCSI network interfaces.
    • esxcli swiscsi vmknic – List VMkernel network interfaces available for binding to particular iSCSI adapter.
    • esxcli swiscsi vmnic – List available uplink adapters for use with a specified iSCSI adapter.
    • esxcli vaai device – Display information about devices claimed by the VMware VAAI (vStorage APIs for Array Integration) Filter Plugin.
    • esxcli corestorage – List devices or plugins. Used in conjunction with hardware acceleration.
    • esxcli network – List active connections or list active ARP table entries.
    • esxcli vms – List and forcibly stop virtual machines that do not respond to normal stop operations.
  • Some of the parity issues between vSphere CLI and the ESX service console have been resolved.
  • You can now run vCLI commands using SSPI (--passthroughauth) against both vCenter Server and ESX/ESXi systems.
  • Lockdown mode allows vSphere administrators to block direct access to ESXi systems. With lockdown mode enabled, all operations must go through a vCenter Server system. The following commands cannot run against vCenter Server systems and can therefore not be used in lockdown mode:
    • vicfg-snmp
    • vifs
    • vicfg-user
    • vicfg-cfgbackup
    • vihostupdate
    • vmkfstools
    • esxcli
    • vicfg-ipsec
  • If you want to run these commands against an ESXi system, turn off lockdown mode using the vSphere Client.

About Brian Suhr

Brian is a VCDX5-DCV and a Solutions Architect for a VMware partner and owner of this website. He is active in the VMware community and helps lead the Chicago VMUG group. Specializing in VDI and Cloud project designs. Awarded VMware vExpert status for 2014, 2013, 2012 & 2011. VCP3, VCP5, VCP5-Iaas, VCP-Cloud, VCAP-DTD, VCAP5-DCD, VCAP5-DCA, VCA-DT, VCP5-DT, Cisco UCS Design

Read More
%d bloggers like this: