Generate vCenter Server and ESXi log bundles

by admin

When raising incidents with VMware technical support it is likely that you will need to generate log bundles to aid the investigation.

Generating Log Bundles for ESXi and vCenter

Using the vSphere client, either connected to vCenter or directly to an ESXi host you can Export System Logs, from the option on the File menu:

log_bundle_export

You can then choose what diagnostic data you wish to export:

log_bundle_export2

The next screen will allow you to choose a download location, then the logs will be gathered and downloaded.

PowerCLI

You can also generate log bundles using PowerCLI by running the following command once you are connected to either vCenter or a host:

Get-Log -Bundle -DestinationPath <path>

log_bundle_export3

Once its complete you will have the logs collected into a single .tgz file:

log_bundle_export4

 vm-support

Another way of generating host log bundles is by running the vm-support script. You can do this via a SSH or console connection to a host, by running vm-support:

log_bundle_export5

There are various options/switches you can specify when running vm-support, as shown below:

/var/log/vmware # vm-support -h
Usage: vm-support [options]

Options:
  -h, --help            show this help message and exit
  -g GROUPS, --groups=GROUPS
                        Gather data from listed groups
  -a MANIFESTS, --manifests=MANIFESTS
                        Gather from listed manifests
  -e EXCLUDEMANIFESTS, --excludemanifests=EXCLUDEMANIFESTS
                        Exclude the listed manifests
  --listmanifests       List available manifests
  -G, --listgroups      List available manifest groups
  -t, --listtags        List available manifest tags
  -p, --performance     Gather performance data
  -d DURATION, --duration=DURATION
                        Duration of performance monitoring (in seconds)
  -i INTERVAL, --interval=INTERVAL
                        Interval between performance snapshots
  -v VM, --vm=VM        Gather detailed information about this specific VM (ie
                        --vm )
  -V, --listvms         List currently registered VMs
  -w WORKINGDIR, --workingdir=WORKINGDIR
                        Directory to create .tgz in
  -D, --dryrun          Prints out the data that would have been gathered
  -s, --stream          stream data to stdout
  -q, --quiet           Output only the location of the bundle
  -E ERRORFILE, --errorfile=ERRORFILE
                        Prints (non-fatal) errors to specified file (overrides
                        --quiet and --stream)
  --loglevel=LOGLEVEL   Set logging to specified level: 0-50 (0=most verbose)
  --version             Display the vm-support version
  -l, --listfiles       List all files gathered by vm-support

As an alternative to running this directly from a CLI prompt, you can stream the log bundle to a management server or VMA by running:

ssh root@ESXHostnameOrIPAddress vm-support -s > vm-support-Hostname.tgz

vi-admin@localhost:~> ssh root@192.168.0.235 vm-support -s > vm-support-Hostname.tgz
The authenticity of host '192.168.0.235 (192.168.0.235)' can't be established.
RSA key fingerprint is 65:fd:99:82:d6:52:43:d7:37:d9:4f:40:8f:f2:bc:49.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.0.235' (RSA) to the list of known hosts.
Password:

Or you can use a web browser to generate and download the log bundle:

https://root:password@10.11.12.13/cgi-bin/vm-support.cgi

Or

wget https://root:password@10.11.12.13/cgi-bin/vm-support.cgi

bash$ wget https://root:Pa55w0rd@192.168.0.235/cgi-bin/vm-support.cgi
--14:46:12--  https://root:*password*@192.168.0.235/cgi-bin/vm-support.cgi
           => `vm-support.cgi'
Connecting to 192.168.0.235:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [binary/octet-stream]

    [                            <=>      ] 29,367,761   375.57K/s

14:47:28 (375.57 KB/s) - `vm-support.cgi' saved [29367761]

bash$

Useful Links and Resources

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1010705

http://www.vmware.com/files/pdf/techpaper/VMware-Customizing-vm-support-vSphere50.pdf


Keep up to date with new posts on Buildvirtual.net - Follow us on Twitter:
Be Sociable, Share!

{ 1 comment… read it below or add one }

ken June 1, 2016 at 3:19 pm

These command options are no longer valid for ESXi 5.5 and up.

Reply

Leave a Comment

*

Previous post:

Next post: