ESXcli Part II : Commands

Share on facebook
Share on google
Share on twitter
Share on linkedin
Share on pinterest
Share on print
Share on email
Table of Contents

introduction

previous article we have got an overview about ESXcli command 

this article we will discuss some basic ESXcli command 

 

System ESXcli commands

esxcli system version get

 Returns the ESXi build and version numbers.

For Better View > Open Image in different TAB
esxcli system hostname get

 Returns the hostname, domain and FQDN for the host

For Better View > Open Image in different TAB
esxcli system stats installtime get

 Returns the date and time of when ESXi was installed.

For Better View > Open Image in different TAB
esxcli system account list

 Lists the local users created on the ESXi host.

For Better View > Open Image in different TAB
esxcli system account add -d=pioneers_admin -i=admin -p=P@ssw0rd -c=P@ssw0rd

 This command allows you to create local ESXi users. All the parameters used in the example are mandatory.

For Better View > Open Image in different TAB
esxcli system maintenanceMode set –e rue

 Use this command to put ESXi in maintenance mode or take it out.

For Better View > Open Image in different TAB
esxcli system shutdown reboot -d 10 -r “Patch Updates”

 Use this command to reboot or shutdown ESXi. The -d parameter is a countdown timer; minimum 10 seconds. ESXi must be in maintenance mode before you can use the command

For Better View > Open Image in different TAB

network ESXcli commands

esxcli network ip interface ipv4 get

Displays the IPv4 configuration for all the interfaces present on ESXi

For Better View > Open Image in different TAB

firewall ESXcli commands

esxcli network firewall get

Returns the status of the ESXi firewall

For Better View > Open Image in different TAB
esxcli network firewall set -–enabled true | false

 

 Use this command to disable the ESXi firewall for troubleshooting purposes. Note that disabling the firewall on ESXi is highly discouraged.

For Better View > Open Image in different TAB

software ESXcli commands

esxcli software vib list

Lists all the currently installed VIBs on ESXi. A VIB is a file packaging format used to distribute software on ESXi.

For Better View > Open Image in different TAB
esxcli software vib update -d “/tmp/update.zip”

 

Use this command to update an installed VIB on ESXi. Note that the command does not install any new software. Instead it only updates what’s currently installed. Use esxcli software vib install instead when installing new software. The -d parameter specifies the full path to the package being used for the update. As per the next screenshot, I specified a non-existing patch hence the error message

For Better View > Open Image in different TAB

VM ESXcli commands

esxcli vm process list

Lists all the running VMs on the hosts. The World ID can be used with other commands to carry out various tasks related to VMs.

For Better View > Open Image in different TAB
esxcli vm process kill -w 2148928-t soft

 Use this command to kill a running VM such as one that fails to respond to commands.

You must first retrieve the VM’s World ID (see command above ) and pass it on using the -w parameter.  

For Better View > Open Image in different TAB
For Better View > Open Image in different TAB

storage ESXcli commands

esxcli storage vmfs extent list

The command generates a list of extents for each volume as well as the corresponding device name to UUID mapping

For Better View > Open Image in different TAB
esxcli storage filesystem list

The command lists of all the volumes or datastores accessible by the ESXi host. The output includes the file system type, disk info along with the volume name, path and UUID.

You must first retrieve the VM’s World ID (see command above ) and pass it on using the -w parameter.  

For Better View > Open Image in different TAB

ISCSI ESXcli commands

esxcli iscsi software get

this command verifies that the iSCSI adapter is enabled.

For Better View > Open Image in different TAB
esxcli iscsi software set –enabled true

The command enables the iSCSI software adapter

For Better View > Open Image in different TAB
 esxcli iscsi adapter param get -A vmhba65

The command returns metrics for the iSCSI adapter.

which is vmhba65  for ESXI 6.7  

For Better View > Open Image in different TAB

conclusion

esxcli is a  CLI (command line interface) framework in vSphere that provides a modular architecture for various components called namespaces running in the VMkernel.

in network pioneers we believe that more practicing on CLI  [Command Line Interface ] will give administrator more power to fully control vSphere Environment 

 

Share this post
Share on facebook
Share on google
Share on twitter
Share on linkedin
Share on pinterest
Share on print
Share on email

About Me

Our Power in Numbers

 17 

Courses

321

Articles

3,882

Images
and All configurations images are proudly made in Pioneers Lab

Articles By Course

Recent Articles

Subscribe

Contact us

have a challenge ? don’t hesitate to contact us