Network and FC commands for ESXi

The VMware infrastructure virtualization system, known as vSphere, uses the Enhanced Scalability and Performance (ESX) operating system to provide a high-efficiency and performance virtualization environment. ESX includes a set of commands that can be used to manage and configure the network system and storage area network (SAN).

Network Commands

Let’s start with some basic ESX commands for managing the network system.

esxcli network ip interface ipv4 set -i vmnic0 -I 192.168.1.100 -N 255.255.255.0 -G 192.168.1.1
The above command allows you to configure IP addresses, subnet masks, and gateway addresses for the ESX system’s network interfaces.
esxcli network vswitch standard add -v vSwitch1
This command allows you to create and configure “vswitches” (virtual switches) in ESX. A vSwitch is a logical component that allows virtual machines to be connected to a physical network.
esxcli network vswitch standard uplink add -u vmnic0 -v vSwitch1
Once the vSwitch is created, we can add network interfaces to it using this command:
esxcli network firewall set --enabled true
This command allows you to configure and manage the ESX firewall:
esxcli network firewall ruleset list
This command allows you to view the firewall rule state:
esxcli network firewall ruleset rule add -r sshServer -p TCP -o inbound -y allow
To add a rule to the firewall, we can use this command.

SAN commands

Now let’s see some ESX commands for managing SAN.

This command allows you to manage device-to-host mapping and view the state of the mapped storage devices on a host:
esxcli storage nmp device list
This command allows you to manage SAN-connected storage on an ESX host and view the state of the SAN-connected storage devices on a host:
esxcli storage san fc list
The esxcli storage vmfs command allows you to manage Virtual Machine File System (VMFS) volumes in ESX, and this command allows you to view the state of the VMFS volumes on a host:
esxcli storage vmfs extent list

 

Other useful ESX commands for managing the network and storage area network (SAN) include:

This command allows you to configure the name and vSwitch of a port group:

esxcli network vswitch standard portgroup set -p "Management Network" -v vSwitch0

This command allows you to configure the security policy of a port group, allowing for promiscuous mode:

esxcli network vswitch standard portgroup policy security set -p "Management Network" -m promiscuous-mode -M accept

This command allows you to configure the VLAN policy of a port group:

esxcli network vswitch standard portgroup policy vlan set -p "Management Network" -v 4095

This command allows you to add a storage device routing rule for a Storage Array Type Plugin (SATP):

esxcli storage nmp satp rule add -s "VMW_SATP_ALUA" -V "VMW_VAAI_NFS" -M "VMW_NMP_ALUA_DSS"

This command allows you to view the list of storage adapters on an ESX host

esxcli storage core adapter list

This command allows you to view information about a specific storage device on an ESX host:

esxcli storage core device list -d naa.600601602ac0000000120000035000001

In summary, ESX offers a wide range of useful commands for managing and configuring the network system and SAN. These commands are essential for the management and maintenance of high-scale virtualization environments, providing precise and detailed control over the network and storage operation on an ESX host.

Leave a Reply