Tuesday, October 29, 2019

Some cool esxcli iscsi commands

1. Is iSCSI enabled?

# esxcli iscsi software get
true

2. Which vmhba is used for iSCSI?

# esxcli iscsi adapter list
Adapter  Driver     State   UID                                         Description
-------  ---------  ------  ------------------------------------------  ----------------------
vmhba65  iscsi_vmk  online  iqn.1998-01.com.vmware:sa-esxi-02-400f0480  iSCSI Software Adapter

3. Which vmkernel port is used for iSCSI?

# esxcli iscsi networkportal list
vmhba65
   Adapter: vmhba65
   Vmknic: vmk3
   MAC Address: 00:50:56:01:c1:ba
   MAC Address Valid: true
   IPv4: 172.20.13.52
   IPv4 Subnet Mask: 255.255.255.0
   IPv6:
   MTU: 1500
   Vlan Supported: true
   Vlan ID: 0
   Reserved Ports: 63488~65536
   TOE: false
   TSO: true
   TCP Checksum: false
   Link Up: true
   Current Speed: 10000
   Rx Packets: 2888785
   Tx Packets: 838121
   NIC Driver: nvmxnet3
   NIC Driver Version: 2.0.0.27
   NIC Firmware Version: NA
   Compliant Status: compliant
   NonCompliant Message:
   NonCompliant Remedy:
   Vswitch: dvs-SA-Datacenter
   PortGroup: DvsPortset-0
   VswitchUuid: 50 2b 40 6e 00 70 b4 d4-66 93 6e 79 fa 6b bb c4
   PortGroupKey: dvportgroup-55
   PortKey: 8
   Opaque Network Id:
   Opaque Network Type:
   External Id:
   Duplex:
   Path Status: active

Some cool esxcli system commands

1. How to view your vSphere version

# esxcli system version get
   Product: VMware ESXi
   Version: 6.7.0
   Build: Releasebuild-8169922
   Update: 0
   Patch: 0

2. To view hostname and domain name

# esxcli system hostname get
   Domain Name: vclass.local
   Fully Qualified Domain Name: sa-esxi-02.vclass.local
   Host Name: sa-esxi-02

3. To view local users

# esxcli system account list
User ID  Description
-------  -------------------------------------------
root     Administrator
dcui     DCUI User
vpxuser  VMware VirtualCenter administration account

4. To view permissions for local users

# esxcli system permission list
Principal  Is Group  Role   Role Description
---------  --------  -----  ------------------
dcui          false  Admin  Full access rights
root          false  Admin  Full access rights
vpxuser       false  Admin  Full access rights

5. To view specific advanced settings

# esxcli system settings advanced list -t UserVars | more
   Path: /UserVars/ActiveDirectoryPreferredDomainControllers
   Type: string
   Int Value: 0
   Default Int Value: 0
   Min Value: 0
   Max Value: 0
   String Value:
   Default String Value:
   Valid Characters: *
   Description: Preferred Domain Controllers for Active Directory

   Path: /UserVars/ActiveDirectoryVerifyCAMCertificate
   Type: integer
   Int Value: 1
   Default Int Value: 1
   Min Value: 0
   Max Value: 1
   String Value:
   Default String Value:
   Valid Characters:
   Description: Enable or disable verification of SSL certificate for vSphere Authentication Proxy server

   Path: /UserVars/ESXiShellTimeOut
   Type: integer
   Int Value: 0
   Default Int Value: 0
   Min Value: 0
   Max Value: 86400
   String Value:
   Default String Value:
   Valid Characters:
   Description: Time before automatically disabling local and remote shell access (in seconds, 0 disables).  Takes effect after the services are restarted.
...