Scripts

Welcome to the Nutanix NEXT community. To get started please read our short welcome post. Thanks!

cancel
Showing results for 
Search instead for 
Did you mean: 

Get VM Statistic from Powershell

Wayfarer

Get VM Statistic from Powershell

If it helps other 

numread = (Get-NTNXVMStat -VMId $vmid -Metrics hypervisor_num_read_iops -IntervalInSecs $IntervalInSecs -StartTimeInUsecs $date_start -EndTimeInUsecs $date_end).values
$numwrite = (Get-NTNXVMStat -VMId $vmid -Metrics hypervisor_num_write_iops -IntervalInSecs $IntervalInSecs -StartTimeInUsecs $date_start -EndTimeInUsecs $date_end).values
$readlat = (Get-NTNXVMStat -VMId $vmid -Metrics hypervisor_avg_read_io_latency_usecs -IntervalInSecs $IntervalInSecs -StartTimeInUsecs $date_start -EndTimeInUsecs $date_end).values
$writelat = (Get-NTNXVMStat -VMId $vmid -Metrics hypervisor_avg_write_io_latency_usecs -IntervalInSecs $IntervalInSecs -StartTimeInUsecs $date_start -EndTimeInUsecs $date_end).values
$readkbps = (Get-NTNXVMStat -VMId $vmid -Metrics hypervisor_read_io_bandwidth_kBps -IntervalInSecs $IntervalInSecs -StartTimeInUsecs $date_start -EndTimeInUsecs $date_end).values
$writekbps = (Get-NTNXVMStat -VMId $vmid -Metrics hypervisor_write_io_bandwidth_kBps -IntervalInSecs $IntervalInSecs -StartTimeInUsecs $date_start -EndTimeInUsecs $date_end).values
$memory = (Get-NTNXVMStat -VMId $vmid -Metrics hypervisor_memory_usage_ppm -IntervalInSecs $IntervalInSecs -StartTimeInUsecs $date_start -EndTimeInUsecs $date_end).values
$cpu = (Get-NTNXVMStat -VMId $vmid -Metrics hypervisor_cpu_usage_ppm -IntervalInSecs $IntervalInSecs -StartTimeInUsecs $date_start -EndTimeInUsecs $date_end).values

 

a nice way to make a CSV about VM performance 

Tags (2)
1 REPLY
Highlighted
Community Manager

Re: Get VM Statistic from Powershell

Thanks for sharing @fjacquet1820 - looks good, do you have any other scripts to share or any scripts you are looking for that the community can help contribute back? 


--
Community Manager, Nutanix
Question Answered? Click Accept as Solution!
Tags (2)