As any virtualization administrator knows, handling VMware infrastructure and ESXCLI commands requires greater automation of critical virtualization management tasks.
While VMware ESX hosts can manage the graphical user interface of the vSphere client, data center administrators often prefer to log in to the VMware service console and use the ESX command line to resolve issues such as network configuration or re to configure a host.
The ESXCLI command list provides several namespaces that you can run to get information about ESXi and configure the entire ESXCLI system.
And several VMware commands help automate such tasks, identify virtualization infrastructure problems, adjust the performance of your virtual machines (VMs), and more.
What is ESXCLI?
Currently, ESXCLI is a newer command-line interface (CLI) for vSphere. As a CLI, it communicates with computer programs using lines of text. For a user or client, these lines of text will be sent to computer programs to make changes through your IT provider. Therefore, it is called the “command line”.
It would be best if you used the command-line interface (CLI); it is possible to configure all the settings, including those hidden in the command line, which is also called the console. In addition to the traditional commands that are the same on Linux and ESXi, ESXi has its ESXCLI commands.
VMware’s vCenter Server has long been a central control point for ESXi environments. While there is a significant advantage to directing changes and modifications through the vCenter Server, there comes a time in the occupation of any VMware administrator when vCenter is unavailable.
Connecting directly with a host to the vSphere client can help in the absence of vCenter, but there are numerous things you can not do with this method. ESXi command-line interface is able to perform core storage commands of the ESXCLI system hostname that can enable ESXi Shell commands.
The structure of ESXCLI provides a modular framework for multiple components known as namespaces. Most of these namespaces are split between Native Multipathing Plugins, core storage for masking host devices, and managing ESXi servers and other interfaces.
Now that we have a broad definition of ESXCLI, it’s time to go through some of the top 10 ESXCLI commands used by IT professionals:
1. ESXCLI network
ESXCLI’s network namespace is extremely valuable when tracking and making changes to everything related to vSphere networking, including virtual switches, VMKernel network interfaces, firewalls, and physical network interface (NIC) cards.
esxcli network nic – index and adjust NIC information, such as name, speeds, and wake on LAN.
esxcli network vm list – it lists networking information regarding your virtual machines that have an operational network port.
esxcli network vswitch – Commands to recover and manage options on VMware’s standard and distributed virtual switches.
esxcli network ip – Commands to handle VMkernel ports, including management, vMotion, and Fault Tolerance networks. It also includes modifying any IP stacks regarding the host, including DNS, IPsec, and routing information.
2. ESXCLI storage
The storage namespace lets you check and rework storage settings.
esxcli storage vmfs extent list
Here is how to view mappings of VMFS file systems to disk devices:
esxcli storage filesystem list
Document all the iSCSI paths on the system:
esxcli storage core path list
3. ESXCLI hardware
ESXCLI Hardware namespace can prove extremely useful when looking for information on current hardware and setting up your ESXi host.
esxcli hardware cpu list – recover CPU information
esxcli hardware memory get – recover information about memory
4. ESXCLI software
The software namespace can be used to download and install various pieces of software and drivers on your ESXi host.
esxcli software vib list – it lists the software and drivers currently installed on the ESXi host
5. ESXCLI iSCSI
iSCSI is a widely utilized protocol for accessing shared block-level storage, and there is a separate iSCSI namespace in ESXCLI for managing iSCSI repositories.
Here’s how to show the list of available iSCSI adapters:
esxcli iscsi adapter list
Here’s how to re-discover and re-scan iSCSI adapters:
esxcli iscsi adapter discovery rediscover -A adapter_name
esxcli storage core adapter rescan -A adapter_name
Rather than of -A adapter_name you can rescan all adapters by using the –all option.
6. ESXCLI VM
The ESXi VM’s namespace can be used to list various VM-operated VM information and forcibly shut down if necessary.
esxcli vm process list – list out process information for powered on VMs.
esxcli vm process kill – terminate running virtual machine technique, essentially shutting down or forcibly powering off a VM.
7. ESXCLI system
This command delivers you the ability to handle ESXi advanced options, such as setting up Syslog and supervising host status.
esxcli system maintenanceMode set –enabled yes/no – set the host into maintenance mode.
esxcli system settings advanced – view and change ESXi advanced settings.
esxcli system syslog – Syslog information and configuration.
8. ESXCLI vSAN
The ESXi vSAN namespace contains a ton of commands for setting up and maintaining vSANs, including data storage, networking, domain failure, and policy configuration.
esxcli vsan storage – commands for configuring local storage for use with VSAN, including adding and removing physical disks and modifying auto claim.
esxcli vsan cluster – commands to leave/join VSAN clusters on the local host.
9. ESXCLI ESXCLI
Yes, the ESXCLI command has a namespace called “ESXCLI”. Using the ESXCLI namespace, you can get additional information about any or all of the commands in the ESXCLI tool.
esxcli esxcli command list – list every esxcli command on the system and the functions it provides.
10. Creating a new user
You are able to add a new user just with the one command by using ESXCLI:
esxcli system account add -d=”VMware-ESXi user” -i=”vmware-esxi” -p=”Password-ESXi123″ -c=”Password-ESXi123″
- d indicates the displayed description
- p indicates the password set for the new user
- c indicates the password confirmation
The ESXCLI command suite lets you execute shared system administration commands against vSphere systems from an administrative server of your choice. So, in this post, you have already read about the top ESXCLI commands used in an IT pro’s mundane schedule, and more is on the table relating to VMware ESXi.