This happened after my vCenter has restarted yesterday, before vCenter was restarted I can get all stat normally so why the metric counter doesn't exist and how to fix this?
Here's my environment and error log from PowerCLI.
My environment contains 1 vCenter(6.7.0.10000) and 1 ESXi
Get-Stat : 1/24/2019 11:36:02 AM Get-Stat The metric counter "mem.usage.average" doesn't exist for entity "PCMS".
At line:1 char:21
+ Get-VM -Name PCMS | Get-Stat -IntervalMins 1440
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (mem.usage.average:String) [Get-Stat], VimException
+ FullyQualifiedErrorId : Client20_RuntimeDataServiceImpl_CheckUserMetrics_MetricDoesntExist,VMware.VimAutomation.ViCore.Cmdlets.Commands.GetViStats
Get-Stat : 1/24/2019 11:36:02 AM Get-Stat The metric counter "net.usage.average" doesn't exist for entity "PCMS".
At line:1 char:21
+ Get-VM -Name PCMS | Get-Stat -IntervalMins 1440
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (net.usage.average:String) [Get-Stat], VimException
+ FullyQualifiedErrorId : Client20_RuntimeDataServiceImpl_CheckUserMetrics_MetricDoesntExist,VMware.VimAutomation.ViCore.Cmdlets.Commands.GetViStats