Hi All,
Just finished a support call with VMware and unfortunately the vmware.log wasn't updated due the logging being disabled.
I found random VMs with this issues, there was probably a template with this parameter which got deployed several times.
.
I need a way to scan all guests for this parameter and cheange the value to true, any help would be appreciated
And with this line you can scan what the setting is on your VMs
Get-VM | Select Name, @{N="Logging Enabled";E={$_.ExtensionData.Config.Flags.enableLogging}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Virtual Machine logging | LucD notesLucD notes
And with this line you can scan what the setting is on your VMs
Get-VM | Select Name, @{N="Logging Enabled";E={$_.ExtensionData.Config.Flags.enableLogging}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi Luc,
Thanks, can help filter out enableLogging -eq TRUE then I can output that to CSV using Export-csv, then if its not too much trouble set guest VM eq FALSE to TRUE ?
You can use my function from Virtual Machine logging to enable logging.
Something like this
Get-VM |
Where {!$_.ExtensionData.Config.Flags.enableLogging} | %{
Set-VMLogging -VM $_ -Logging:$true
}
To report on the VM that have logging enabled, you can do something like this
Get-VM |
Where {$_.ExtensionData.Config.Flags.enableLogging} |
Select Name, @{N="Logging Enabled";E={$_.ExtensionData.Config.Flags.enableLogging}} |
Export-Csv report.csv -NoTypeInformation -UseCulture
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi Luc,
That's great, is there anyway to report on guest with logging disabled rather than enabled ?
Sure, change this line
Where {$_.ExtensionData.Config.Flags.enableLogging} |
to
Where {!$_.ExtensionData.Config.Flags.enableLogging} |
The ! negates the Boolean that follows.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I tried by keeping "!" still report is filled up with logging enabled VMs, without "!" and with both reports VMs are same. can you please suggest on it