You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi everyone, not sure if anyone tracks this stuff anymore, but thought I'd post anyway, having an issue with the 60 Powered Off VMs script, it seems to bomb out (ram just goes nuts) on the server running the script and it never completes, even if left for days. We have 2 VCs in Europe, 2 VCs in the US, the script only fails on the US ones, all VCs are the same in terms of their logging/retention levels, so I can't figure out why the script fails for the US ones. Anyone who has encountered this issue before or can help me identify where the issue is, would be greatly appreciated.
The text was updated successfully, but these errors were encountered:
Thats a very strange one to fail on, that script filters the already discovered information to give you an answer, maybe run the code independently in a powershell session to see whats going on? You should be able to connect a powercli session and then run:
$VM = Get-VM | Sort-Object Name
# Start of Settings
# VMs not to report on (regex)
$IgnoredVMs = "TEMPLATE|BUILD"
# VmPathName not to report on
$IgnoredVMpath = "-backup-"
# VmFolder not to report on
$IgnoredVMFolder = "Templates"
# Report VMs powered off over this many days
$PoweredOffDays = 7
# End of Settings
# Update settings where there is an override
$IgnoredVMs = Get-vCheckSetting $Title "IgnoredVMs" $IgnoredVMs
$IgnoredVMpath = Get-vCheckSetting $Title "IgnoredVMpath" $IgnoredVMpath
$PoweredOffDays = Get-vCheckSetting $Title "PoweredOffDays" $PoweredOffDays
$VM | Where-Object {$_.ExtensionData.Config.ManagedBy.ExtensionKey -ne 'com.vmware.vcDr' -and
$_.PowerState -eq "PoweredOff" -and
$_.LastPoweredOffDate -lt $date.AddDays(-$PoweredOffDays) -and
$_.Name -notmatch $IgnoredVMs -and
$_.Folder.Name -notmatch $IgnoredVMFolder -and
$_.ExtensionData.Config.Files.VmPathName -notmatch $IgnoredVMpath} |
Select-Object -Property Name, LastPoweredOffDate, @{l = 'Folder'; e = {$_.Folder.Name}}, Notes |
Sort-Object -Property LastPoweredOffDate
Hi everyone, not sure if anyone tracks this stuff anymore, but thought I'd post anyway, having an issue with the 60 Powered Off VMs script, it seems to bomb out (ram just goes nuts) on the server running the script and it never completes, even if left for days. We have 2 VCs in Europe, 2 VCs in the US, the script only fails on the US ones, all VCs are the same in terms of their logging/retention levels, so I can't figure out why the script fails for the US ones. Anyone who has encountered this issue before or can help me identify where the issue is, would be greatly appreciated.
The text was updated successfully, but these errors were encountered: