ESX 5.5 Cheat Sheet using esxcli – Part 2

Continuing from previous post. This post will cover networking, storage part.

********************NIC and IP information********************

How Many NIC are present on server ? Another command to do same work ~ # esxcfg-nics -l

~ # esxcli network nic list
Name PCI Device Driver Link Speed Duplex MAC Address MTU Description
—— ————- —— —- —– —— —————– —- ————————————————————–
vmnic0 0000:002:00.0 e1000 Up 1000 Full 00:0c:29:f8:9b:93 1500 Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)
vmnic1 0000:002:03.0 e1000 Up 1000 Full 00:0c:29:f8:9b:9d 1500 Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)
vmnic2 0000:002:04.0 e1000 Up 1000 Full 00:0c:29:f8:9b:a7 1500 Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)

How to see the network statistics of particular NIC ?

~ # esxcli network nic stats get -n vmnic0
NIC statistics for vmnic0
Packets received: 371
Packets sent: 181
Bytes received: 35047
Bytes sent: 30559
Receive packets dropped: 0
Transmit packets dropped: 0
Total receive errors: 0
Receive length errors: 0
Receive over errors: 0
Receive CRC errors: 0
Receive frame errors: 0
Receive FIFO errors: 0
Receive missed errors: 0
Total transmit errors: 0
Transmit aborted errors: 0
Transmit carrier errors: 0
Transmit FIFO errors: 0
Transmit heartbeat errors: 0
Transmit window errors: 0

Use the below logic to get the network statistics of all packages.

~ # for i in `esxcli network nic list | awk ‘{print $1}’ | sed ‘1,2d’`
> do
> esxcli network nic stats get -n $i
> done

How to see the DNS server  ?

~ # esxcli network ip dns server list
DNSServers: 192.168.111.10

Result of DNS search operation ?

~ # esxcli network ip dns search list
DNSSearch Domains: ganesh.com, localdomain

How to see the routing information?

~ # esxcli network ip route ipv4 list
Network Netmask Gateway Interface Source
————- ————- ————- ——— ——
default 0.0.0.0 192.168.111.1 vmk0 MANUAL
192.168.111.0 255.255.255.0 0.0.0.0 vmk0 MANUAL
192.168.112.0 255.255.255.0 0.0.0.0 vmk1 MANUAL

Another command to check the status of NIC present on server ?

~ # esxcli network ip interface list
vmk0
Name: vmk0
MAC Address: 00:0c:29:f8:9b:93
Enabled: true
Portset: vSwitch0
Portgroup: Management Network
Netstack Instance: defaultTcpipStack
VDS Name: N/A
VDS UUID: N/A
VDS Port: N/A
VDS Connection: -1
MTU: 1500
TSO MSS: 65535
Port ID: 33554436

vmk1
Name: vmk1
MAC Address: 00:50:56:6f:57:99
Enabled: true
Portset: vSwitch1
Portgroup: StorageNW
Netstack Instance: defaultTcpipStack
VDS Name: N/A
VDS UUID: N/A
VDS Port: N/A
VDS Connection: -1
MTU: 1500
TSO MSS: 65535
Port ID: 50331652

vmk2
Name: vmk2
MAC Address: 00:50:56:78:eb:70
Enabled: true
Portset: vSwitch2
Portgroup: VMkernel
Netstack Instance: defaultTcpipStack
VDS Name: N/A
VDS UUID: N/A
VDS Port: N/A
VDS Connection: -1
MTU: 1500
TSO MSS: 65535
Port ID: 67108868

How to see active connections to server ?

~ # esxcli network ip connection list
Proto Recv Q Send Q Local Address Foreign Address State World ID CC Algo World Name
—– —— —— —————————— ——————- ———– ——– ——- —————
tcp 0 0 127.0.0.1:8307 127.0.0.1:32391 ESTABLISHED 33923 newreno hostd-worker
tcp 0 0 127.0.0.1:32391 127.0.0.1:8307 ESTABLISHED 33980 newreno rhttpproxy-work
tcp 0 0 127.0.0.1:443 127.0.0.1:22793 ESTABLISHED 33982 newreno rhttpproxy-work
tcp 0 0 127.0.0.1:22793 127.0.0.1:443 ESTABLISHED 38692 newreno python
tcp 0 0 127.0.0.1:5988 127.0.0.1:29238 FIN_WAIT_2 34764 newreno sfcb-HTTP-Daemo
tcp 0 0 127.0.0.1:29238 127.0.0.1:5988 CLOSE_WAIT 33913 newreno hostd-worker
tcp 0 0 127.0.0.1:5988 127.0.0.1:11160 TIME_WAIT 0
tcp 0 0 127.0.0.1:10181 127.0.0.1:8307 TIME_WAIT 0
tcp 0 0 127.0.0.1:59698 127.0.0.1:443 TIME_WAIT 0

How to check the neighbor information ?

~ # esxcli network ip neighbor list
Neighbor Mac Address Vmknic Expiry State Type
————- —————– —— ——– —– ——-
192.168.111.1 00:50:56:c0:00:08 vmk0 1191 sec Unknown
192.168.112.9 00:0c:29:5d:74:7a vmk1 930 sec Unknown

*******************************VSwitch*****************************

How to see the standard vswitch information ?

~ # esxcli network vswitch standard list
vSwitch0
Name: vSwitch0
Class: etherswitch
Num Ports: 1536
Used Ports: 5
Configured Ports: 128
MTU: 1500
CDP Status: listen
Beacon Enabled: false
Beacon Interval: 1
Beacon Threshold: 3
Beacon Required By:
Uplinks: vmnic0
Portgroups: VM Network, Management Network

vSwitch1
Name: vSwitch1
Class: etherswitch
Num Ports: 1536
Used Ports: 4
Configured Ports: 128
MTU: 1500
CDP Status: listen
Beacon Enabled: false
Beacon Interval: 1
Beacon Threshold: 3
Beacon Required By:
Uplinks: vmnic1
Portgroups: VMkernel

How to check the port Groups present on server ?

~ # esxcli network vswitch standard portgroup list
Name Virtual Switch Active Clients VLAN ID
—————— ————– ————– ——-
Management Network vSwitch0 1 0
StorageNW vSwitch1 1 0
VM Network vSwitch0 1 0

~ # esxcfg-vswitch -l
Switch Name Num Ports Used Ports Configured Ports MTU Uplinks
vSwitch0 1536 5 128 1500 vmnic0

PortGroup Name VLAN ID Used Ports Uplinks
VM Network 0 1 vmnic0
Management Network 0 1 vmnic0

Switch Name Num Ports Used Ports Configured Ports MTU Uplinks
vSwitch1 1536 4 128 1500 vmnic1

PortGroup Name VLAN ID Used Ports Uplinks
StorageNW 0 1 vmnic1

Switch Name Num Ports Used Ports Configured Ports MTU Uplinks
vSwitch2 1536 4 128 1500 vmnic2

PortGroup Name VLAN ID Used Ports Uplinks
VMkernel 0 1 vmnic2

******************************ISCSI information ******************************

How to see the iscsi adapter information ?

~ # esxcli iscsi adapter list
Adapter Driver State UID Description
——- ——— —— ———————————— ———————-
vmhba33 iscsi_vmk online iqn.1998-01.com.vmware:esx1-6aa0b3dc iSCSI Software Adapter

How to get the attributes of adapter ?

~ # esxcli iscsi adapter get -A vmhba33
vmhba33
Name: iqn.1998-01.com.vmware:esx1-6aa0b3dc
Alias:
Vendor: VMware
Model: iSCSI Software Adapter
Description: iSCSI Software Adapter
Serial Number:
Hardware Version:
Asic Version:
Firmware Version:
Option Rom Version:
Driver Name: iscsi_vmk
Driver Version:
TCP Protocol Supported: false
Bidirectional Transfers Supported: false
Maximum Cdb Length: 64
Can Be NIC: false
Is NIC: false
Is Initiator: true
Is Target: false
Using TCP Offload Engine: false
Using ISCSI Offload Engine: false

How to Check the iqn detail for ISCSI server ?

~ # esxcli iscsi adapter target list
Adapter Target Alias Discovery Method Last Error
——- —————————————— —– —————- ———-
vmhba33 iqn.2006-01.com.openfiler:tsn.99dbad416dbd STATIC No Error

How to see the IP address of SAN server ?

~ # esxcli iscsi adapter target portal list
Adapter Target IP Port Tpgt
——- —————————————— ————- —- —-
vmhba33 iqn.2006-01.com.openfiler:tsn.99dbad416dbd 192.168.112.9 3260 1

Command to check the information related to connection between iscsi target and initiator ?

~ # esxcli iscsi session connection list
vmhba33,iqn.2006-01.com.openfiler:tsn.99dbad416dbd,00023d000002,0
Adapter: vmhba33
Target: iqn.2006-01.com.openfiler:tsn.99dbad416dbd
ISID: 00023d000002
CID: 0
DataDigest: NONE
HeaderDigest: NONE
IFMarker: false
IFMarkerInterval: 0
MaxRecvDataSegmentLength: 131072
MaxTransmitDataSegmentLength: 131072
OFMarker: false
OFMarkerInterval: 0
ConnectionAddress: 192.168.112.9
RemoteAddress: 192.168.112.9
LocalAddress: 192.168.112.10
SessionCreateTime: 07/15/14 18:00:07
ConnectionCreateTime: 07/15/14 18:00:07
ConnectionStartTime: 07/15/14 18:00:07
State: logged_in

How to see the physical adapters used for adapter?

~ # esxcli iscsi physicalnetworkportal list
Adapter Vmnic MAC Address MAC Address Valid Current Speed Max Speed Max Frame Size
——- —— —————– —————– ————- ——— ————–
vmhba33 vmnic0 00:0c:29:f8:9b:93 true 1000 1000 1500
vmhba33 vmnic1 00:0c:29:f8:9b:9d true 1000 1000 1500
vmhba33 vmnic2 00:0c:29:f8:9b:a7 true 1000 1000 1500

How to see the Logical adapters used for adapter?

~ # esxcli iscsi logicalnetworkportal list
Adapter Vmknic MAC Address MAC Address Valid Compliant
——- —— —————– —————– ———
vmhba33 vmk0 00:0c:29:f8:9b:93 true true
vmhba33 vmk1 00:50:56:6f:57:99 true true
vmhba33 vmk2 00:50:56:78:eb:70 true true

**************************Storage*************************

~ # esxcli storage vmfs extent list
Volume Name VMFS UUID Extent Number Device Name Partition
———— ———————————– ————- ——————- ———
esx1:local-1 53c033b3-b6a7b6f3-e8bf-000c29f89b93 0 mpx.vmhba1:C0:T0:L0 1

~ # esxcli storage filesystem list
Mount Point Volume Name UUID Mounted Type Size Free
————————————————- ———— ———————————– ——- —— ———– ———–
/vmfs/volumes/53c033b3-b6a7b6f3-e8bf-000c29f89b93 esx1:local-1 53c033b3-b6a7b6f3-e8bf-000c29f89b93 true VMFS-5 42681237504 27310161920
/vmfs/volumes/5bba5c75-aadf80d0-d554-c0ac58729550 5bba5c75-aadf80d0-d554-c0ac58729550 true vfat 261853184 96395264
/vmfs/volumes/f437c379-825b7d55-84bd-fce072eded7b f437c379-825b7d55-84bd-fce072eded7b true vfat 261853184 261844992
/vmfs/volumes/53bf119b-f4a646b6-e139-000c29f89b93 53bf119b-f4a646b6-e139-000c29f89b93 true vfat 299712512 97705984

~ # esxcli storage core adapter list
HBA Name Driver Link State UID Description
——– ——— ———- ———————————— ——————————————————————————–
vmhba0 ata_piix link-n/a ide.vmhba0 (0:0:7.1) Intel Corporation PIIX4 for 430TX/440BX/MX IDE Controller
vmhba1 mptspi link-n/a pscsi.vmhba1 (0:0:16.0) LSI Logic / Symbios Logic 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI
vmhba32 ata_piix link-n/a ide.vmhba32 (0:0:7.1) Intel Corporation PIIX4 for 430TX/440BX/MX IDE Controller
vmhba33 iscsi_vmk online iqn.1998-01.com.vmware:esx1-6aa0b3dc iSCSI Software Adapter

~ # esxcli storage san iscsi stats get
Adapter: vmhba33
Total Number of Sessions: 1
Total Number of Connections: 1
IO Data Sent: 14644
IO Data Received: 34820
Command PDUs: 119
Read Command PDUs: 109
Write Command PDUs: 0
Bidirectional Command PDUs: 0
No-data Command PDUs: 10
Response PDUs: 119
R2T PDUs: 0
Data-in PDUs: 0
Data-out PDUs: 0
Task Mgmt Request PDUs: 0
Task Mgmt Response PDUs: 0
Login Request PDUs: 1
Login Response PDUs: 1
Text Request PDUs: 0
Text Response PDUs: 0
Logout Request PDUs: 0
Logout Response PDUs: 0
NOP-Out PDUs: 176
NOP-In PDUs: 176
Async Event PDUs: 0
SNACK PDUs: 0
Reject PDUs: 0
Digest Errors: 0
Timeouts: 0
No Tx Buf Count: 0
No Rx Data Count: 0

******************Command for VM operation******************

How to see the VMs running on ESXi ?

~ # esxcli vm process list
Red-Linux1
World ID: 35867
Process ID: 0
VMX Cartel ID: 35864
UUID: 56 4d 2e ed 17 d1 b4 f3-ba d4 72 1d ac ed 77 0f
Display Name: Red-Linux1
Config File: /vmfs/volumes/53c033b3-b6a7b6f3-e8bf-000c29f89b93/Red-Linux1/Red-Linux1.vmx

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s