VSphere Troubleshooting and Tricks
VSphere Troubleshooting and Tricks
vSphere Troubleshooting
t i o n
Tips and Tricks i s tribu
or d
t ion
bli c a
r p u
o t fo
n t: N
ont e
1 7 C
o rl d 20
VM w
#VMworld #SER1289BE
Agenda
#SER1289BE CONFIDENTIAL 3
t i o n
i s tribu
or d
Troubleshooting Overview t ion
bli c a
r p u
o t fo
n t: N
ont e
1 7 C
o rl d 20
VM w
Troubleshooting Process
The troubleshooting process consists of the following tasks:
t i o n
i s tribu
or d
t ion
Defining Identifying the cause bli c a Solving
p u
the problem of the problem
t f or the problem
: N o
t en t
• Identifying symptoms 17 Co• nIdentifying possible • Identifying possible
d 2 0
l causes solutions
• Gathering
informationVM
wor • Determining the root • Implementing the
cause best solution
#SER1289BE CONFIDENTIAL 6
Solving the problem …
Can I do it with the Web Client or should I use the esxi shell?
t i o n
tr ibu
What are my choices:
or di s
t ion
bli c a
r p u
• Can I fixNthe
o fo
t problem with the Web, Host or
en t:
ont
vSphere
C
Client?
1 7
o rl d 20 • Do I want or need to use the command
VM w line utilities?
#SER1289BE CONFIDENTIAL 7
t i o n
i s tribu
or d
a t i on
Troubleshooting Tools and pChoices u blic
t f or
: N o
t en t
C on
2 017
o r ld
VMw
Command-line Troubleshooting Choices
Choices to obtain command-line access on a VMware® ESXi™ host:
t i o n
i s tr ibu
VMware vSphere® ESXi™ Shell vSphere or d
t i n
oAssistant
Management
ic
bla (VMA)
p u
t or
f
: o
N • Appliance deployed via ovf
• Can be access via:
ten t
C o n
2 017
• r ld via ALT + F1)
1. The DCUI (if enabled
o
• Contains vCLI package
VMw
• 2. Via putty after enabling ssh. • Does NOT use port 22.
#SER1289BE CONFIDENTIAL 9
The esxcli Command
#SER1289BE CONFIDENTIAL 10
Example: The esxcli vsan Namespace
t i o n
i s tribu
or d
The vSAN related
t ion
commands are found in bli c a
r p u
esxcli vsan
o t fo
n t: N
ont e
1 7 C
o rl d 20
VM w
#SER1289BE CONFIDENTIAL 11
New commands added with every new vSphere release.
t i o n
i s tribu
or d
The new vSAN debug
t ion
related commands are bli c a
r p u
amazing to discover the
o t fo
state of your objects, vms, n t: N
etc. ont e
1 7 C
o rl d 20
VM w
#SER1289BE CONFIDENTIAL 12
Tip: Remember the esxcli esxcli command list command
#SER1289BE CONFIDENTIAL 13
The VMA’s vicfg-* Commands
#SER1289BE CONFIDENTIAL 14
The esxi shell’s esxcfg- Commands are still there
#SER1289BE CONFIDENTIAL 15
Tip: Remember the “-h” option for esxcfg-* commands
#SER1289BE CONFIDENTIAL 16
Manipulating virtual machines with the cli from the V.M.A.?
vmware-cmd
t i o n
• The vmware-cmd command is used to interact with virtual machines.
• vmware-cmd
i s tribu
– The vmware-cmd command is exclusively used for virtual machines. o r d
t io n
bli c a
p u
t f or
: N o
t en t
C on
2 017
o r ld
VMw
#SER1289BE CONFIDENTIAL 17
Example: Listing your Virtual Machines
vmware-cmd -l
t i o n
• Lists the virtual machines that are located on the target host.
i s tribu
Lists virtual machines by path to the .vmx file.
or d
t ion
bli c a
r p u
o t fo
n t: N
ont e
1 7 C
o r l d 20
VM w
#SER1289BE CONFIDENTIAL 18
Tip: Learn More On Your Own
Type vmware-cmd --help to vmware-cmd allows you to The esxi hostnhas a similar
u t i omanipulate vms
see what the command allows start a vm, take snapshots, command
i s t r ib to
you to do. register a vm, etc.
o d vim-cmd vmsvc.
r called
a t i on
u blic
or p
o t f
n t: N
o nte
17 C
2 0
w o rld
V M
#SER1289BE CONFIDENTIAL 19
Manipulating virtual machines from the esxi shell
t i o n
i s tribu
or d
vim-cmd vmsvc can t ion
perform similar bli c a
r p u
tasks from the o t fo
esxi shell. n t: N
ont e
Wondering what 017 C
the destroywor l d 2
VM
option does?
Better try it on
a test vm.
#SER1289BE CONFIDENTIAL 20
Tip: Location of VMware vCenter Server 6.5 Log Files
#SER1289BE CONFIDENTIAL 21
Useful ESXi Host Logs for Troubleshooting
#SER1289BE CONFIDENTIAL 22
Tip: Other Critical Logs to Be Aware Of and how to view them
#SER1289BE CONFIDENTIAL 23
Tip: Remember /var/log
t i o n
i s tribu
or d
t ion
bli c a
r p u
o t fo
Lots of logs available in
n t: N
this directory
ont e
1 7 C
o r l d 20
VM w
#SER1289BE CONFIDENTIAL 24
Collecting Diagnostic Data for
VMware Technical Support
t i o n
Methods for collecting diagnostic information
i s tribu
to send to VMware Technical Support include
or d
the following: t ion
bli c a
• Use the GUI to export files to a log bundle.
r p u
− vSphere Client or vSphere Web Client o t fo
n t: N
• Use the vm-support command
o nt e to collect
1 7 C ESXi host.
information from an individual
d 2 0
w o rl
VM
#SER1289BE CONFIDENTIAL 25
Tip: Running vm-support when engaging support
t i o n
i s tribu
or d
t ion
bli c a
r p u
o t fo
n t: N
ont e
1 7 C
o rl d 20
VM w
#SER1289BE CONFIDENTIAL 26
t i o n
Network Troubleshooting i s tribu
or d
Commands t ion
bli c a
r p u
o t fo
n t: N
ont e
1 7 C
o rl d 20
VM w
Tip: Useful Networking Related Commands
#SER1289BE CONFIDENTIAL 28
Tip: Did You Know That…
#SER1289BE CONFIDENTIAL 29
Tip: Did You Know That…
t i o n
Somebody could disable a vmkernel port
t r i bu
If so, type esxcfg-vmknic -e to re-
with commands like esxcfg-vmknic -D? is
enable the vmkernel port.
r d
on o
c a t i
r p ubli
tf o
: N o
t en t
17 Con
2 0
w o rld
V M
#SER1289BE CONFIDENTIAL 30
Tip: Rebuilding the Management Network from scratch
#SER1289BE CONFIDENTIAL 31
Need a packet sniffer? Remember pktcap-uw
t i o n
i s tribu
or d
t ion
bli c a
r p u
There is a built-in packet o t fo
n t: N
sniffer called pktcap-uw
ont e
and an older one called
1 7 C
tcpdump-uw.
o r l d 20
VM w
#SER1289BE CONFIDENTIAL 32
t i o n
i s tribu
or d
Storage Troubleshooting t ion
bli c a
r p u
o t fo
n t: N
ont e
1 7 C
o rl d 20
VM w
Tip: Did You Know That…
You can see how many dastastores exist and how full
t i o n
the datastores are? This command displays vmfs, nfs,
i s tribu
vsan and vvol datastores. There is also a vdf –h or d
t ion
command.
bli c a
r p u
o t fo
n t: N
ont e
1 7 C
o rl d 20
VM w
#SER1289BE CONFIDENTIAL 34
Tip: Did You Know That…
t i o n
i s tribu
or d
t ion
You can easily view all
bli c a
sorts of information
r p u
with esxcli?
o t fo
n t: N
ont e
1 7 C
o r l d 20
VM w
#SER1289BE CONFIDENTIAL 35
Tip: Use esxcli Storage Core Device Smart for SSD information
vSphere 6.5
Includes t i o n
i s tribu
Use this command to
or d
t ion
retrieve data about a
bli c a
specific SSD device. r p u
o t fo
Critical for vSAN,Flash
n t: N
Read Cache or any ont e
1 7 C
d 20
datastore using SSDs.
o rl
VM w
36 36
Tip: Be familiar with partedUtil
t i o n
i s tribu
or d
partedUtil is the command
t ion
that partitions luns. It can also
bli c a
r p u
create, resize and delete
o t fo
partitions.
n t: N
ont e
1 7 C
o r l d 20
VM w
37
Tip: Suspect metadata corruption?
t i o n
i s tribu
voma is the on-disk metadata or d
t ion
analyzer for vmfs datastores.
bli c a
r p u
o t fo
n t: N
ont e
1 7 C
o rl d 20
VM w
#SER1289BE CONFIDENTIAL 38
t i o n
Troubleshooting Clusters and i s tr ibu
o r d
Performance t io n
bli c a
r p u
o t fo
n t: N
ont e
1 7 C
o rl d 20
VM w
vSphere HA
A reliable network connection between the hosts and VMware® vCenter Server™
is essential for enabling vSphere HA.
t i o n
i s tr ibu
or d
a t i on Heartbeat
u blic Datastores
r p
o t fo
FDM
n t:
FDM N FDM
C onte
vpxa hostd
1 7 vpxa hostd vpxa hostd
orl d 20
ESXi host (slave) ESXi host (slave) ESXi host (master)
VMw Management
Network
vCenter vpxd
Server
40
Tip: Remember F.D.M
t i o n
There is a log for HA that
i s tribu
you can’t see with the Web or d
t ion
or vSphere Client?
bli c a
r p u
o t fo
n t: N
ont e
1 7 C
o r l d 20
VM w
#SER1289BE CONFIDENTIAL 41
Tip: Did You Know That…
You can stop, start or restart the HA service from the cli if needed?
t i o n
i s tribu
or d
t ion
bli c a
r p u
o t fo
n t: N
ont e
1 7 C
o r l d 20
VM w
#SER1289BE CONFIDENTIAL 42
Tip: You can restart all services at once if needed …
t i o n
i s tribu
or d
t ion
bli c a
r p u
o t fo
Remember services.sh restart
n t: N
ont e
1 7 C
o r l d 20
VM w
#SER1289BE CONFIDENTIAL 43
Tip: Did You Know That…
esxtop is an amazing tool for esxtop has options for CPU esxtop has annoption for vSAN
u t i o
performance troubleshooting? (c), RAM (m), Disk (d,u,v)
i s ib
(-x option)?
tr
and Network (n) related
or d
statistics? tion
l i c a
pu b
for
N o t
en t:
C ont
1 7
o rl d 20
VM w
#SER1289BE CONFIDENTIAL 44
Tip: Did You Know That…
t i o n
i s tribu
or d
t ion
bli c a
r p u
o t fo
esxtop has built-in help?
n t: N
ont e
1 7 C
o r l d 20
VM w
#SER1289BE CONFIDENTIAL 45
Tip: Did You Know That…
t i o n
i s tribu
or d
You can add more
t ion
output to esxtop by bli c a
r p u
pressing “f”?
o t fo
n t: N
For example, you can ont e
1 7 C
add NUMA related
information (G Option)orld
20
VMw
#SER1289BE CONFIDENTIAL 46
Tip: Learn the vsish command and its capabilities
t i o n
vsish has hundreds of i s tribu
or d
subcommands.
t ion
bli c a
Just type the command and r p u
take a look … o t fo
n t: N
ont e
You can type commands like 7
1 C
2 0
cd to change directories
o r ld and
Mw
get to view information.
V
#SER1289BE CONFIDENTIAL 47
Tip: Learn the vsish command and its capabilities
t i o n
vsish has hundreds of i s tribu
or d
subcommands.
t ion
bli c a
r p u
o t fo
n t: N
Just type the command and
ont e
take a look …
1 7 C
o r l d 20
VM w
#SER1289BE CONFIDENTIAL 48