WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Resources
    • Nested Virtualization
  • VMware Nostalgia
  • Apple
You are here: Home / Uncategorized / esxcli Part1 - What is esxcli?

esxcli Part1 - What is esxcli?

06.16.2010 by William Lam // 9 Comments

esxcli is a new CLI (commandline interface) framework in vSphere that provides a modular architecture for various components called namespaces running in the VMkernel. Some of these namespaces are nmp (Native Multipathing Plugin) for the new VMware Pluggable Storage Architecture, corestorage for claim rules used for masking certain devices to a host, and swiscsi for managing iSCSI interface.

esxcli can be executed within the classic ESX Service Console, the unsupported Busybox console in ESXi or using the vCLI's remote version of esxcli. There are currently 3 namespaces (nmp,corestorage and swiscsi) with the current release of vSphere and we may see others introduced in future releases of vSphere. One important thing to note is that because these modules run within the host, using the vCLI's version of esxcli, you will need to authenticate to the host first to see what modules will be available for access. Currently, esxcli is not vCenter aware, meaning you must connect to a specific ESX or ESXi host when performing an operation.

Here is an example of esxcli executed without connecting to the host first:

Here is an example of esxcli being executed after connecting to the host:

When invoking the esxcli command, you may also notice an esxcli.log is generated. If the command is successfully executed, the log will generally be empty, but if there was an error you may want to take a look at esxcli.log if the command does not provide any output to the screen.

Here is an example of using an auth configuration file and because of the case sensitivity of esxcli, the VI_PROTOCOL entry is failing with HTTPS vs https:

[vi-admin@scofield ~]$ cat esxcli.log

[root CRITICAL] Exception:Unsupported protocol
[root CRITICAL] Traceback (most recent call last):
File "esxcli.py", line 387, in _GetStub
File "/vmware/esx40-dev/esx40/bora/vim/py/esxcli/Session.py", line 239, in stub
File "/vmware/esx40-dev/esx40/bora/vim/py/esxcli/Session.py", line 299, in Login
Exception: Unsupported protocol

There is not a whole lot of information available to the public about esxcli. From what I understand after talking to a few VMware engineers, esxcli has an API, but it is currently not exposed to the public for consumption. Not only is there an API, but 3rd party providers or users can potentially create their own modules and install it using the VIB format also known as vSphere Installation Bundle.

Some well known packages that are currently being distributed in the VIB format today are: Cisco Nexus 1000V VEM, HP Insight Manager Agent, EMC PowerPathV/E, Xsigo ESX IB drivers and VMware ESX/ESXi/vMA updates, to name a few. Hopefully in the future, VMware will expose the esxcli API functionality to the developer ecosystem.

Here are a few blog posts with detail examples on using esxcli with the various namespaces:

  • http://www.yellow-bricks.com/2009/03/18/iscsi-multipathing-with-esxcliexploring-the-next-version-of-esx/
  • http://www.yellow-bricks.com/2009/03/19/pluggable-storage-architecture-exploring-the-next-version-of-esxvcenter/
  • http://virtualgeek.typepad.com/virtual_geek/2009/09/a-multivendor-post-on-using-iscsi-with-vmware-vsphere.html
  • http://www.punchingclouds.com/?p=965

Stay tuned for Part2 and Part3 where we will look at automating esxcli operations using both the vSphere SDK for Perl and Windows PowerShell!

More from my site

  • esxcli Part3 - Automating esxcli using PowerShell
  • esxcli Part2 - Automating esxcli using vMA
  • Want to issue a VAAI UNMAP operation using the vSphere Web Client?
  • Quick Tip - ESXCLI CSV --format-param options
  • Quick Tip - Don't always assume your local HDs will be claimed correctly

Categories // Uncategorized Tags // ESX 4.0, esxcli, vSphere

Comments

  1. *protectedEd Grigson says

    03/05/2011 at 4:39 pm

    I'm having issues getting the RCLI version of esxcli working. Commands which work fine on the local host don't work via the RCLI- for example;

    esxcli corestorage (executed locally) returns prompts about the valid command lines

    esxcli corestorage --server labsvr4.lab.co.uk -username root (from vMA) returns 'connect to localhost failed'. It also doesn't seem to work with vifastpass authentication.

    Have you run into this at all?

    Reply
  2. *protectedEd Grigson says

    03/05/2011 at 4:45 pm

    Doh! Don't you hate it when a minute after you comment you work it out?

    I was using;
    esxcli corestorage --server

    when I should have been using;
    esxcli --server corestorage

    ...which works fine! Sometimes command line syntax is very unforgiving!

    Reply
  3. *protectedPandu says

    06/19/2016 at 7:53 am

    Thanks .. i have a task and looking for powercli script.. i need to disable smartd on esx 6.0 u2 host as it is causing esx to non responding state. need to execute below commands ..

    /etc/init.d/smartd stop
    chkconfig smartd off

    how can i integrate above command with power cli

    Reply

Trackbacks

  1. How to kill a stuck VM on ESX(i) 4.1 using esxcli | virtuallyGhetto says:
    03/03/2014 at 2:39 pm

    […] so many new features in vSphere 4.1, you might have not noticed the new additions to the esxcli utility. One new feature is the ability to remotely kill a stuck or hung virtual machine running on […]

    Reply
  2. PowerCLI Report Tip – Part 3 | Steven Kang says:
    02/07/2015 at 7:04 am

    […] What is esxcli by William Lam […]

    Reply
  3. Upgrade ESXi 6.5 Version using the Offline Bundle – VMscrub says:
    05/30/2017 at 8:10 pm

    […] esxcli command can manage various areas of an ESXi host with what they call namespaces which run in the VMkernel. Simply running the command yields these […]

    Reply
  4. 6 Esxcli Commands Every IT Pro Knows - EMPIST says:
    07/10/2019 at 9:53 am

    […] time to get technical. Now, esxcli is a newer command-line interface (CLI) for vSphere. As a CLI, it interacts with computer […]

    Reply
  5. EMPIST Tech Talk Weekly Newsletter: Monday, July 15, 2019 - EMPIST says:
    07/17/2019 at 10:15 am

    […] time to get technical. Now, esxcli is a newer command-line interface (CLI) for vSphere. As a CLI, it interacts with computer […]

    Reply
  6. Quick Tip - New remote version of ESXCLI 8.x says:
    09/08/2023 at 9:25 am

    […] or directly in the ESXi Console. However, a remote version of ESXCLI has been available since the introduction of ESXCLI back in vSphere 4.0, but surprisingly, I still come across users who never knew that this was […]

    Reply

Thanks for the comment!Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search

Thank Author

Author

William is Distinguished Platform Engineering Architect in the VMware Cloud Foundation (VCF) Division at Broadcom. His primary focus is helping customers and partners build, run and operate a modern Private Cloud using the VMware Cloud Foundation (VCF) platform.

Connect

  • Bluesky
  • Email
  • GitHub
  • LinkedIn
  • Mastodon
  • Reddit
  • RSS
  • Twitter
  • Vimeo

Recent

  • Programmatically accessing the Broadcom Compatibility Guide (BCG) 05/06/2025
  • Quick Tip - Validating Broadcom Download Token  05/01/2025
  • Supported chipsets for the USB Network Native Driver for ESXi Fling 04/23/2025
  • vCenter Identity Federation with Authelia 04/16/2025
  • vCenter Server Identity Federation with Kanidm 04/10/2025

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2025