I am trying to create script in which I'll catch the problem occurence with (if) then export out VC diagnostic bundle, everything is ready, with exception exporting diagnostic data from VC part,
I tried to work with get-log but it seems does not have an option to collect entire VC logs and export out as zip, I also tried using method from VI SDK, but I am a bit at a loss at this point with
diagnosticManager -> GenerateLogBundles_Task (method)
any help is appreciated, thanks!
That cmdlet has a second parameter set which is triggered by adding the Bundle boolean. See this table:
ParameterSet: logSet Name Type IsMandatory Pipeline ---- ---- ----------- -------- Key String[] True True VMHost VMHost[] False True StartLineNum Int32 False False NumLines Int32 False False Server VIServer[] False False ParameterSet: logBundleSet Name Type IsMandatory Pipeline ---- ---- ----------- -------- VMHost VMHost[] False True Bundle Boolean False False DestinationPath String True False Server VIServer[] False False RunAsync Boolean False False
You use it like so (after connecting to the log source, e.g. vc or esx):
get-log -bundle:$true -destinationpath c:\logs -runasync
[PowerShell MVP|https://mvp.support.microsoft.com/profile=5547F213-A069-45F8-B5D1-17E5BD3F362F], VI Toolkit forum moderator
Author of the upcoming book: Managing VMware Infrastructure with PowerShell
Co-Host, PowerScripting Podcast (http://powerscripting.net)
Need general, non-VMware-related PowerShell Help? Try the forums at PowerShellCommunity.org
halr9000, Arigato Tres-mucho!!! I was hitting my head for few hours...
De nada papel nein borscht?
[PowerShell MVP|https://mvp.support.microsoft.com/profile=5547F213-A069-45F8-B5D1-17E5BD3F362F], VI Toolkit forum moderator
Author of the upcoming book: Managing VMware Infrastructure with PowerShell
Co-Host, PowerScripting Podcast (http://powerscripting.net)
Need general, non-VMware-related PowerShell Help? Try the forums at PowerShellCommunity.org
halr9000, forgot to ask, in addition if one wants to specify hosts (within cluster), datacenter etc, what would be the parameterSet to specify? Thanks.
If you look at my table, you'll see the VMHost param accepts values on the pipeline. Therefore, what I'd do is something like this:
get-cluster foo | get-vmhost | get-log ...
That would work against all hosts in the "foo" cluster.
[PowerShell MVP|https://mvp.support.microsoft.com/profile=5547F213-A069-45F8-B5D1-17E5BD3F362F], VI Toolkit forum oderator
Author of the upcoming book: Managing VMware Infrastructure with PowerShell
Co-Host, PowerScripting Podcast (http://powerscripting.net)
Need general, non-VMware-related PowerShell Help? Try the forums at PowerShellCommunity.org
Again, Mucho Arigato Schoen, halr9000!