ESXCLI COmmands

common ESXi CLI commands
As  VMware Consultant we can all manage the vSphere client GUI, but sometimes you have to troubleshoot  to fix things. ESXi operating system consists of the VMkernel and distributed VM filesystem. The VMware vSphere command-line interface (CLI) is the pane of glass used to control the ESXi shell

 Check the ESXi hostname:
#esxcli system hostname get

Check the version of ESXi installed on the host:
#esxcli system version get

Check the ESXi installation time:
#esxcli system stats installtime get 

View installed PCI devices
# esxcli hardware pci list | more

Check the amount of memory installed
#esxcli hardware memory get

Information about installed processors
#esxcli hardware cpu list
 
Check the SNMP configuration:
#esxcli system snmp get 

Get currently status of the host
#esxcli system maintenanceMode get
 
Put host in maintenance mode:
#esxcli system maintenanceMode set --enable y
 
Exit maintenance mode:
#esxcli system maintenanceMode set --enable no

 Shutdown the host:
#esxcli system shutdown poweroff

Restart the host:
#esxcli system shutdown reboot
 
Set a delay and write a reason of rebooting the host to be saved in system logs
#esxcli system shutdown reboot -d 60 -r “Installing patches”     

Restart ESXi management agents ( ESXi host daemon service) #/etc/init.d/hostd restart          
 
Restart ESXi management agents (vCenter Agent service) :
#/etc/init.d/vpxa restart
 
Restart all management agents on ESXi :
#services.sh restart
 
Storage commands

List all mappings of VMFS flie system to disks:
#esxcli storage vmfs extent list
 
List all storage devices attached to the host:
#esxcli storage core devices list
 
View mappings of VMFS file systems to disk devices:
#esxcli storage filesystem list
 
List all the iSCSI paths on the system:
#esxcli storage core path list

Display the list of mounted NFS shares:
#esxcli storage nfs list

Locate the unique device name (see the screenshot below):
#esxcli storage core device list

Command to get the S.M.A.R.T. data of that disk device:
#esxcli storage core device smart get -d naa.50026b7267020435


Show the list of available iSCSI adapters:
#esxcli iscsi adapter list
 
Re-discover and re-scan iSCSI adapters:
#esxcli iscsi adapter discovery rediscover -A adapter_name
#esxcli storage core adapter rescan -A adapter_name
 
Instead of -A adapter_name you can rescan all adapters by using the --all option

Network commands
 
List a#esxcli network nic down -n vmnic0
#esxcli network nic up -n vmnic0
 
View the domain search settings:
#esxcli network ip dns search list

Add a DNS search domain     
#esxcli network ip dns search add -d test.com
 
Remove a DNS search domain         
#esxcli network ip dns search remove -d test.com
 
Add a DNS server IP address
esxcli network ip dns server add -s 100.171.204.4
 
Remove a DNS server IP address   
esxcli network ip dns server remove -s 100.171.204.4
 
View the DNS servers set in the network settings:
#esxcli network ip dns server list

List virtual switches and port groups:
#esxcli network vswitch standard list

 Show statistics for the vmnic0 network interface:
#esxcli network nic stats get -n vmnic0
 
Check the firewall status and rule settings:
#esxcli network firewall get
#esxcli network firewall ruleset list         
 
Commands to change the hostname

#esxcli system hostname set --host=hostname
#esxcli system hostname set --fqdn=fqdn

List local users on ESXi host
#esxcli system account list
 
Create local ESXi user
#esxcli system account add -d="Description" -i="username" -p="password" -c="password"

Test
List available commands with descriptions
#esxcli command getdetails

List all available namespaces with corresponding commands
#esxcli esxcli command list
 
Check the list of running VMs on the host (displays with VM ID):
#esxcli vm process list
 
Perform a soft shutdown a VM using the VM ID (identified from the previous command):
#esxcli vm process kill -w 1234 -t soft
 
#Perforrm a hard shutdown a VM using the VM ID:
#esxcli vm process kill -w 1234 -t hard

Note: The default firewall policy is to drop traffic if the opposite rules are not set.

Disable the firewall on an ESXi host for troubleshooting:
#esxcli network firewall set --enabled false

The firewall must be enabled with the command:
# network firewall set --enabled true
It is recommended to have the ESXi firewall enabled for security reasons
The network namespace includes many commands. Only basic and the most popular of them are considered in the Network section of today’s blog post. It is possible to configure a high number of network parameters with esxcli, but would require a long walkthrough that is out of scope for today’s article. 
 
VIB installation commands
 
List all VIB packages installed on the host:
#esxcli software vib list

List all VIB packages from a specific vendor:
#esxcli software vib list | grep vendor_name
 
Install a VIB package from VMFS volume:
#esxcli software vib install -d "/vmfs/volumes/datastore/directoryname/patchname.zip"

Process commands
Check the list of running VMs on the host (displays with VM ID):
#esxcli vm process list

Perform a soft shutdown a VM using the VM ID
#esxcli vm process kill -w 1234 -t soft
 
Perform a hard shutdown a VM using the VM ID:
#esxcli vm process kill -w 1234 -t hard
 
The basic command to control the virtual machines is
#vim-cmd vmsvc
 
To list all virtual machines run
#vim-cmd vmsvc/getallvms
 
To get a summary of the machine run (where <ID> is a number)
 #vim-cmd vmsvc/get.summary <ID>

To power on/power off/suspend a VM ru
vim-cmd vmsvc/power.on <ID>
vim-cmd vmsvc/power.off <ID>
vim-cmd vmsvc/power.suspend <ID>
Stop VM via esxcliPermalink

Use this to forcibly stop a virtual machine.
 
List all running virtual machines on the system to see the World ID of the virtual machine that you want to stop.
#esxcli vm process list

Stop the virtual machine by running the following command.
#esxcli vm process kill --type <kill_type> --world-id <ID

Autostart of VMPermalink
Get a list of virtual machine IDs:
#vim-cmd vmsvc/getallvms

Enable force autostart feature:          
#vim-cmd hostsvc/autostartmanager/enable_autostart true

Now check the VMs startup settings:
#vim-cmd hostsvc/autostartmanager/get_autostartseq

.Uplink of vSwitchPermalink
Debug/ diagnostic commands

Check and troubleshoot ESXi performance with ESXTOP:

 ESXTOP output refreshes every 5 seconds, to change the view use the following keys:

•        c – cpu
•        d – disk adaptor
•        i – interrupts
•        m – memory
•        n – network
•        p – power management
•        v – disk VM
Open the ESXi DCUI from the console via ssh
#dcui

Convert a thick provisioned virtual disk to a thin provisioned virtual disk by using vmkfstools:
#vmkfstools -i /vmfs/volumes/vmfs_datastore/vm_name/thick_disk.vmdk -d thin /vmfs/volumes/vmfs_datastore/vm_name/new_thin_disk_name.vmdk
 
Open the interactive VMware console:
#Vsish
 
Show loaded vmkernel drivers:
#vmkload_mod –list
 
Check the settings of the swap partition:
#esxcli sched swap system get
 
You can list users by using one of the following commands:
#esxcli systemccount list
cat /etc/passwd or less/etc/passwd
 
ESXCLI is a part of the ESXi shell, this is a CLI framework intended to manage a virtual infrastructure (ESXi components such as hardware, network, storage, etc.) and control ESXi itself on the low level. All ESXCLI commands must be run in the ESXi shell (console). Generally, ESXCLI is the command that has a wide list of subcommands called namespaces and their options. The ESXCLI command is present right after ESXi installation along with other ESXi shell commands. You can locate ESXCLI and explore the nature of ESXCLI after executing the following commands:

#which esxcli
#ls -l /sbin/esxcli      

List of available ESXCLI commands depends on the ESXi version.
Hence, the list of top ESXCLI namespaces for ESXi 6.7 is as follows:
·        device – device manager commands
·        esxcli – commands related to ESXCLI itself
·        fcoe – Fibre Channel over Ethernet commands
·        graphics – VMware graphics commands
·        hardware – commands for checking hardware properties and configuring hardware
·        iscsi – VMware iSCSI commands
·        network – this namespace includes a wide range of commands for managing general host network settings (such as the IP address, DNS settings of an ESXi host, firewall) and virtual networking components such as vSwitch, portgroups etc.
·        nvme – managing extensions for VMware NVMe driver
·        rdma – commands for managing the remote direct memory access protocol stack
·        sched – commands used for configuring scheduling and VMkernel system propertierty
·        software – managing ESXi software images and packages for ESXi
·        storage – commands used to manage storage
·        system – commands for configuring VMkernel system properties, the kernel core system and system services
·        vm – some commands that can be used to control virtual machine operations
·        vsan – VMware vSAN commands
The main commands appear as verbs indicating the same action
·        list – show the list of objects available for the defined namespace (for example, esxcli hardware bootdevice list – list available boot devices)
·        get – get the value of the defined setting or property (for instance, esxcli hardware clock get – check the time set)
·        set – set the necessary parameter manually (for example, esxcli hardware clock set -y 2019 -s 00 – set the year to 2019 and set the seconds to 00)
·        load/unload – load/unload system configuration (esxcli network firewall load – load the firewall module and firewall settings stored in the configuration file)


               esxcli network Commands
CommandDescriptionOptions Help
network diag pingSend ICMP echo requests to network hosts.
--count | -c
Specify the number of packets to send.
--debug | -D
VMKPing debug mode.
--df | -d
Set DF bit on IPv4 packets.
--host | -H
Specify the host to send packets to. This parameter is required when not executing ping in debug mode (-D)
--interface | -I
Specify the outgoing interface.
--interval | -i
Set the interval for sending packets in seconds.
--ipv4
Ping with ICMPv4 echo requests.
--ipv6
Ping with ICMPv6 echo requests.
--netstack
Specify the TCP/IP netstack which the interface resides on
--nexthop | -N
Override the system's default route selection, in dotted quad notation. (IPv4 only. Requires interface option)
--size | -s
Set the payload size of the packets to send.
--ttl | -t
Set IPv4 Time To Live or IPv6 Hop Limit
--wait | -W
Set the timeout to wait if no responses are received in seconds.
--help
Show the help message.
network firewall getGet the firewall status.
--help
Show the help message.
network firewall loadLoad firewall module and rulesets configuration.
--help
Show the help message.
network firewall refreshLoad ruleset configuration for firewall.
--help
Show the help message.
network firewall setSet firewall enabled status and default action.
--default-action | -d
Set to true to set defaultaction PASS, set to false to DROP.
--enabled | -e
Set to true to enable the firewall, set to false to disable the firewall.
--help
Show the help message.
network firewall unloadAllow unload firewall module.
--help
Show the help message.
network firewall ruleset listList the rulesets in firewall.
--ruleset-id | -r
List configuration for specfic ruleset
--help
Show the help message.
network firewall ruleset setSet firewall ruleset status (allowedAll flag and enabled status).
--allowed-all | -a
Set to true to allowed all ip, set to false to use allowed ip list.
--enabled | -e
Set to true to enable ruleset, set to false to disable it.
--ruleset-id | -r
The label of the ruleset. (required)
--help
Show the help message.
network firewall ruleset allowedip addAdd allowed ip address/range to the ruleset ruleset.
--ip-address | -i
Allowed ip address/range for the ruleset. (required)
--ruleset-id | -r
The label of the ruleset. (required)
--help
Show the help message.
network firewall ruleset allowedip listlist allowed ip addresses for rulesets.
--ruleset-id | -r
The label of the ruleset.
--help
Show the help message.
network firewall ruleset allowedip removeRemove allowed ip address/range from the ruleset.
--ip-address | -i
Allowed ip address/range for the ruleset. (required)
--ruleset-id | -r
The label of the ruleset. (required)
--help
Show the help message.
network firewall ruleset rule listList the rules of each ruleset in firewall.
--ruleset-id | -r
List rules for specfic ruleset
--help
Show the help message.
network ip getGet global IP settings
--help
Show the help message.
network ip setUpdate global IP settings
--ipv6-enabled | -e
Enable or disable IPv6 (Reboot Required)
--help
Show the help message.
network ip connection listList active TCP/IP connections
--netstack | -N
The network stack instance; if unspecified, use the default netstack instance
--type | -t
Connection type : [ip, tcp, udp, all]
--help
Show the help message.
network ip dns search addAdd a search domain to the list of domains to be searched when trying to resolve an host name on the ESXi host.
--domain | -d
The string name of a domain to add to the list of search domains. (required)
--netstack | -N
The network stack instance; if unspecified, use the default netstack instance
--help
Show the help message.
network ip dns search listList the search domains currently configured on the ESXi host in the order in which they will be used when searching.
--netstack | -N
The network stack instance; if unspecified, use the default netstack instance
--help
Show the help message.
network ip dns search removeRemove a search domain from the list of domains to be searched when trying to resolve an host name on the ESXi host.
--domain | -d
The string name of a domain to remove from the list of search domains. (required)
--netstack | -N
The network stack instance; if unspecified, use the default netstack instance
--help
Show the help message.
network ip dns server addAdd a new DNS server to the end of the list of DNS servers to use for this ESXi host.
--netstack | -N
The network stack instance; if unspecified, use the default netstack instance
--server | -s
The IP address (v4 or v6) of the DNS server to add to the DNS server list. (required)
--help
Show the help message.
network ip dns server listPrint a list of the DNS server currently configured on the system in the order in which they will be used.
--netstack | -N
The network stack instance; if unspecified, use the default netstack instance
--help
Show the help message.
network ip dns server removeRemove a DNS server from the list of DNS servers to use for this ESXi host.
--all | -a
--netstack | -N
The network stack instance; if unspecified, use the default netstack instance
--server | -s
(required)
--help
Show the help message.
network ip interface addAdd a new VMkernel network interface.
--dvport-id | -P
DVPort ID of the connection point. This requires --dvs-name to be given in the same command
--dvs-name | -s
DVSwitch name of the connection point. This requires --dvport-id to be given in the same command
--interface-name | -i
The name of the VMkernel network interface to create. This name must be in the form vmkX, where X is a number 0-255
--mac-address | -M
Set the MAC address for the newly created VMkernel network interface.
--mtu | -m
Set the MTU setting for a given VMkernel network interface on creation
--netstack | -N
The network stack instance; if unspecified, use the default netstack instance
--portgroup-name | -p
The name of the vswitch port group to add this VMkernel network interface to.
--help
Show the help message.
network ip interface listThis command will list the VMkernel network interfaces currently known to the system.
--netstack | -N
The network stack instance; if unspecified, consider all netstack instances
--help
Show the help message.
network ip interface removeRemove a VMkernel network interface from the ESXi host. A VMKernel network interface can be uniquely specified by --interface-name or --portgroup-name or --dvs-name/--dvport-id. i.e. Providing its name or its connection point are two ways to uniquely specify a VMKernel network interface.
--dvport-id | -P
DVPort ID of the connection point. This requires --dvs-name to be given in the same command
--dvs-name | -s
DVSwitch name of the connection point. This requires --dvport-id to be given in the same command
--interface-name | -i
The name of the VMkernel network interface to remove. This name must be in the form vmkX, where X is a number 0-255
--netstack | -N
The network stack instance; if unspecified, use the default netstack instance
--portgroup-name | -p
The name of the vswitch port group to delete this VMkernel network interface from.
--help
Show the help message.
network ip interface setThis command sets the enabled status and MTU size of a given IP interface
--enabled | -e
Set to true to enable the interface, set to false to disable it.
--interface-name | -i
The name of the interface to apply the configurations. (required)
--mtu | -m
The MTU size of the IP interface.
--help
Show the help message.
network ip interface ipv4 getList the IPv4 addresses assigned to VMkernel network interfaces.
--interface-name | -i
The name of the VMkernel network interface to limit the output of this command to.
--netstack | -N
The network stack instance; if unspecified, consider all netstack instances
--help
Show the help message.
network ip interface ipv4 setConfigure IPv4 setting for a given VMkernel network interface.
--gateway | -g
The default gateway for this interface. The value must be a valid IPv4 address. Gateway would be reset if not provided
--interface-name | -i
The name of the VMkernel network interface to set IPv4 settings for. This name must be an interface listed in the interface list command. (required)
--ipv4 | -I
The static IPv4 address for this interface.
--netmask | -N
The static IPv4 netmask for this interface.
--peer-dns | -P
A boolean value to indicate if the system should use the DNS settings published via DHCP for this interface.
--type | -t
IPv4 Address type : dhcp: Use DHCP to aquire IPv4 setting for this interface. none: Remove IPv4 settings form this interface. static: Set Static IPv4 information for this interface. Requires --ipv4 and --netmask options.
--help
Show the help message.
network ip interface ipv4 address listList the IPv4 addresses assigned to VMkernel network interfaces.
--interface-name | -i
The name of the VMkernel network interface to limit the output of this command to.
--netstack | -N
The network stack instance; if unspecified, consider all netstack instances
--help
Show the help message.
network ip interface ipv6 getGet IPv6 settings for VMkernel network interfaces. This does not include the IPv6 addresses which can be found in the listipv6 command
--interface-name | -n
The name of the VMkernel network interface to limit the output of this command to.
--netstack | -N
The network stack instance; if unspecified, consider all netstack instances
--help
Show the help message.
network ip interface ipv6 setConfigure IPv6 settings for a given VMkernel network interface.
--enable-dhcpv6 | -d
Setting this value to true will enable DHCPv6 on this interface and attempt to aquire an IPv6 address from the network
--enable-ipv6 | -e
Setting this value to true enables IPv6 on thisinterface while setting it to false disables IPv6 on this interface.
--enable-router-adv | -r
Setting this value to true will enable IPv6 Router Advertised IPv6 addresses to be added to this interface from any routers broadcasting on the local network.
--gateway | -g
A default gateway for this interface. The value must be a valid IPv6 address.
--interface-name | -i
The name of the VMkernel network interface to set IPv6 settings for. This name must be an interface listed in the interface list command. (required)
--peer-dns | -P
A boolean value to indicate if the system should use the DNS settings published via DHCPv6 for this interface.
--help
Show the help message.
network ip interface ipv6 address addAdd a static IPv6 address to a given VMkernel network interface.
--interface-name | -i
The name of the VMkernel network interface to add a static IPv6 address to. This name must be an interface listed in the interface list command. (required)
--ipv6 | -I
The IPv6 address to add to the given VMkernel network interface. This must be in X:X:X::/X format (required)
--help
Show the help message.
network ip interface ipv6 address listThis command will list all of the IPv6 addresses currently assigned to the system
--interface-name | -i
The name of the VMkernel network interface to limit the output of this command to.
--help
Show the help message.
network ip interface ipv6 address removeRemove an IPv6 address from a given VMkernel network interface.
--interface-name | -i
The name of the VMkernel network interface to remove an IPv6 address from. This name must be an interface listed in the interface list command. (required)
--ipv6 | -I
The IPv6 address to remove from the given VMkernel network interface. This must be in X:X:X::/X format (required)
--help
Show the help message.
network ip interface tag addAdds a tag on a given VMkernel network interface. Supported tags are: Management, VMotion, faultToleranceLogging, vSphereReplication, vSphereReplicationNFC, vSphereProvisioning, VSAN, VSANWitness
--interface-name | -i
The name of the VMkernel network interface on which tags should be set. This name must be an interface listed in the interface list command. (required)
--tagname | -t
Tag name to assign to the interface (required)
--help
Show the help message.
network ip interface tag getGets the tags set on the given VMkernel network interface.
--interface-name | -i
Name of vmknic whose tags are to be read (required)
--help
Show the help message.
network ip interface tag removeRemoves a tag on a given VMkernel network interface.
--interface-name | -i
The name of the VMkernel network interface from which tags should be removed. This name must be an interface listed in the interface list command. (required)
--tagname | -t
Tag name to assign to the interface (required)
--help
Show the help message.
network ip ipsec sa addAdd a Security Association.
--encryption-algorithm | -e
Encryption algorithm for the Security Association. Should be one in set [null, 3des-cbc, aes128-cbc]. (required)
--encryption-key | -k
Encryption key(ASCII or hex). Length of hex key is dependent upon algorithm used. Required when a encryption algorithm has been specified.
--integrity-algorithm | -i
Integrity algorithm for the Security Association. Should be one in set [hmac-sha1, hmac-sha2-256]. (required)
--integrity-key | -K
Integrity key(ASCII or hex). Length of hex key is dependent upon algorithm used. (required)
--sa-destination | -d
Ipv6 address of Security Association destination. Can be specified as 'any' or a correct IPv6 address. (required)
--sa-mode | -m
Security Association mode. Should be one in set [transport, tunnel].
--sa-name | -n
Name for the Security Association to be added. (required)
--sa-source | -s
Ipv6 address of Security Association source. Can be specified as 'any' or a correct IPv6 address. (required)
--sa-spi | -p
SPI value for the Security Association(hex). (required)
--help
Show the help message.
network ip ipsec sa listList configured Security Associations
--help
Show the help message.
network ip ipsec sa removeOperation to remove Security Association(s)
--remove-all | -a
Set to remove all Security Associations.
--sa-destination | -d
Ipv6 address of Security Association destination. This option needs to be specified when removing an auto SA.
--sa-name | -n
Name for the Security Association to be removed. Specify 'auto' to remove an auto SA.
--sa-source | -s
Ipv6 address of Security Association source. This option needs to be specified when removing an auto SA.
--sa-spi | -p
SPI value for the Security Association (hex). This option needs to be specified when removing an auto SA
--help
Show the help message.
network ip ipsec sp addAdd a Security Policy.
--action | -A
Action for Security Policy. Should be one in set [none, discard, ipsec].
--destination-port | -P
Destination Port for Security Policy. '0' stands for 'any' (required)
--flow-direction | -w
Flow direction for Security Policy. Should be one in set [in, out].
--sa-name | -a
Name for the Security Association. Not being Specified lets vmkernel automatically choose an Security Association. If no applicable Security Association exists, then vmkernel may request one using IKE.
--source-port | -p
Source Port for Security Policy. '0' stands for 'any' (required)
--sp-destination | -d
Ipv6 address and prefix length of Security Policy destination. Can be specified as 'any' or a correct Ipv6 network address. (required)
--sp-mode | -m
Security Policy mode. Should be one in set [transport, tunnel].
--sp-name | -n
Name for the Security Policy to be added. (required)
--sp-source | -s
Ipv6 address and prefix length of Security Policy source. Can be specified as 'any' or a correct IPv6 network address. (required)
--upper-layer-protocol | -u
Upper layer protocol for Security Policy, Should be one in set [any, tcp, udp, icmp6].
--help
Show the help message.
network ip ipsec sp listList configured Security Policys
--help
Show the help message.
network ip ipsec sp removeOperation to remove Security Policy
--remove-all | -a
Set to remove all Security Policys
--sp-name | -n
Name for the Security Policy to be removed.
--help
Show the help message.
network ip neighbor listList ARP table entries
--interface-name | -i
The name of the VMkernel network interface to limit the output of this command to; if unspecified, list neighbors on all interfaces.
--netstack | -N
The network stack instance; if unspecified, use the default netstack instance
--version | -v
IP version : [4, 6, all]
--help
Show the help message.
network ip neighbor removeRemove ARP table entries
--interface-name | -i
The name of the VMkernel network interface to remove the neighbor entry from. If not specified, neighbor will be removed from all interfaces
--neighbor-addr | -a
The IPv4/IPv6 address of the neighbor. (required)
--netstack | -N
The network stack instance; if unspecified, use the default netstack instance
--version | -v
IP version : [4, 6] (required)
--help
Show the help message.
network ip netstack addAdd a new Netstack Instance.
--disabled | -d
Create the netstack instance only in config i.e. in disabled state. Does not create in kernel.
--netstack | -N
The network stack instance (required)
--help
Show the help message.
network ip netstack getGet runtime/configuration settings for a given Netstack Instance.
--netstack | -N
The network stack instance (required)
--help
Show the help message.
network ip netstack listThis command will list the VMkernel Netstack instances currently known to the system.
--help
Show the help message.
network ip netstack removeRemove a new Netstack Instance.
--netstack | -N
The network stack instance (required)
--help
Show the help message.
network ip netstack setConfigure settings for a given Netstack Instance.
--ccalgo | -c
The TCP Congestion Contol Algorithm for this netstack instance (not applied to existing connections).: cubic: Set cubic as the algorithm newreno: Set newreno as the algorithm
--enable | -e
Enable the netstack instance (create in kernel)
--ipv6enabled | -i
To enable IPv6 for this netstack instance (aplied only during netstack creation).
--maxconn | -m
The maximum number of connections for this netstack instance (applied only during netstack creation).
--name | -n
The name for this netstack instance.
--netstack | -N
The network stack instance. This name must be an interface listed in the netstack list command. (required)
--help
Show the help message.
network ip route ipv4 addAdd IPv4 route to the VMkernel.
--gateway | -g
The Ipv4 address of the gateway through which a route to be added. (required)
--netstack | -N
The network stack instance; if unspecified, use the default netstack instance
--network | -n
The Ipv4 address and prefix length of the network to add the route to. Specify 'default' to indicate the default network. (required)
--help
Show the help message.
network ip route ipv4 listList configured IPv4 routes
--netstack | -N
The network stack instance; if unspecified, use the default netstack instance
--help
Show the help message.
network ip route ipv4 removeRemove IPv4 route
--gateway | -g
The Ipv4 address of the gateway through which a route to be removed (required)
--netstack | -N
The network stack instance; if unspecified, use the default netstack instance
--network | -n
The Ipv4 address and prefix length of the network to remove the route from. Specify 'default' to indicate the default network. (required)
--help
Show the help message.
network ip route ipv6 addAdd IPv6 route to the VMkernel.
--gateway | -g
The Ipv6 address of the gateway through which a route to be added. (required)
--netstack | -N
The network stack instance; if unspecified, use the default netstack instance
--network | -n
The Ipv6 address and prefix length of the network to add the route to. Specify 'default' to indicate the default network. (required)
--help
Show the help message.
network ip route ipv6 listList configured IPv6 routes
--netstack | -N
The network stack instance; if unspecified, use the default netstack instance
--help
Show the help message.
network ip route ipv6 removeRemove IPv6 route from the VMkernel
--gateway | -g
The Ipv6 address of the gateway through which a route to be removed (required)
--netstack | -N
The network stack instance; if unspecified, use the default netstack instance
--network | -n
The Ipv6 address and prefix length of the network to remove the route from. Specify 'default' to indicate the default network. (required)
--help
Show the help message.
network multicast group listList all the multicast group members.
--help
Show the help message.
network nic downBring down the specified network device.
--nic-name | -n
The name of the NIC to configured. This must be one of the cards listed in the nic list command. (required)
--help
Show the help message.
network nic getGet the generic configuration of a network device
--nic-name | -n
The name of the NIC to configured. This must be one of the cards listed in the nic list command. (required)
--help
Show the help message.
network nic listThis command will list the Physical NICs currently installed and loaded on the system.
--help
Show the help message.
network nic setSet the general options for the specified ethernet device.
--auto | -a
Set the speed and duplexity settings to autonegotiate.
--duplex | -D
The duplex to set this NIC to. Acceptable values are : [full, half]
--message-level | -l
Sets the driver message level. Meaning differ per driver.
--nic-name | -n
The name of the NIC to configured. This must be one of the cards listed in the nic list command. (required)
--phy-address | -P
Set the PHY address of the device
--port | -p
Selects device port. Available device ports are aui: Select AUI (Attachment Unit Interface) as the device port bnc: Select BNC (Bayonet Neill-Concelman) as the device port da: Select DA (Direct Attach copper) as the device port fibre: Select fibre as the device port mii: Select MII (Media Independent Interface) as the device port tp: Select TP (Twisted Pair) as the device port
--speed | -S
The speed to set this NIC to, in Mbps. Acceptable values are : [10, 100, 1000, 2500, 5000, 10000, 20000, 25000, 40000, 50000, 56000, 100000]
--transceiver-type | -t
Selects transeiver type. Currently only internal and external can be specified, in the future future types might be added. Available transeiver types are external: Set the transceiver type to external internal: Set the transceiver type to internal
--virtual-address | -V
Set the virtual address of the device
--wake-on-lan | -w
Sets Wake-on-LAN options. Not all devices support this. The argument to this option is a string of characters specifying which options to enable. p Wake on phy activity u Wake on unicast messages m Wake on multicast messages b Wake on broadcast messages a Wake on ARP g Wake on MagicPacket(tm) s Enable SecureOn(tm) password for MagicPacket(tm)
--help
Show the help message.
network nic upBring up the specified network device.
--nic-name | -n
The name of the NIC to configured. This must be one of the cards listed in the nic list command. (required)
--help
Show the help message.
network nic coalesce getGet coalesce parameters
--vmnic | -n
The name of pnic to get coalesce parameters
--help
Show the help message.
network nic coalesce setSet coalesce parameters on a nic
--adaptive-rx | -a
enable or disable adaptive RX algorithm in driver.
--adaptive-tx | -A
enable or disable adaptive TX algorithm in driver.
--rx-max-frames | -R
Maximum number of RX frames driver to process before interrupting.
--rx-usecs | -r
Number of microseconds driver to wait for RX before interrupting.
--sample-interval | -i
Packet rate sampling internal in seconds for the adaptive coalescing algorithm in driver.
--tx-max-frames | -T
Maximum number of completed TX frames driver to process before interrupting.
--tx-usecs | -t
Number of microseconds driver to wait for completed TX before interrupting.
--vmnic | -n
Name of vmnic to set coalesce parameters. (required)
--help
Show the help message.
network nic coalesce high getGet information about the behavior of a NIC when it sends or receives packets at high packet rate.
--vmnic | -n
The name of the pnic for which information should be retrieved. (required)
--help
Show the help message.
network nic coalesce high setSet parameters to control the behavior of a NIC when it sends or receives packets at high packet rate.
--pkt-rate | -p
The high packet rate measured in number of packets per second. When packet rate is above this parameter, the RX/TX coalescing parameters configured by this command are used.
--rx-max-frames | -R
The maximum number of RX packets to delay an RX interrupt after they arrive under high packet rate conditions.
--rx-usecs | -r
The number of microseconds to delay an RX interrupt after a packet arrives under high packet rate conditions.
--tx-max-frames | -T
The maximum number of TX packets to delay an TX interrupt after they are sent under high packet rate conditions.
--tx-usecs | -t
The number of microseconds to delay a TX interrupt after a packet is sent under high packet rate conditions.
--vmnic | -n
Name of the vmnic for which parameters should be set. (required)
--help
Show the help message.
network nic coalesce low getGet information about the behavior of a NIC when it sends or receives packets at low packet rate.
--vmnic | -n
The name of the pnic for which information should be retrieved. (required)
--help
Show the help message.
network nic coalesce low setSet parameters to control the behavior of a NIC when it sends or receives packets at low packet rate.
--pkt-rate | -p
The low packet rate measured in number of packets per second. When packet rate is below this parameter, the RX/TX coalescing parameters configured by this command are used.
--rx-max-frames | -R
The maximum number of RX packets to delay an RX interrupt after they arrive under low packet rate conditions.
--rx-usecs | -r
The number of microseconds to delay an RX interrupt after a packet arrives under low packet rate conditions.
--tx-max-frames | -T
The maximum number of TX packets to delay an TX interrupt after they are sent under low packet rate conditions.
--tx-usecs | -t
The number of microseconds to delay a TX interrupt after a packet is sent under low packet rate conditions.
--vmnic | -n
Name of the vmnic for which parameters should be set. (required)
--help
Show the help message.
network nic cso getGet checksum offload settings
--vmnic | -n
The name of pnic to get CSO settings
--help
Show the help message.
network nic cso setSet checksum offload settings on a nic
--enable | -e
RX/TX checksum offload (required)
--vmnic | -n
Name of vmnic to set offload settings. (required)
--help
Show the help message.
network nic eeprom changeChange EEPROM on a nic
--file | -f
File name of new EEPROM content
--magic | -m
Magic key of EEPROM (required)
--offset | -o
Offset of EEPROM to change
--value | -v
New EEPROM value in double word
--vmnic | -n
Name of vmnic to change EEPROM. (required)
--help
Show the help message.
network nic eeprom dumpDump device EEPROM
--length | -l
Bytes of EEPROM to dump
--offset | -o
Offset of EEPROM starting to dump
--vmnic | -n
The name of pnic to dump EEPROM (required)
--help
Show the help message.
network nic negotiate restartRestart N-Way negotiation on a nic
--vmnic | -n
Name of vmnic to restart negotiation (required)
--help
Show the help message.
network nic pauseParams listList pause parameters of all NICs
--nic-name | -n
The name of the NIC whose pause parameters should be retrieved.
--help
Show the help message.
network nic pauseParams setSet pause parameters for a NIC
--auto | -a
Enable/disable auto negotiation.
--nic-name | -n
Name of NIC whose pause parameters should be set. (required)
--rx | -r
Enable/disable pause RX flow control.
--tx | -t
Enable/disable pause TX flow control.
--help
Show the help message.
network nic queue count getGet netqueue count on a nic
--vmnic | -n
The name of pnic to get netqueue count
--help
Show the help message.
network nic queue count setSet number of netqueues on a nic
--num | -q
Number of queues to set. (required)
--rx | -r
Rx netqueue to set count.
--tx | -t
Tx netqueue to set count.
--vmnic | -n
Name of vmnic to set netqueue count. (required)
--help
Show the help message.
network nic queue filterclass listList the netqueue supported filterclass of all physical NICs currently installed and loaded on the system.
--help
Show the help message.
network nic queue loadbalancer listList the netqueue load balancer settings of all physical NICs currently installed and loaded on the system. Setting legend as follows. S: Setting supported by device, U: Setting unsupported by device, N: Setting not applicable to device, A: Setting allowed at load balancing, D: Setting disallowed at load balancing.
--help
Show the help message.
network nic queue loadbalancer setEnable/disable netqueue load balancer setting on a NIC.
--dynpoollb
Configure Dynamic queue pool at netqueue load balancer.
--geneveoamlb
Configure Geneve OAM at netqueue load balancer.
--lrolb
Configure Large Receive Offload at netqueue load balancer.
--numadynlb
Configure Numa I/O aware dynamic load balancing at netqueue load balancer.
--rsslb
Configure Receive Side Scaling at netqueue load balancer.
--rxdynlb
Configure RX dynamic load balancing at netqueue load balancer.
--rxqlatency
Configure Rx queue latency at netqueue load balancer.
--rxqnofeat
Configure Rx queue no feature at netqueue load balancer.
--rxqpair
Configure Rx queue pair at netqueue load balancer.
--rxqpreempt
Configure pre-emptible queue at netqueue load balancer.
--vmnic | -n
Name of vmnic to update netqueue load balancer setting. (required)
--help
Show the help message.
network nic register dumpDump device registers
--vmnic | -n
The name of pnic to dump registers (required)
--help
Show the help message.
network nic ring current getGet current RX/TX ring buffer parameters of a NIC
--nic-name | -n
The name of the NIC whose current RX/TX ring buffer parameters should be retrieved. (required)
--help
Show the help message.
network nic ring current setSet current RX/TX ring buffer parameters of a NIC
--nic-name | -n
The name of the NIC whose current RX/TX ring buffer parameters should be set. (required)
--rx | -r
Number of ring entries for the RX ring.
--rx-jumbo | -j
Number of ring entries for the RX jumbo ring.
--rx-mini | -m
Number of ring entries for the RX mini ring.
--tx | -t
Number of ring entries for the TX ring.
--help
Show the help message.
network nic ring preset getGet preset RX/TX ring buffer parameters of a NIC
--nic-name | -n
The name of the NIC whose preset RX/TX ring buffer parameters should be retrieved. (required)
--help
Show the help message.
network nic selftest runRun self test
--online | -o
Performing limited set of tests do not inetrrupt normal adapter operation, default is offline
--vmnic | -n
The name of pnic to dump EEPROM (required)
--help
Show the help message.
network nic sg getGet scatter-gather settings
--vmnic | -n
The name of pnic to get scatter-gather settings
--help
Show the help message.
network nic sg setSet scatter-gatter settings on a nic
--enable | -e
Enable/disable sacatter-gather (required)
--vmnic | -n
Name of vmnic to configure scatter-gather settings. (required)
--help
Show the help message.
network nic software listList software simulation settings of all physical NICs currently installed and loaded on the system.
--help
Show the help message.
network nic software setEnable and disable software simulation settings on a NIC.
--geneveoffload
Configure Geneve encapsulation offload software simulation.
--highdma
Configure high DMA software simulation.
--ipv4cso
Configure IPv4 checksum offload software simulation.
--ipv4tso
Configure IPv4 TCP segmentation offload software simulation.
--ipv6cso
Configure IPv6 checksum offload software simulation.
--ipv6csoext
Configure IPv6 extend header checksum offload software simulation.
--ipv6tso
Configure IPv6 TCP segmentation offload software simulation.
--ipv6tsoext
Configure IPv6 extend header TCP segmentation offload software simulation.
--obo
Configure offset based encapsulation offload software simulation.
--sg
Configure scatter gather software simulation.
--sgsp
Configure scatter gather span multiple pages software simulation.
--tagging
Configure TX VLAN tagging software simulation.
--untagging
Configure RX VLAN untagging software simulation.
--vmnic | -n
Name of the vmnic whose software similation settings should be updated. (required)
--vxlanencap
Configure VXLAN encapsulation offload software simulation.
--help
Show the help message.
network nic stats getGet NIC statistics for a given interface.
--nic-name | -n
Name of the NIC to get statistics from. (required)
--help
Show the help message.
network nic tso getGet TCP segmentation offload settings
--vmnic | -n
The name of pnic to get TSO settings
--help
Show the help message.
network nic tso setSet TCP segmentation offload settings on a nic
--enable | -e
TCP segmentation offload (required)
--vmnic | -n
Name of vmnic to set TSO settings. (required)
--help
Show the help message.
network nic vlan stats getList VLAN statistics for active VLAN's on the NIC.
--nic-name | -n
Name of the NIC to get statistics from. (required)
--help
Show the help message.
network nic vlan stats setEnable/disable VLAN statistics collection on the NIC.
--enabled | -e
Whether to enable or disable VLAN statistics (required)
--nic-name | -n
Name of the NIC to get statistics from. (required)
--help
Show the help message.
network port filter stats getFilter statistics for a given port.
--portid | -p
Port ID for the port to get filter statistics. (required)
--help
Show the help message.
network port stats getPacket statistics for a given port.
--portid | -p
Port ID for the port to get statistics. (required)
--help
Show the help message.
network sriovnic listThis command will list the SRIOV Enabled NICs (PFs) currently installed and loaded on the system.
--help
Show the help message.
network sriovnic vf listGet the generic configuration of VFs for SRIOV NIC.
--nic-name | -n
The name of the SRIOV NIC to configured. This must be one of the cards listed in the sriovNic list command. (required)
--help
Show the help message.
network sriovnic vf statsGet statistics for given VF of a SRIOV NIC.
--nic-name | -n
The name of the SRIOV NIC. This must be one of the cards listed in the sriovNic list command. (required)
--vf-id | -v
The VF ID of the virtual function whose stats are to be collected. This must be one of the VF IDs listed in the sriovnic vf list command. (required)
--help
Show the help message.
network vm listList networking information for the VM's that have active ports.
--help
Show the help message.
network vm port listList of active ports for a given VM.
--world-id | -w
World ID of the VM for listing ports. (required)
--help
Show the help message.
network vswitch dvs vmware listList the VMware vSphere Distributed Switch currently configured on the ESXi host.
--vds-name | -v
Limit the output of this command to only vDS with the given name.
--help
Show the help message.
network vswitch dvs vmware lacp config getGet LACP configuration on DVS
--dvs | -s
The name of DVS to get configuration on
--help
Show the help message.
network vswitch dvs vmware lacp stats getGet LACP stats on DVS uplinks
--dvs | -s
The name of DVS to get configuration on
--help
Show the help message.
network vswitch dvs vmware lacp status getGet LACP status on DVS
--dvs | -s
The name of DVS to get configuration on
--help
Show the help message.
network vswitch dvs vmware lacp timeout setSet long/short timeout for vmnics in one LACP LAG
--lag-id | -l
The ID of LAG to be configured. (required)
--nic-name | -n
The nic name. If it is set, then only this vmnic in the lag will be configured.
--timeout | -t
Set long or short timeout: 1 for short timeout and 0 for long timeout. (required)
--vds | -s
The name of VDS. (required)
--help
Show the help message.
network vswitch standard addAdd a new virtual switch to the ESXi networking system.
--ports | -P
The number of ports to to give this newly created virtual switch. Maximum ports per virtual switch is 4096. If no value is given the default value(128) is used. The number of ports is limited by the number of already allocated ports on the host. The system wide port count cannot be greater than 4608.
--vswitch-name | -v
The name of the virtual switch to create. (required)
--help
Show the help message.
network vswitch standard listList the virtual switches current on the ESXi host.
--vswitch-name | -v
Limit the output of this command to only virtual switches with the given name.
--help
Show the help message.
network vswitch standard removeRemove a virtual switch from the ESXi networking system.
--vswitch-name | -v
The name of the virtual switch to remove. (required)
--help
Show the help message.
network vswitch standard setThis command sets the MTU size and CDP status of a given virtual switch.
--cdp-status | -c
The CDP status of the given virtual switch. It can be 'down', 'listen', 'advertise' or 'both'
--mtu | -m
The MTU size of the given virtual switch.
--vswitch-name | -v
The name of virtual switch to apply the configurations. (required)
--help
Show the help message.
network vswitch standard policy failover getGet the failover policy settings governing the given virtual switch
--vswitch-name | -v
The name of the virtual switch to use when fetching the switch failover policy. (required)
--help
Show the help message.
network vswitch standard policy failover setConfigure the Failover policy for a virtual switch.
--active-uplinks | -a
Configure the list of active adapters and their failover order. This list must be a comma seperated list of values with the uplink name and no spaces. Example: --active-uplinks=vmnic0,vmnic3,vmnic7,vmnic1
--failback | -b
Configure whether a NIC will be used immediately when it comes back in service after a failover
--failure-detection | -f
Set the method of determining how a network outage is detected. beacon: Detect failures based on active beaconing to the vswitch link: Detect failures based on the NIC link state
--load-balancing | -l
Set the load balancing policy for this policy. This can be one of the following options: explicit: Always use the highest order uplink from the list of active adapters which pass failover criteria. iphash: Route based on hashing the src and destination IP addresses mac: Route based on the MAC address of the packet source. portid: Route based on the originating virtual port ID.
--notify-switches | -n
Indicate whether to send a notification to physical switches on failover
--standby-uplinks | -s
Configure the list of standby adapters and their failover order. This list must be a comma seperated list of values with the uplink name and no spaces. Example: --standby-uplinks=vmnic2,vmnic4,vmnic8,vmnic6,vmnic11
--vswitch-name | -v
The name of the virtual switch to use when configuring the switch failover policy. (required)
--help
Show the help message.
network vswitch standard policy security getGet the Security Policy governing the given virtual switch.
--vswitch-name | -v
The name of the virtual switch to use when fetching the network security policy. (required)
--help
Show the help message.
network vswitch standard policy security setSet the security policy for a given virtual switch
--allow-forged-transmits | -f
A boolean value to indicate if ports on the virtual switch should send packets with forged source information.
--allow-mac-change | -m
A boolean value to indicate if ports on the virtual switch should change their MAC address.
--allow-promiscuous | -p
A boolean value to indicate if ports on the virtual switch should enter promiscuous mode.
--vswitch-name | -v
The name of the virtual switch to use when setting the switch security policy. (required)
--help
Show the help message.
network vswitch standard policy shaping getGet the shaping policy settings for the given virtual switch
--vswitch-name | -v
The name of the virtual switch to use when fetching the switch shaping policy. (required)
--help
Show the help message.
network vswitch standard policy shaping setSet the shaping policy settings for the given virtual switch
--avg-bandwidth | -b
The averge bandwidth allowed for this shaping policy. This value is in Kbps (1 Kbps = 1000 bits/s)
--burst-size | -t
The largest burst size allowed for this shaping policy. This value is in Kib (1 Kib = 1024 bits)
--enabled | -e
Indicate whether to enable traffic shaping on this policy. If this is true then the --avg-bandwidth, --peak-bandwidth and --burst-size options are required.
--peak-bandwidth | -k
The peak bandwidth allowed for this shaping policy. This value is in Kbps (1 Kbps = 1000 bits/s)
--vswitch-name | -v
The name of the virtual switch to use when setting the switch shaping policy. (required)
--help
Show the help message.
network vswitch standard portgroup addAllows the addition of a standard port group to a virtual switch.
--portgroup-name | -p
The name of the port group to add (required)
--vswitch-name | -v
The virtual switch to add the port group to. (required)
--help
Show the help message.
network vswitch standard portgroup listList all of the port groups currently on the system.
--help
Show the help message.
network vswitch standard portgroup removeRemove a port group from the given virtual switch
--portgroup-name | -p
(required)
--vswitch-name | -v
(required)
--help
Show the help message.
network vswitch standard portgroup setSet the vlan id for the given port group
--portgroup-name | -p
The name of the port group to set vlan id for. (required)
--vlan-id | -v
The vlan id for this port group. This value is in the range (0 - 4095)
--help
Show the help message.
network vswitch standard portgroup policy failover getGet the network failover policy settings governing the given port group
--portgroup-name | -p
The name of the port group to use when fetching the port group failover policy. (required)
--help
Show the help message.
network vswitch standard portgroup policy failover setConfigure the Failover policy for a port group. These setting may potentially override virtual switch settings.
--active-uplinks | -a
Configure the list of active adapters and their failover order. This list must be a comma seperated list of values with the uplink name and no spaces. Example: --active-uplinks=vmnic0,vmnic3,vmnic7,vmnic1
--failback | -b
Configure whether a NIC will be used immediately when it comes back in service after a failover
--failure-detection | -f
Set the method of determining how a network outage is detected. beacon: Detect failures based on active beaconing to the vswitch link: Detect failures based on the NIC link state
--load-balancing | -l
Set the load balancing policy for this policy. This can be one of the following options: explicit: Always use the highest order uplink from the list of active adapters which pass failover criteria. iphash: Route based on hashing the src and destination IP addresses mac: Route based on the MAC address of the packet source. portid: Route based on the originating virtual port ID.
--notify-switches | -n
Indicate whether to send a notification to physical switches on failover
--portgroup-name | -p
The name of the port group to set failover policy for. (required)
--standby-uplinks | -s
Configure the list of standby adapters and their failover order. This list must be a comma seperated list of values with the uplink name and no spaces. Example: --standby-uplinks=vmnic2,vmnic4,vmnic8,vmnic6,vmnic11
--use-vswitch | -u
Reset all values for this policy to use parent virtual switch's settings instead of overriding the settings for the port group. Using this in conjunction with other settings will first reset all of the fields to use the virtual switch setting and then apply the other options after the reset.
--help
Show the help message.
network vswitch standard portgroup policy security getGet the Security Policy governing the given port group.
--portgroup-name | -p
The name of the port group to use when fetching the network security policy. (required)
--help
Show the help message.
network vswitch standard portgroup policy security setSet the security policy for a given port group
--allow-forged-transmits | -f
A boolean value to indicate if ports on the virtual switch should send packets with forged source information.
--allow-mac-change | -m
A boolean value to indicate if ports on the virtual switch should change their MAC address.
--allow-promiscuous | -o
A boolean value to indicate if ports on the virtual switch should enter promiscuous mode.
--portgroup-name | -p
The name of the port group to set security policy for. (required)
--use-vswitch | -u
Reset all values for this policy to use parent virtual switch's settings instead of overriding the settings for the port group. Using this in conjunction with other settings will first reset all of the fields to use the virtual switch setting and then apply the other options after the reset.
--help
Show the help message.
network vswitch standard portgroup policy shaping getGet the network shaping policy settings governing the given port group
--portgroup-name | -p
The name of the port group to use when fetching the port group shaping policy. (required)
--help
Show the help message.
network vswitch standard portgroup policy shaping setSet the shaping policy settings for the given port group
--avg-bandwidth | -b
The averge bandwidth allowed for this shaping policy. This value is in Kbps (1 Kbps = 1000 bits/s)
--burst-size | -t
The largest burst size allowed for this shaping policy. This value is in Kib (1 Kib = 1024 bits)
--enabled | -e
Indicate whether to enable traffic shaping on this policy. If this is true then the --avg-bandwidth, --peak-bandwidth and --burst-size options are required.
--peak-bandwidth | -k
The peak bandwidth allowed for this shaping policy. This value is in Kbps (1 Kbps = 1000 bits/s)
--portgroup-name | -p
The name of the port group to set shaping policy for. (required)
--use-vswitch | -u
Reset all values for this policy to use parent virtual switch's settings instead of overriding the settings for the port group. Using this in conjunction with other settings will first reset all of the fields to use the virtual switch setting and then apply the other options after the reset.
--help
Show the help message.
network vswitch standard uplink addAdd an uplink to the given virtual switch. Note if this virtual switch has a NIC teaming policy assigned to it then the policy must also be modified to enable use of this uplink on this virtual switch
--uplink-name | -u
The name of the uplink to add to the virtual switch. (required)
--vswitch-name | -v
The name of the virtual switch to add an uplink to. (required)
--help
Show the help message.
network vswitch standard uplink removeRemove an uplink from the given virtual switch. Note if this virtual switch has a NIC teaming policy assigned to it then the policy must also be modified to disable use of this uplink on this virtual switch
--uplink-name | -u
The name of the uplink to remove from the virtual switch. (required)
--vswitch-name | -v
The name of the virtual switch to remove an uplink from. (required)
--help
Show the help message.

Comments

Popular Posts