Random ESXCLI commands

ESXCLI Commands:

Here are some random esxcli commands that are useful when working with vSphere and Hosts.

The commands also are very good to learn when studying to the VCAP6-DCV Deploy, Vmware Certified Advanced Professional 6 certification.

Autodeploy:
add-esxsoftwaredepot c:/files/esxi6.0.zip
get-esximageprofile
new-deployrule -Name ”deployment” -Item ”ESX-image”, ”Staging host” -pattern ”ipv4=192.168.0.10-192.168.0.20”

add-deployrule -Deployrule ”deployment”

get-deployruleset -active
get-executionpolicy
 set-executionpolicy unrestricted

add-esxsoftwaredepot c:/depot/vib-offline_bundle.zip

add-esxsoftwaredepot c:/depot/esxi6.5-offline_bundle.zip
 get-esxsoftwarepackage

get-esximageprofile
 new-esximageprofile -cloneprofile original_profile_name -name "profile_name"
 get-esximageprofile
 add-esxsoftwarepackage -imageprofile "profile_name" -softwarepackage package_name -Community
 export-esximageprofile -imageprofile "profile_name" -filepath c:/depot/esxi-profile_name.iso -exporttoiso –force

Vmware Update Manager Download Service:
vmware-umds -S —enable-host —enable-va
vmware-umds -S —patch-store c:/Patches
vmware-umds -S —add-url https://host_url/index.xml —url-type HOST
vmware-umds -S —add-url https://appliance_url/index.xml —url-type VA
vmware-umds -D
vmware-umds -E —export-store C:/vmware_download

VMFS resignature:
esxcli storage vmfs snapshot list
esxcli storage vmfs snapshot resignature -l ’volume_name’

MASKING:
esxcfg-mpath -l
esxcli storage core claimrule list
esxcli storage core claimrule add -u -t location -A vmhba2 -C 0 -T 0 -L 0 -P MASK_PATH
esxcli storage core claimrule load
esxcli storage core claimrule run
esxcli storage core claiming reclaim -d naa.010101010100101

ATS SCSI locking:
esxcli storage vmfs lockmode list
esxcli storage vmfs set -a -l VMFSlabel -u VMFSUUID
esxcli storage vmfs set -s -l VMFSlabel -u VMFSUUID

Custom TCP/IP stack
esxcli network ip netstack add -N=”CustomTCPstack”

Configure vSS med CLI:
esxcli network vswitch standard list
esxcli network vswitch standard add -v vswitch0 -p 10
esxcli network vswitch standard portgroup add -p testpg -v vswitch0
esxcli network  vswitch standard uplink add -u vmnic1 -v vswitch0
esxcli network vswitch standard portgroup set -a vmnic1 -p testpg
esxcli network ip interface add -i vmk1 -p testpg
esxcli network ip interface ipv4 set -t static -ipv4=192.168.0.10 -n 255.255.255.0 -i vmk1
esxcli network vswitch standard set -mtu=9000 -v vswitch0

ESXTOP:
esxtop -W
esxtop -b -d 2 -n 1 > out.csv
vm-support -p -d 2 -i 1
./reconstruct
tar xvf esxi.tgz
esxtop -R esxidirectory
vscsiStats -l
vscsiStats -s -w 90909

Leave a Reply

Your email address will not be published.