s it possible to script export of a bunch of VMs from vrops (cpu% and memory % ) for x days in csv format? one file per vm?
Yes, have a look at vrops-export
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I am looking at the vmfields.yaml file and cannot find a field for
- alias: memDemand
metric: mem|guest_demand
in percentage
also how do I export 180days of data from list of VMs I have?
can i get this info with get-omstat?
Yes, that should be possible
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I tried this. do I need to adjust the intervaltype?
$int = ([DateTime]::Now).AddDays(-180)
$Vmlist = get-content "c:\temp\scripts\vms2.txt"
$key = Get-OMStatKey -name "cpu|workload", "mem|workload" -ResourceKind VirtualMachine
foreach ($vm in $vmlist){
Get-OMStat -Resource $vm -Key $statkey -from $int -IntervalType "Days" -IntervalCount 1 -RollupType "Avg" | export-csv -UseCulture -NoTypeInformation "c:\temp\\scripts\$vm.csv"
}
I'm not sure the OM cmdlets can use OBN, so I would do like this.
The rest of your code looks correct.
$Vmlist = get-content "c:\temp\scripts\vms2.txt"
$key = Get-OMStatKey -name "cpu|workload", "mem|workload" -ResourceKind VirtualMachine
foreach ($vmName in $vmlist) {
$vm = Get-VM -Name $vmName | Get-OMResource -ResourceKind 'VirtualMachine'
Get-OMStat -Resource $vm -Key $statkey -from $int -IntervalType "Days" -IntervalCount 1 -RollupType "Avg" | export-csv -UseCulture -NoTypeInformation "c:\temp\\scripts\$vm.csv"
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi Luc
Is it possible to get it in this format
NAME MEM|WORKLOAD CPU||WORKLOAD VALUE TIME
Have a look at Re: Help Speeding Up vROps report
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference