Collecting diagnostic information for VMware vCenter Server and ESX/ESXi using the vSphere PowerCLI

Purpose

VMware Technical Support routinely requests the diagnostic information from you when a support request is addressed. This diagnostic information contains product specific logs and configuration files from the host on which the product is run. This information is gathered using a specific script or tool within the product.
 
This article provides the procedures for obtaining this diagnostic information for VMware vSphere vCenter Server and/or ESX/ESXi hosts using VMware vSphere PowerCLI. For other methods of collecting the same information, see Collecting diagnostic information for VMware ESX/ESXi using the vSphere Client (653) or Collecting diagnostic information for VMware ESX/ESXi using the vm-support command (1010705).

The diagnostic information obtained by using this article is uploaded to VMware Technical Support. To uniquely identify your information, use the Support Request (SR) number you receive when you create the new SR.

  • Instructions for opening a support request can be found online at www.vmware.com/support/policies/howto.html.
  • Instructions for how to upload your support files can be found at Uploading diagnostic information to VMware (1008525).
  • Instructions for obtaining diagnostic information for other VMware products can be found at Collecting diagnostic information for VMware products (1008524).

Resolution

VMware vSphere PowerCLI can be used to download a vc-support or vm-support log bundle from VMware vSphere vCenter Server and/or ESX/ESXi hosts, or to view or search the individual log files stored on the host. For more information on VMware PowerCLI, see the VMware vSphere PowerCLI Documentation.

Connecting to vCenter Server or an ESX/ESXi host with PowerCLI

To run specific vSphere PowerCLI cmdlets and perform administration or monitoring tasks, you must connect to vCenter Server or an ESX/ESXi host.

  1. Launch the vSphere PowerCLI.
  2. In the vSphere PowerCLI console window, establish a connection to an ESX/ESXi host or a vCenter Server using the command:

    Connect-VIServer -Server HostnameOrIPAddress

    The output appears similar to: 

    Name                    Port     User
    ----                    ----     ----
    HostnameOrIPAddress     443      Username


    Note: If the certificate is not trusted, a warnings displays. Depending on your security policy, these warnings can be ignored.

Downloading a diagnostic log bundle from vCenter Server

To download a vc-support diagnostic log bundle from vCenter Server:

  1. Enter the command:

    Get-Log -Bundle -DestinationPath c:\Storage\Location\

    The output appears similar to: 

    Data
    ----
    C:\Storage\Location\vc-support-nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn.tgz


  2. No progress bar is provided for the command. When complete, upload the logs to the FTP site. For more information, seeUploading diagnostic information to VMware (1008525).

Download a diagnostic log bundle from an ESX/ESXi host

To download a vm-support diagnostic log bundle from an ESX/ESXi host managed by vCenter Server:

  1. Enter the command:

    Get-VMHost HostNameOrIP | Get-Log -Bundle -DestinationPath c:\Storage\Location\

    The output appears similar to: 

    Data
    ----
    C:\Storage\Location\vm-support-nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn.tgz


  2. No progress bar is provided for the command. When complete, upload the logs to the FTP site. For more information, seeUploading diagnostic information to VMware (1008525).

Displaying the content of specific log files on an ESX/ESXi host

To review a specific log file on an ESX/ESXi host, use the Get-LogType and Get-Log commandlets:

  1. Determine what log files are exposed by a given vCenter Server or ESX/ESXi host using the Get-LogType commandlet. Logs are identified by a Key name.

    • For the connected vCenter Server: Get-LogType
    • For a specific ESX/ESXi host: Get-VMHost HostNameOrIP | Get-LogType

    The output appears similar to: 

    Key               Summary
    ----              -------
    hostd             Server log in 'plain' format
    messages          
    Server log in 'plain' format
    vmkernel          
    Server log in 'plain' format
    vmksummary        
    Server log in 'plain' format
    vmkwarning        
    Server log in 'plain' format
    vpxa              vCenter agent log in 'plain' format


  2. View a specific log on the the given vCenter Server or ESX/ESXi host, specifying a Key from Get-LogType:

    • For the connected vCenter Server: Get-Log VCLogKey | Select -expand Entries | More
    • For a specific ESX/ESXi host: Get-VMHost HostNameOrIP | Get-Log HostLogKey | Select -expand Entries | More

    Example:

    Get-VMHost 10.11.12.13 | Get-Log hostd | Select -expand Entries | More

    Section for VMware ESXi, pid 4993, version=4.1.0, build=build-260247, option=Release
    [2009-09-17 10:41:07.886 2EB82B90 verbose 'Cimsvc'] Ticket issued for CIMOM version 1.0, user root
    [2009-09-17 10:41:09.340 2EB82B90 verbose 'DvsManager'] PersistAllDvsInfo called
    [2009-09-17 10:41:09.340 2E1F2B90 verbose 'DvsTracker'] FetchSwitches: added 1 items


    Note: In this example, you are reviewing the hostd management agent logs. The output is displayed one page at a time. The same command can be used for other log files (for example, hostdvpxavmkernelvmksummary, andvmkwarning). The logs available may differ between versions of vCenter Server and ESX/ESXi.

  3. To search the logs for a specific string, use the Select-String commandlet:

    Get-VMHost HostNameOrIP | Get-Log LogName | Select -expand Entries | Select-String SearchTerm| More
Based on VMware KB 1027932

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Hardware and firmware requirements for 64-bit guest operating systems

PurposeThis article explains the host machine hardware and firmware requirements for installing...

Logging in to the vCenter Server 5.0 Web Client fails with the error: unable to connect to vCenter Inventory Service

DetailsAfter upgrading from vCenter Server 4.1 to 5.0, you experience these symptoms:Cannot log...

Multiple network entries in vCenter Server 5.0.x after migrating virtual machines from a virtual switch to a virtual distributed switch

SymptomsAfter migrating virtual machines from a virtual switch to a virtual Distributed...

Minimum requirements for the VMware vCenter Server 5.x Appliance

PurposeIf you are using the VMware vCenter Server Appliance, beginning with vSphere 5.0 you can...