Hi,
For this script how do I specify a particular datastore within that cluster?
Thanks,
Greg
You can use a Where-clause to filter the one(s) you want.
Get-Cluster 'Carrollton Dev - Vsphere 5' | Get-VMHost | Get-Datastore | Where {$_.Name -eq "equallogic-1-vol-2"} | Sort-Object -Unique
But why make it so difficult, you can just do the Get-Datastore with that name.
Get-Datastore -Name "equallogic-1-vol-2"
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Pass all the ESX(i) hosts in the cluster and then only keep the unique objects.
Get-Cluster 'Carrollton Dev - Vsphere 5' | Get-VMHost | Get-Datastore | Sort-Object -Unique
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Excuse my lack of knowledge, i'm a complete noob with powercli, where do i put in that syntax say "equallogic-1-vol-2"
Thanks,
Greg
You can use a Where-clause to filter the one(s) you want.
Get-Cluster 'Carrollton Dev - Vsphere 5' | Get-VMHost | Get-Datastore | Where {$_.Name -eq "equallogic-1-vol-2"} | Sort-Object -Unique
But why make it so difficult, you can just do the Get-Datastore with that name.
Get-Datastore -Name "equallogic-1-vol-2"
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Awesome, thanks for the help..
Greg
Hi LucD.
I'm using a script to create a .csv file to monitor the latency of my datastores.
In this report I put the information I need in this way:
Foreach ($oEntry in $Report) {
$oObject = New-Object PSObject -Property @{
Entity = $oEntry.Entity
Instance = $oEntry.Instance
MetricId = $oEntry.MetricId
Timestamp = ($oentry.Timestamp).toString('dd/MM/yyyy HH:mm')
Value = $oEntry.Value
Unit = $oEntry.Unit
}
Now, I would like to know if there is a way to change the Instance = $oEntry.Instance, that returns something like that: 4d4b3f85-db8f3f4c-3fc4-984be1xxxxxx, with the name of the datastore, I mean something like Datastore1, Datastore2 ecc. ecc.
Thank you
V.