Working with latency sensitivity, which recently bit us in the ass, we are developing a report to show all VMs that have a low latency sensitivity, but are a little confused with the results. Is there any reason why get-vm and get-view would show different results for specific VMs?
This VM specifically has the normal setting in the VMX file.
Get-VM vma | Select Name, @{N="CPU_Scheduler_Priority";E={($_.ExtensionData.Config.ExtraConfig | `where {$_.Key -eq "sched.cpu.latencySensitivity"}).Value}}
Name CPU_Scheduler_Priority
---- ----------------------
vma normal
get-view -ViewType VirtualMachine -Filter @{"Name"="vma"} -Property Name,Config.LatencySensitivity | Select Name,@{N='Sensitivity Level';E={$_.Config.LatencySensitivity.Level}}
Name Sensitivity Level
---- -----------------
vma low
Ok, I just noticed, you are looking at 2 different properties.
The ExtraConfig entry is what was read from the VMX file.
This is not updated until you stop/start the VM.
The LatencySensitivity one is the actual value used by the VM.
I would suspect you changed the setting after the VM was powered on.
In short, the VMX value vs the actual value.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
No, and the values shouldn't be different when you are looking at the same VM.
Does this also return different values?
Select Name,
@{N='LatencyExt';E={($_.ExtensionData.Config.ExtraConfig | `where {$_.Key -eq "sched.cpu.latencySensitivity"}).Value}},
@{N='LatencyView';E={((Get-View -Id $_.ExtensionData.MoRef).Config.ExtraConfig | `where {$_.Key -eq "sched.cpu.latencySensitivity"}).Value}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
No running that shows the same results.
Get-VM vma | Select Name,@{N='LatencyExt';E={($_.ExtensionData.Config.ExtraConfig | `where {$_.Key -eq "s
ched.cpu.latencySensitivity"}).Value}}, @{N='LatencyView';E={((Get-View -Id $_.ExtensionData.MoRef).Config.ExtraConfig | `where {$_.Key -eq "sched.cpu
.latencySensitivity"}).Value}}
Name LatencyExt LatencyView
---- ---------- -----------
vma normal normal
Ok, I just noticed, you are looking at 2 different properties.
The ExtraConfig entry is what was read from the VMX file.
This is not updated until you stop/start the VM.
The LatencySensitivity one is the actual value used by the VM.
I would suspect you changed the setting after the VM was powered on.
In short, the VMX value vs the actual value.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks LucD!
So would this be accurate?
Get-View -ViewType VirtualMachine -Filter @{"Name"="vma"} | Select Name,@{N='RunningConfig';E={$_.Config.
LatencySensitivity.Level}},@{N='VMX';E={($_.Config.ExtraConfig | `where {$_.Key -eq "sched.cpu.latencySensitivity"}).Value}}
Name RunningConfig VMX
---- ------------- ---
vma low normal
Yes.
And when you power off the VM the value in the VMX should be updated.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference