## install esxcli in vmware
# download an copy tarball to /opt/vmware
# Install as root for all users
mkdir /opt/vmware
tar zxf esxcli-6.7.0-NNNNNNNN-lin64.tgz -C /opt/vmware

# Add the installed esxcli binary to the path:
ln -s /opt/vmware/esxcli/esxcli /usr/bin/esxcli

# Run the command to confirm successful installation:
esxcli --version

# Check the precise ESXi version and build number, including the number of installed updated and patches:
esxcli system version get

### system
# get command list on command line
esxcli esxcli command list

# Get information about memory
esxcli hardware memory get

# Display PCI device passthru configuration
esxcli hardware pci list
esxcli hardware pci list | grep i 'device name'

# Get information about the platform
esxcli hardware platform get

# Display the date and time when this system was first installed
esxcli system stats installtime get


### storage
# Get the systems boot device
esxcli system boot device get

## storage adaptors
# Scanning Storage Adapters
esxcli storage core adapter rescan --all

# List all the SCSI Host Bus Adapters on the system.
esxcli storage core adapter list

# Retrieving SMART Information
esxcli storage core adapter device list
esxcli storage core device smart get -d <device>

# list all of the partitions on the system that have a partition type matching the VMware Core partition type
esxcli system coredump partition list

esxcli storage core device list
esxcli storage core device capacity list
esxcli storage filesystem list -> free !
esxcli storage nfs41 list
esxcli storage vmfs extent list

### network settings
esxcli network nic list
esxcli network ip interface ipv4 get
esxcli network ip dns server list
esxcli network ip route ipv4 list

### firewall settings
esxcli firewall get
esxcli firewall ruleset list
esxcli ip connection list


# Show the current global configuration values
esxcli system syslog config get


### time settings
# Display the current system time
esxcli system time get

# Display Network Time Protocol configuration
esxcli system ntp config get


# Check the hostname of an ESXi server:
esxcli system hostname get

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

# Check the SNMP configuration:
esxcli system snmp get

#####################
### reboot the system
# Enter the ESXi host to the maintenance mode:
esxcli system maintenanceMode set --enable yes

# Exit the maintenance mode:
esxcli system maintenanceMode set --enable no

# After entering an ESXi host to the maintenance mode, you can shut down or reboot the host.
# Power off an ESXi host:
esxcli system shutdown poweroff

# The command for rebooting the host is similar:
esxcli system shutdown reboot

# You can also set a delay and write a reason of rebooting the host to be saved in system logs:
esxcli system shutdown reboot -d 60 -r “RAID 5 Rebuilding”
#####################



# differnet
esxcfg-scsidevs -c
esxcfg-mpath -b

esxcli software acceptance set
esxcli software acceptance get
esxcli software vib get
esxcli software vib list
esxcli system maintenanceMode get
esxcli system permission list
esxcli vsan cluster get
esxcli vsan datastore list
esxcli vsan datastore name get

### VMs
# list all running virtual machines
esxcli vm process list

## StorCLI on VMware vSphere
# install StorCLI on VMware vSphere
https://www.thomas-krenn.com/de/wiki/StorCLI_unter_VMware_vSphere_installieren
esxcli software vib install -v=/vmware-storcli-007.0606.0000.0000.vib --no-sig-check

# show
cd /opt/lsi/storlsi
./storcli /c0 show all
führt zum Ergebnis.

# set alarm of controller c0
./storcli /c0 set alarm=silence
./storcli /c0 set alarm=off
./storcli /c0 set alarm=on

# query rebuild status
./storcli /c0 /eall /sall show rebuild


# links
https://developer.vmware.com/web/tool/6.7u2/esxcli
https://developer.vmware.com/web/tool/7.0/esxcli
https://developer.vmware.com/docs/11790/getting-started-with-esxcli
https://www.thomas-krenn.com/de/wiki/Esxcli

# ESXCLI 7.0 U2 Concepts and Examples
https://developer.vmware.com/docs/13462/esxcli-7-0-u2-concepts-and-examples

# command reference
https://developer.vmware.com/docs/6676/vsphere-command-line-interface-reference
https://developer.vmware.com/docs/13492/esxi-7-0-u2-esxcli-command-reference/reference.html

# install vSphere
https://www.thomas-krenn.com/de/wiki/StorCLI_unter_VMware_vSphere_installieren
esxcli software vib install -v=/vmware-storcli-007.0606.0000.0000.vib