PowerCLI

 View Only
  • 1.  Gathering VM logs from esxi hosts

    Posted Nov 18, 2011 05:04 AM

    Hi,

    I just thought I would ask although I doubt it is possible.

    Is there a way to gather logs on VM's from all the relevant log files on the ESXi node the VM is running on.  I am not just refering to the logs located with the VM, but all other logs, hostd,/messages...etc

    I guess im just wanting a quick way to gather data on a VM so I can resolve possible issues as they come up instead of search.

    I already have something like this just as a script, but I am just curious...

    thanks!!



  • 2.  RE: Gathering VM logs from esxi hosts
    Best Answer

    Posted Nov 18, 2011 05:11 AM

    If you want to collect messages and other vSphere logs use syslog.  vCenter 5 comes with a syslog collector program, or you can use something like Kiwi syslog.

    Guest logs are already stored on the VMFS datastore, so no point capturing them.

    Is this what you are looking for?



  • 3.  RE: Gathering VM logs from esxi hosts

    Posted Nov 18, 2011 05:17 AM

    ya, I guess it was just more of a generic question. I am still trying to understand the power of powercli since I am really new to it so sometimes I'll ask dumb questions.

    I already have all my nodes reporting to a syslog system.

    thanks for the response!!!



  • 4.  RE: Gathering VM logs from esxi hosts

    Posted Nov 18, 2011 05:23 AM

    Hello, drivera01-

    To grab ESXi host logs via PowerShell/PowerCLI, you can use the Get-Log cmdlet.  The help, of course, has examples.  Like, getting a diagnostic log bundle for a host:

    Get-VMHost -Name myHost | Get-Log -Bundle -DestinationPath "c:\temp\VMHostBundeLog"

    Give that a shot, if you have not already.



  • 5.  RE: Gathering VM logs from esxi hosts

    Posted Nov 18, 2011 06:03 AM

    thanks for the info mattboren!!!

    I'll check it out... this noobie needs all the hints I can get...I appreciate it!!



  • 6.  RE: Gathering VM logs from esxi hosts

    Posted Nov 18, 2011 06:17 AM

    Perhaps useful to know, with the Get-Log cmdlet you can retrieve logs from ESX(i) servers and the vCenter server.

    When you add the -VMHost parameter you will get ESX(i) logs, without that parameter you will get vCenter logs.

    The Get-LogType cmdlet will tell you which logs are available in both cases, ESX(i) and vCenter.

    You use the Key parameter with one of the Key values listed above to fetch a specific log.