Please enable Javascript for better experience...
 
Useful Commands for VCAP-DCV Exam Preparation
By Pranay Jha | Apr 29, 2020 | In Tips | Total Views [ 2312 ]
(0 Like)
Rate

CLI - How to reset VI admin password on VMA?

esxcli --help

vifp --help

vifptarget --help

sudo domain join cli join vclass.local

sudo domainjoin cli leave

sudo domainjoin cli query

sudo passwd vi-user

vifp addserver esxi01.vclass.local --authpolicy fpauth --username root

vifp removeserver esxi01.vclass.local --authpolicy fpauth --username root

vifp addserver esxi01.class.local --authpolicy fpath

vifptarget -s (set)

vifptarget -c (Back)

vicfg-ntp --list

vicfg-ntp --add dc01

vmkfstool -i /vmfs/volumes/lun01/001.vmdk /vmfs/volumes/lun02/001.vmdk

 

CLI - How to enable SNMP?

vicfg-snmp -s

vicfg-snmp -t 172.168.199.5@162/Public

vicfg-snmp -E (To enable SNMP)

vicfg-snmp -T(Test it)

vicfg-snmp -p 160 (Configure snmp for pooling)

 

CLI - How to Check Certificates of ESXi Hosts?

/etc/vmware/ssl

Backup rui.key(keyfile), rui.crt(certificate file)

To Generate new certication:-

/sbin/generate-certificates

Restart the host after installing new certificates

 

How to Check vCenter Certificates:-

C:\Program Data\VMware\Vmware Virtual Center\SSL

 

SSL Timeout Value:

 

vmkfstools -P /vmfs/volumes/Silver (Get Info)

vmkfstools -c 10m -d thin "/vmfs/volumes/Silver" Pranay.vmdk (Create Disk)

 

vscsiStats -l (get world ID)

vscsiStats -s -w 1290 (Enable collection)

vscsiStats -p latency (Histographical Data)

vscsiStats -x (Stop vscsiStats Collection)

vscsiStats -p latency -c (Generate comma delimited output)

vscsiStats -p seekDistance (Histogram)

 

 

Failed to create virtual disk: Operation not permitted

Could not reach isolation address: non specified (1028295)

Cannot synchronize host "host name" Operation timed out.

VscsiStats: No valid stats for worldgroup 7825, handle 8192.  Please enable vscsiStats collection

no vmkcore disk partition is available and no netowrk coredump server has been configured. HOst core dumps cannot be saved.

 

CLI – How to Configure Claim Rule for Datastore in vSphere environment?

esxcfg-scsidevs -m

esxcfg-mpath -L | grep F405E46494C4542517079784C413D2455697B6D2C6568305

esxcli storage core claimrule list

esxcli storage core claimrule add -r 501 -t location -C 0 -T 0 -L 2 -P MASK_PATH

esxcli storage core claimrule add -r 502 -t location -C 0 -T 5 -L 3 -P MASK_PATH

esxcli storage core claimrule list

esxcli storage core claimrule load

esxcli storage core claiming reclaim -d t10.F405E46494C4542517079784C413D2455697B6D2C6568305

esxcfg-mpath -L | grep F405E46494C4542517079784C413D2455697B6D2C6568305

esxcli storage core claimrule remove -r 501

esxcli storage core claimrule remove -r 502

esxcli storage core claimrule list

esxcli storage core claimrule load

esxcli storage core claimrule list

esxcli storage core claiming unclaim -t location -C 0 -T 0 -L 2

esxcli storage core claiming unclaim -t location -C 0 -T 5 -L 3

esxcli storage core claimrule load

esxcli storage core claimrule list

 

CLI - Image Customization Process

 

Unzip ESXi Offline Bundle in C:\ESX-Depot

Add-ESXSoftwareDepot C:\ESX-Depot

Get-ESXImageProfile

New-ESXImageProfile -CloneProfile ESXi-Standard -name VCAP-Profile

Get-ESXImageProfile

Get-ESXSoftwarePackage

Add-ESXSoftwareDepot  Z:\qLogic\Offlinebundle.zip

Add-ESXSoftwarePackage -ImageProfile VCAP-Profile -SoftwarePackage net-qlge

Get-ESXImageProfile VCAP-Profile | Select -ExpandProperty VIBLIST

Remove-ESXSoftwarePackage -ImageProfile VCAP-Profile -SoftwarePackage net-qlge

Export-ESXImageProfile - ImageProfile  VCAP-Profile -ExportToISO C:\VCAP_ESXi.iso

Export-ESXImageProfile - ImageProfile VCAP-Profile -ExportToBundle C:\VCAP_ESXi.zip

 

CLI - How to Configure Auto Deploy?

=================

Reserve MAC address of host in DHCP Server

Configure option for 066 and 067 in DHCP reservation.

066 Boot Server: VC IP Address

067 Bootfile Name: undionly.kpxe.vmhardwired

Start TFTP Service on the vCenter Server ?

 

============================

 

Configure TFTP.

Add ESXi Image Depot:-

Add-ESXSoftwareDepot C:\ESX-Depot

Get-ESXImageProfile

New-ESXImageProfile -CloneProfile ESXi-Standard -name VCAP-Profile

connect-viserver vc03 (Bcoz it talks to Autodeploy Server

 

Three AutoDeploy Rules we have to create in order:-

Create Image Rule:-

New-DeployRule -Name Image_Rule -Item VCAP-Profile -Pattern "ipv4=172.20.10.152-172.20.10.200"

or

New-DeployRule -Name ContainerRule -Item VCAP-Profile -Pattern -allhosts

 

Add-DeployRule Image_Rule

 

Create Cluster Rule:- ( Which cluster we want to join)

Get-Cluster (2 Clusters Available: AutoDeploy & Cybertron)

New-DeployRule -Name Cluster_Rule -Item AutoDeploy -Pattern "ipv4=172.20.10.152-172.20.10.200"

or

New-DeployRule -Name Cluster_Rule -Item AutoDeploy -allhost

 

Add-DeployRule Cluster_Rule

 

Create HostProfile Rule:-(Which Host Profile we want to apply)

Get-VMHostProfile (Result: LabHostProfile, VCAP-Demo-Lab)

New-DeployRule -Name Assign_Profile -Item LabHostProfile -Pattern "ipv4=172.20.10.152-172.20.10.200"

Add-DeployRule Assign_Profile

 

Set-DeployRuleSet -Deploy -NoActivate (To disable deploy rule)

 

New-DeployRule -Name ContainerRule -Item Auto-Deploy-Hosts -allhosts

 

Get-LicenseDataManager | Get-Datacenter -Name VCAP-Lab

New-DeployRule -Name ImageRule -Item ESXi-5.1.0-799733-standard -allhosts

Get-DeployRule

New-DeployRule -Name ProfileRule -Item "Host Profile - ESXi02" -allhosts

Set-DeployRule ImageRule -Pattern "ipv4=172.20.10.152-172.20.10.200"

New-DeployRule -Name ContainerRule -Item Auto-Deploy-Hosts -allhosts

Get-DeployRule

Get-DeployRuleSet

=================

Other Deploy cmdlet:-

Get-DeployRuleSet (Get the current ruleset that we just loaded)

Set-DeployRuleSet (Allow to set the list of rules in the ruleset)

Set-DeployRule (Update and existing rule)

Get-VMHostMachineRules (Check to see which rules match on a given host)

Repair-DeployImageCache (Use to rebuild the auto deploy)

 

----

Get-AutoDeployRule

Add-DeployRule

Apply-ESXImageProfile

Copy-DeployRule

Get-DeployOption

Get-DeployRule

Get-DeployRuleSet

Get-VMHostAttributes

Get-VMHostImageProfile

Get-VMHostMatchingRules

New-DeployRule

Remove-DeployRule

Repair-DeployImageCache

Repair-DeployRuleSetCompliance

Set-DeployOption

Set-DeployRule

Set-DeployRuleSet

Switch-ActiveDeployRuleSet

Test-DeployRuleSetCompliance

 

==================================

esxcli storage nmp device list

Newly aded iSCSI datastores claimed by the detault AA SATP will get the RR PSP:-

esxcli storage nmp satp set -s VMW_SATP_DEFAULT_AA -P VMW_PSP_RR

Change SATP to existing device:-

esxcli storage nmp device set -d t10.F405E46494C45425557527C444E4D21386A7F6D255D46423 -E

Set IOPS to 1:-

esxcli storage nmp psp roundrobin deviceconfig get -d naa.xxxxx

esxcli storage nmp psp roundrobin deviceconfig set -d naa.xxxxx -t iops -I 1

 

CLI - How to configure Storage Filtering?

Search in pdf vpxd.filter

config.vpxd.filter.vmfsFilter

config.vpxd.filter.rdmFilter

config.vpxd.filter.SameHostAndTransportFilter

config.vpxd.filter.hostRescanFIlter

 

CLI – How to Configure Syslog?

Enable firewall for syslog from Configuration>>Security Profile>>Firewall>>Syslog

enter Syslog server name in advance settings

#esxcli system syslog reload

 

#esxcli system syslog config set --loghost=10.10.10.10 (or tcp://10.10.10.10:514 or udp://10.10.10.10:514)

#esxcli system syslog reload

#esxcli network firewall ruleset set -r syslog -e true

#esxcli network filewall refresh

 

CLI - How to Set Discovery Protocol CDP on standard switch?

esxcli network vswitch standard set -v vswitch4 -c advertise

esxcli network vswitch standard set- v vswitch4 -c both

esxcli network vswitch standard set -v vswitch4 -c Listen

 

For configuring CDP & LLDP on vDS, use GUI:-

dVS>>>Properties>>>Advance>>>Discovery Protocol

 

CLI – How to change HA Slot Size?

das.slotCpuInMhz , value 32 MHz by default

das.slotMemInMB, 20 MB by default

 

Other advance settings:-

das.heartbeatDsPerHost (Default is 2, however max override can be 5)

das.vmMemoryMinMb (Use for memory slot size if no reservation is present, default of 0)

das.slotMemInMb (Upper value of a memory slot size,)

das.vmCpuMinMhz (Use for CPU slot size if no reservation is present, default of 32)

das.slotCpuInMhz

da.isolationAddress

das.isolationAddressX

das.useDefaultIsolationAddress

 

CLI - How to Configure SSL Certificate:-

 

SSH Time out:-

Uservars->ESXiShellTimeOut

UsersVars.ESXiShellTImeOut

 

For checking of SSL: -

Home>>>Administration>>vCenter Server Setting>>>SSL>>Check/Uncheck box

 

# cd /etc/vmware/ssl

#ls -ltr

#cp rui.crt rui_backup.crt(Backup of existing certificate)

#cp rui.key rui_backup.key(Backup of existing certificate)

#generate-certificates

#/etc/init.d/hostd restart (Restart mgmt agent)

 

≠       To deploy ssl vertificate:-

≠       SImple copy *crt and *.key in same directory "/etc/vmware/ssl"

≠       Rename it as rui.key and rui.crt

≠       restart mgmt agent.

 

SSL Timeouts: -

vi /etc/vmware/hostd/config.xml

Add timeout value:-

<readTimeoutMs>15000<readTimeoutMs>

<handshakeTimeoutMs>15000<handshakeTimeoutMs>

 

Restart mgmt agent

 

<readTimeoutMs>15000<readTimeoutMs>

<handshakeTimeoutMs>15000<handshakeTimeoutMs>

 

Password Policy: -

vi /etc/pam.d/passwd

password   requisite    /lib/security/$ISA/pam_passwdqc.so retry=3 min=8,8,8,7,6

 

Search "PAM" in security guide.

password   requisite    /lib/security/$ISA/pam_passwdqc.so retry=N min=N0, N1, N2, N3, N4

N = Retry,

N0=length of password

N1=Length if using two character classes

N2=Length of word inside passphrase

N3=Length if using three character classes

N4=Length if using four character classes

 

=========================

CLI - How to get VAAI Status:

esxcli storage core device vaai status get

 

Heap Size:

Host>>>Advance Setting>>>Net>>>Net.TcpipHeapSize

 

Max NFS Volumes:

Host>>>Advance Setting>>>NFS>>>NFS.MaxVolumes

 

CLI - How to Re-Signature LUN?

# esxcli storage vmfs snapshot list

# esxcli storage vmfs snapshot mount -l "replicated_lun"

# esxcli storage vmfs snapshot resignature -l "replicated_lun"

 

CLI - How to export ESXTOP output to file?

to save Custom esxtop...edit by F...save by W...path /tmp/pranay

to use...esxtop -c /tmp/pranay

 

CLI - How to Collect vmsupport logs?

vm-support -p -i 10 -d 60

 

FT Requirement in vSphere 5.x?

  • SSL Setting should be check marked in vCenter Server Settings
  • FT logging and vMotion networks must be configured.
  • Shared storage
  • Linked clone are not support
  • 1 vCPU
  • Can't snapshot a FT Machine
  • No CD ROM/USB
  • NPIV is not supported.
  • Thick provisioned eager zero
  • IPv6 is not supported
  • serial or parellel port
  • video devce that have 3D enabled are not supported

 

CLI - How to check vpxd-profiler logs?

https://172.20.10.17/vod/index.html

 

CLI - How to Check Host Logs?

https://172.20.10.41/host

 

How to Configure Syslog Server?

esxcli system syslog config logger list

esxcli system syslog config set

esxcli system syslog config set

esxcli system syslog config set --default-rotate=16

 

Powershell:-

cd power

cd vmstore:

dir (List datastores)

Get-VM -Location ResourcePool01 | Set-VM -MemoryGB2 -NumCPU 2

 

CLI - How to get disk info?

df -h

vdf

CLI - How to Add SSD Tagging?

SSD Tagging:- Device will show as SSD if even the are Non-SSD

esxcfg-scsidevs -m

esxcli storage nmp device list

esxcli storage nmp satp rule add -s VMW_SATP_DEFAULT_AA -d naa.xxxx -o enable_ssd

esxcli storage core claiming unclaim -t device -d naa.xxx

esxcli storage core claimrule load esxcli storage core claimrule run

Resignature LUN:

# esxcli storage vmfs snapshot list
# esxcli storage vmfs snapshot mount -l "replicated_lun"
# esxcli storage vmfs snapshot resignature -l "replicated_lun"

Thanks for visiting here. Share this article if you found it useful.
Like Facebook Page https://www.facebook.com/VMwareInsight/
Connect to twitter https://twitter.com/imPranayK
Subscribe my Channel https://www.youtube.com/vmwareinsight
Connect over Linkedin https://in.linkedin.com/in/impranayk
Share this on Social Media

About the Author

Pranay Jha
Pranay Jha
Founder, Contributer VMwareInsight.com

Public profile: user/profile/99900000


Follow me

facebook linkedin twitter G+ VMTN youtube

Thank you for visiting my profile. I am Pranay Jha, bring along a total of 11+ years of extensive experience with me in Information Technology sector for organizations from small business to large enterprises, wherein my current assignment I am associated with IBM as a Technical Solution Architect for Virtualization platform. I am vExpert x 3 (16/17/18), VCIX-DCV, VCAP5/6-DCD, VCAP5-DCA, VCP7-CMA, VCP5/6-DCV, VCA-DCV, VCA-Cloud, VSP, VCE-CIA, MCITP, MCSE, MCSA(Messaging). I am also an Independent blogger and founder of http://vmwareinsight.com and https://cloudpathshala.com. I can be reached via email at pranay1988jha@gmail.com or Direct Message via Contact Us form.

 
Please SignUp/Login to comment...

Or comment as anonymous...
* Name
* Email ID
Comment
 
Sponsors
 
 
 
 
 
Facebook Likes