General Discussion
General Discussion
Does anybody know here a powershell command to list all the disks in an aggregate? ( disks could be partitioned or non-partitioned). I haven't been able to find such a command other than using a 7-mode command "aggr show -r". Thanks.
Solved! See The Solution
Hi,
You could try the invoke-ncsystemapi cmdlet with the command mentioned by @Ontapforrum
Something like this:
[Array]$command = @("set diag;storage", "disk", "partition", "show")
Try{
$api = $("<system-cli><args><arg>" + ($command -join "</arg><arg>") + "</arg></args></system-cli>")
Write-Host $("Executed Command`: " + $([String]::Join(" ", $command)))
$response = Invoke-NcSystemApi -Request $api -ErrorAction Stop
}Catch{
Write-Warning -Message $("Failed Executing Command`: " + $([String]::Join(" ", $command))
Break;
}
$response.results."cli-output"
/Matt
PS C:\> Get-NcDisk
There are few more get-ncdisk* commands on page-31: (give it a try)
https://www.netapp.com/pdf.html?item=/media/16861-tr-4475pdf.pdf
Thank you so much.
This command lists disks and their aggrs if the disks aren't partitioned. The aggr field is bland when disks are partitioned/shared. How to list those disks with aggr information in Powershell? Thanks.
Hi,
You could try the invoke-ncsystemapi cmdlet with the command mentioned by @Ontapforrum
Something like this:
[Array]$command = @("set diag;storage", "disk", "partition", "show")
Try{
$api = $("<system-cli><args><arg>" + ($command -join "</arg><arg>") + "</arg></args></system-cli>")
Write-Host $("Executed Command`: " + $([String]::Join(" ", $command)))
$response = Invoke-NcSystemApi -Request $api -ErrorAction Stop
}Catch{
Write-Warning -Message $("Failed Executing Command`: " + $([String]::Join(" ", $command))
Break;
}
$response.results."cli-output"
/Matt
I don't know how to get that info via PS, but if you just need that info, you can get it directly from Ontap CLI from diag mode.
::>set diag
::*> storage disk partition show